/* ============================================
   VARIABLES Y CONFIGURACIÓN GLOBAL
   ============================================ */
:root {
    --primary-color: #E50914;
    --primary-dark: #B20710;
    --secondary-color: #831010;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f1;
    --bg-dark: #141414;
    --bg-darker: #0a0a0a;
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;
    
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f1;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Make images responsive by default */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   HEADER FIJO Y ANIMADO
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #E50914 0%, #B20710 50%, #831010 100%);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: var(--transition);
}

.header.scrolled {
    padding: 10px 0;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.logo i {
    font-size: 32px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Buscador */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 10px 40px 10px 15px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    width: 200px;
    transition: var(--transition);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    width: 250px;
}

.search-box i {
    position: absolute;
    right: 15px;
    color: white;
    pointer-events: none;
}

/* Botones del header */
.menu-toggle,
.account-btn,
.cart-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.menu-toggle:hover,
.account-btn:hover,
.cart-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* Menú móvil */
.mobile-menu {
    display: none;
    background: white;
    box-shadow: var(--shadow-md);
    padding: 20px;
    border-radius: 0 0 15px 15px;
}

.mobile-menu.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu a {
    display: block;
    padding: 12px 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: var(--transition);
}

.mobile-menu a:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    transform: translateX(5px);
}

.mobile-menu a i {
    margin-right: 10px;
    width: 20px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    margin-top: 80px;
    background: linear-gradient(135deg, #141414 0%, #000000 100%);
    padding: 80px 20px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--primary-color);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 15px;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.feature i {
    font-size: 24px;
}

.cta-button {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    animation: fadeInUp 0.8s ease 0.6s both;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   BARRA DE USUARIO
   ============================================ */
.user-bar {
    background: linear-gradient(90deg, #E50914, #B20710);
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow-md);
}

.user-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.user-balance {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 20px;
}

.btn-recharge {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-recharge:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* ============================================
   SECCIÓN DE SERVICIOS
   ============================================ */
.services-section {
    padding: 60px 20px;
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 40px;
    color: var(--text-primary);
}

/* Filtros */
.filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

/* Ajustes para checkboxes de selección de pantallas en modales y admin */
#screenCheckboxes {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)) !important;
    gap: 10px !important;
}

#screenCheckboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

#screenCheckboxes input[name="screenNumbers"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.filter-btn {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Grid de servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.service-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #E50914, #B20710);
    transform: scaleX(0);
    transition: var(--transition);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.service-logo {
    width: 100%;
    height: 120px;
    object-fit: contain;
    object-position: center;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: block;
    max-width: 100%;
    box-sizing: border-box;
}

.service-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.service-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.service-features {
    margin-bottom: 15px;
}

.service-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.service-feature i {
    color: var(--accent-color);
}

.service-pricing {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.price-option {
    flex: 1;
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.price-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.price-amount {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.service-actions {
    display: flex;
    gap: 10px;
}

.btn-add-cart,
.btn-view-details {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-add-cart {
    background: var(--primary-color);
    color: white;
}

.btn-add-cart:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-view-details {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-view-details:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   MODALES
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-xl);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 24px;
}

/* Tabs de autenticación */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.auth-tab.active {
    color: var(--primary-color);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* Tabs del modal de cuenta (Mi cuenta) */
.account-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.account-tab {
    padding: 6px 10px;
    border: none;
    background: #6b7280;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.account-tab.active {
    background: var(--primary-color);
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Botones */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
}

.btn-secondary:hover {
    background: var(--danger-color);
    color: white;
}

/* Carrito */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 10px;
}

.cart-item-info h4 {
    margin-bottom: 5px;
    color: var(--text-primary);
}

.cart-item-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.cart-item-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

.cart-item-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.cart-item-remove:hover {
    background: #dc2626;
}

.cart-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: bold;
}

.total-amount {
    color: var(--primary-color);
}

.empty-cart {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-cart i {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Recarga de saldo */
.recharge-info {
    background: #dbeafe;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.recharge-info p {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.recharge-info ol {
    margin-left: 20px;
    color: var(--text-secondary);
}

.recharge-info ol li {
    margin-bottom: 5px;
}

.bank-accounts {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.bank-accounts h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.bank-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent-color);
}

/* Cuenta de usuario */
.account-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.account-section:last-of-type {
    border-bottom: none;
}

.account-section h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-info p {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.account-actions {
    margin-top: 20px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 40px 20px 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

/* ============================================
   NOTIFICACIONES TOAST
   ============================================ */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid var(--accent-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

.toast i {
    font-size: 24px;
}

.toast.success i {
    color: var(--accent-color);
}

.toast.error i {
    color: var(--danger-color);
}

.toast.warning i {
    color: var(--warning-color);
}

.toast.info i {
    color: var(--primary-color);
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .hero-features {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box input {
        width: 150px;
    }
    
    .search-box input:focus {
        width: 180px;
    }
    
    /* Hide only the account text on small screens; keep the menu toggle visible */
    .account-btn span {
        display: none;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .toast {
        min-width: auto;
        width: calc(100vw - 40px);
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
    }

    /* Ajustes móviles: reducir padding del header y tamaños de botones */
    .header-content {
        padding: 8px 12px;
    }

    .hero {
        padding: 50px 12px;
        margin-top: 64px;
    }

    .cta-button {
        padding: 12px 24px;
        font-size: 16px;
    }

    .menu-toggle {
        padding: 8px 10px;
        font-size: 16px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 10px;
        font-size: 14px;
    }

    .service-card {
        padding: 15px;
    }

    .service-logo {
        height: 100px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 10px;
    }
    
    .logo span {
        font-size: 18px;
    }
    
    .logo i {
        font-size: 24px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .filters {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 13px;
    }

    /* Ajustes extra para pantallas muy pequeñas */
    .header-content {
        padding: 6px 8px;
    }

    .hero {
        padding: 40px 10px;
        margin-top: 56px;
    }

    .cta-button {
        padding: 10px 18px;
        font-size: 15px;
    }

    .menu-toggle {
        padding: 6px 8px;
        font-size: 15px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 9px;
        font-size: 13px;
    }
}

/* ============================================
   UTILIDADES
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
