        :root {
            --primary: #2a7fba;
            --primary-dark: #1a5f8a;
            --secondary: #4CAF50;
            --accent: #ff6b6b;
            --dark: #333;
            --light: #f8f9fa;
            --whatsapp: #25D366;
            --nequi: #8200ff;

            /* Superficie / fondo (se redefinen en modo oscuro) */
            --bg-body: #f4f7fb;
            --bg-surface: #ffffff;
            --bg-surface-alt: #f8f9fa;
            --text-main: #26313d;
            --text-muted: #6b7785;
            --border-soft: #e4e9ef;

            --shadow-sm: 0 2px 8px rgba(20, 30, 50, 0.06);
            --shadow-md: 0 8px 24px rgba(20, 30, 50, 0.10);
            --shadow-lg: 0 16px 40px rgba(20, 30, 50, 0.14);
            --radius-md: 12px;
            --radius-lg: 18px;
            --transition-fast: 0.2s ease;
            --transition-mid: 0.35s cubic-bezier(0.22, 1, 0.36, 1);

            --stock-ok: #2eaa5f;
            --stock-low: #f0a83a;
            --stock-out: #e5484d;
        }

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

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--light);
            color: var(--dark);
            line-height: 1.6;
            position: relative;
            padding-bottom: 100px;
            transition: background-color var(--transition-mid), color var(--transition-mid);
        }

        /* Header */
        header {
            background: linear-gradient(120deg, #0d3b66 0%, var(--primary) 45%, #12a4c9 100%);
            color: white;
            padding: 2.2rem 0;
            text-align: center;
            position: relative;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(13, 59, 102, 0.35);
        }

        header::before {
            content: '';
            position: absolute;
            inset: 0;
            background:
                radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
                radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.10) 0%, transparent 50%);
            pointer-events: none;
        }

        header::after {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            height: 4px;
            background: linear-gradient(90deg, #0d3b66, var(--primary), #21c7e8, var(--primary), #0d3b66);
        }

        header .container {
            position: relative;
            z-index: 1;
        }

        .logo {
            font-size: 2.3rem;
            font-weight: 800;
            letter-spacing: 0.3px;
            margin-bottom: 0.4rem;
            display: flex;
            align-items: center;
            justify-content: center;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
        }
        
        .logo i {
            margin-right: 15px;
            font-size: 2rem;
            filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
        }

        .logo img#companyLogoImg {
            height: 48px;
            width: auto;
            margin-right: 15px;
            border-radius: 8px;
            display: none;
            object-fit: contain;
            background: #fff;
            padding: 2px;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
        }
        
        .slogan {
            font-size: 1.08rem;
            font-weight: 300;
            letter-spacing: 0.4px;
            opacity: 0.92;
        }
        
        /* Navigation */
        nav {
            background-color: white;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        
        .menu {
            display: flex;
            justify-content: center;
            list-style: none;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0;
        }
        
        .menu li {
            position: relative;
        }
        
        .menu a {
            color: var(--dark);
            text-decoration: none;
            font-weight: 600;
            padding: 1rem 1.5rem;
            display: block;
            transition: all 0.3s ease;
            font-size: 1rem;
        }
        
        .menu a:hover {
            color: var(--primary);
            background-color: #f0f8ff;
        }
        
        .menu a.active {
            color: var(--primary);
            border-bottom: 3px solid var(--primary);
        }
        
        /* Main Content */
        .container {
            max-width: 1200px;
            margin: 2rem auto;
            padding: 0 1.5rem;
        }
        
        /* Hero Section */
        .hero {
            background: url('https://images.unsplash.com/photo-1587854692152-cbe660dbde88?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80') no-repeat center center/cover;
            height: 400px;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: white;
            border-radius: 10px;
            margin-bottom: 3rem;
            position: relative;
        }
        
        .hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            border-radius: 10px;
        }
        
        .hero-content {
            position: relative;
            z-index: 1;
            padding: 2rem;
            max-width: 800px;
            margin: 0 auto;
            text-align: center;
        }
        
        .hero h1 {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
        }
        
        .hero p {
            font-size: 1.2rem;
            margin-bottom: 1.5rem;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
        }
        
        .btn {
            display: inline-block;
            background-color: var(--primary);
            color: white;
            padding: 0.8rem 1.8rem;
            border-radius: 50px;
            text-decoration: none;
            font-weight: 600;
            transition: all 0.3s ease;
            border: 2px solid var(--primary);
        }
        
        .btn:hover {
            background-color: transparent;
            color: white;
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }
        
        /* Sections */
        .section {
            margin-bottom: 3rem;
            background-color: white;
            border-radius: 10px;
            padding: 2rem;
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        }
        
        .section-title {
            font-size: 1.8rem;
            color: var(--primary);
            margin-bottom: 1.5rem;
            padding-bottom: 0.5rem;
            border-bottom: 3px solid var(--primary);
            display: inline-block;
        }
        
        /* Medicamentos */
        .medicamentos-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 1.5rem;
            margin-top: 1.5rem;
        }

        /* La cuadrícula de Servicios tiene pocas tarjetas: se centra
           como bloque en vez de estirarse a lo ancho de la pantalla. */
        .servicios-grid {
            grid-template-columns: repeat(auto-fit, minmax(250px, 300px));
            justify-content: center;
        }
        
        .med-card {
            background-color: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 3px 10px rgba(0,0,0,0.1);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        
        .med-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        }
        
        .med-img {
            height: 180px;
            overflow: hidden;
        }
        
        .med-img img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }
        
        .med-card:hover .med-img img {
            transform: scale(1.1);
        }
        
        .med-info {
            padding: 1.2rem;
        }
        
        .med-name {
            font-size: 1.2rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--dark);
        }
        
        .med-type {
            display: inline-block;
            background-color: #e3f2fd;
            color: var(--primary);
            padding: 0.3rem 0.8rem;
            border-radius: 50px;
            font-size: 0.8rem;
            font-weight: 600;
            margin-bottom: 0.8rem;
        }
        
        .med-price {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--secondary);
            margin-bottom: 1rem;
        }

        .med-price.med-price-oculto {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-muted);
            background: var(--bg-surface-alt);
            border: 1px dashed var(--border-soft);
            border-radius: var(--radius-md);
            padding: 0.6rem;
            line-height: 1.4;
        }
        
        .med-btn {
            display: block;
            width: 100%;
            background-color: var(--secondary);
            color: white;
            border: none;
            padding: 0.7rem;
            border-radius: 5px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .med-btn:hover {
            background-color: #3d8b40;
        }
        
        /* Carrito de Compras */
        #cartIcon {
            position: fixed;
            bottom: 30px;
            right: 30px;
            background-color: var(--primary);
            color: white;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
            z-index: 999;
        }
        
        #cartIcon i {
            font-size: 1.5rem;
        }
        
        #cartIcon span {
            position: absolute;
            top: -5px;
            right: -5px;
            background-color: var(--accent);
            color: white;
            width: 25px;
            height: 25px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: bold;
        }
        
        #cartSidebar {
            position: fixed;
            top: 0;
            right: -400px;
            width: 400px;
            height: 100vh;
            background-color: white;
            box-shadow: -5px 0 15px rgba(0,0,0,0.1);
            transition: right 0.3s ease;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
        }
        
        #cartSidebar.show {
            right: 0;
        }
        
        .cart-header {
            padding: 1.5rem;
            border-bottom: 1px solid #eee;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            background: white;
            z-index: 1;
        }
        
        .close-cart {
            font-size: 1.8rem;
            cursor: pointer;
        }
        
        #cartItems {
            padding: 1.5rem;
            flex-grow: 1;
        }
        
        .cart-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 1rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid #f5f5f5;
        }
        
        .cart-item-info {
            flex-grow: 1;
        }
        
        .cart-item-name {
            font-weight: 600;
            margin-bottom: 0.3rem;
        }
        
        .cart-item-price {
            color: var(--secondary);
            font-weight: 600;
        }
        
        .cart-item-quantity {
            display: flex;
            align-items: center;
            margin-top: 0.5rem;
        }
        
        .quantity-btn {
            width: 25px;
            height: 25px;
            border: 1px solid #ddd;
            background-color: #f5f5f5;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .quantity-input {
            width: 40px;
            text-align: center;
            margin: 0 5px;
            border: 1px solid #ddd;
            padding: 2px;
        }
        
        .remove-item {
            color: var(--accent);
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1.2rem;
            margin-left: 1rem;
        }
        
        /* Bloque de envío de pedido por WhatsApp (carrito) */
        .order-send-box {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white;
            border-radius: 10px;
            padding: 1.5rem;
            margin: 1.5rem;
            text-align: center;
            box-shadow: var(--shadow-md);
        }

        .order-send-header {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-bottom: 15px;
        }

        .order-send-icon {
            font-size: 1.8rem;
            color: var(--whatsapp);
        }

        .order-send-box p {
            color: rgba(255, 255, 255, 0.9);
            font-size: 0.92rem;
            margin-bottom: 0.6rem;
        }

        /* Botón verde para enviar el pedido directamente por WhatsApp */
        .whatsapp-order-btn {
            background: var(--whatsapp);
            color: white;
            border: none;
            padding: 12px 20px;
            border-radius: 50px;
            font-weight: bold;
            font-size: 1rem;
            margin-top: 10px;
            cursor: pointer;
            transition: all 0.3s;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .whatsapp-order-btn:hover {
            background: #1ebe57;
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(37, 211, 102, 0.35);
        }

        
        .copy-btn {
            background: rgba(255,255,255,0.2);
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 5px;
            margin-left: 10px;
            cursor: pointer;
            font-size: 0.8rem;
        }
        
        .cart-footer {
            padding: 1.5rem;
            border-top: 1px solid #eee;
        }
        
        .cart-total {
            display: flex;
            justify-content: space-between;
            margin-bottom: 1rem;
            font-size: 1.2rem;
            font-weight: 600;
        }
        
        .cart-checkout {
            width: 100%;
            padding: 1rem;
            background-color: var(--secondary);
            color: white;
            border: none;
            border-radius: 5px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        
        .cart-checkout:hover {
            background-color: #3d8b40;
        }
        
        .whatsapp-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background-color: var(--whatsapp);
            color: white;
            padding: 0.8rem 1.5rem;
            border-radius: 50px;
            text-decoration: none;
            font-weight: 600;
            margin-top: 1rem;
            transition: all 0.3s ease;
            width: 100%;
            text-align: center;
        }
        
        .whatsapp-btn i {
            margin-right: 8px;
            font-size: 1.2rem;
        }
        
        .whatsapp-btn:hover {
            background-color: #128C7E;
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        
        /* Modal de confirmación de pago */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.7);
            z-index: 2000;
            justify-content: center;
            align-items: center;
        }
        
        .modal-content {
            background-color: white;
            border-radius: 10px;
            width: 90%;
            max-width: 500px;
            padding: 2rem;
            position: relative;
            animation: modalFadeIn 0.3s;
        }
        
        @keyframes modalFadeIn {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .close-modal {
            position: absolute;
            top: 15px;
            right: 15px;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--dark);
        }
        
        .modal-title {
            color: var(--primary);
            margin-bottom: 1rem;
            font-size: 1.5rem;
        }
        
        .modal-body {
            margin-bottom: 1.5rem;
        }
        
        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }
        
        .modal-btn {
            padding: 0.7rem 1.2rem;
            border-radius: 5px;
            border: none;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .modal-btn-primary {
            background-color: var(--primary);
            color: white;
        }
        
        .modal-btn-primary:hover {
            background-color: #1a5f8a;
        }
        
        .modal-btn-secondary {
            background-color: #f0f0f0;
            color: var(--dark);
        }
        
        .modal-btn-secondary:hover {
            background-color: #e0e0e0;
        }
        
        /* Pestañas independientes (secciones) */
        .page-section {
            display: none;
        }

        .page-section.active {
            display: block;
        }

        #inicio.page-section.active {
            display: flex;
        }

        /* Stock de productos */
        .med-stock {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 0.8rem;
        }

        .med-stock.disponible {
            color: var(--secondary);
        }

        .med-stock.agotado {
            color: var(--accent);
        }

        .med-btn.agotado-btn {
            background-color: #cccccc;
            cursor: not-allowed;
        }

        .med-btn.agotado-btn:hover {
            background-color: #cccccc;
        }

        /* Portal Administrativo */
        .admin-login-box {
            max-width: 400px;
            margin: 0 auto;
        }

        .admin-form-group {
            margin-bottom: 1.2rem;
            text-align: left;
        }

        .admin-form-group label {
            display: block;
            font-weight: 600;
            margin-bottom: 0.4rem;
        }

        .admin-form-group input {
            width: 100%;
            padding: 0.7rem;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 1rem;
        }

        .admin-error {
            color: var(--accent);
            margin-bottom: 1rem;
            font-weight: 600;
            display: none;
        }

        .admin-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 1.5rem;
        }

        .admin-table th, .admin-table td {
            padding: 0.8rem;
            border-bottom: 1px solid #eee;
            text-align: left;
        }

        .admin-table th {
            background-color: #f0f8ff;
            color: var(--primary);
        }

        .admin-table input[type="number"] {
            width: 100px;
            padding: 0.4rem;
            border: 1px solid #ddd;
            border-radius: 5px;
        }

        .admin-save-btn {
            background-color: var(--secondary);
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 5px;
            cursor: pointer;
            font-weight: 600;
        }

        .admin-save-btn:hover {
            background-color: #3d8b40;
        }

        .admin-logout-btn {
            background-color: var(--accent);
            color: white;
            border: none;
            padding: 0.6rem 1.2rem;
            border-radius: 50px;
            cursor: pointer;
            font-weight: 600;
            margin-bottom: 1.5rem;
        }

        .admin-note {
            background-color: #fff8e1;
            border-left: 4px solid #ffc107;
            padding: 0.8rem 1rem;
            margin-top: 1.5rem;
            font-size: 0.9rem;
        }

        /* ============================================================
           Buscador y filtros
        ============================================================ */
        .toolbar-filtros {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 2rem;
            align-items: center;
        }

        .search-box {
            flex: 1;
            min-width: 220px;
            position: relative;
        }

        .search-box i {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: #999;
        }

        .search-box input {
            width: 100%;
            padding: 0.8rem 1rem 0.8rem 2.6rem;
            border: 2px solid #e0e6ed;
            border-radius: 50px;
            font-size: 1rem;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }

        .search-box input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(42, 127, 186, 0.12);
        }

        .filter-select {
            padding: 0.8rem 1.2rem;
            border: 2px solid #e0e6ed;
            border-radius: 50px;
            font-size: 1rem;
            background-color: white;
            cursor: pointer;
            min-width: 180px;
            transition: border-color 0.3s ease;
        }

        .filter-select:focus {
            outline: none;
            border-color: var(--primary);
        }

        .no-resultados {
            text-align: center;
            padding: 3rem 1rem;
            color: #888;
            font-size: 1.1rem;
            grid-column: 1 / -1;
        }

        .no-resultados i {
            font-size: 2.5rem;
            display: block;
            margin-bottom: 1rem;
            color: #ccc;
        }

        /* ============================================================
           Ofertas / Destacados
        ============================================================ */
        .ofertas-section {
            margin-bottom: 2.5rem;
        }

        .ofertas-titulo {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            font-size: 1.3rem;
            color: var(--accent);
            margin-bottom: 1rem;
            font-weight: 700;
        }

        .ofertas-titulo i {
            animation: pulse-fire 1.6s ease-in-out infinite;
        }

        @keyframes pulse-fire {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.15); }
        }

        .discount-badge {
            background-color: var(--accent);
            color: white;
            font-size: 0.75rem;
            padding: 3px 10px;
            border-radius: 50px;
            margin-left: 6px;
            font-weight: 700;
        }

        .price-old {
            text-decoration: line-through;
            color: #999;
            font-size: 0.9rem;
            margin-right: 8px;
        }

        /* ============================================================
           Animación de entrada de tarjetas
        ============================================================ */
        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(18px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .med-card {
            animation: fadeInUp 0.45s ease both;
        }

        .med-btn {
            transition: transform 0.15s ease, background-color 0.3s ease, box-shadow 0.3s ease;
        }

        .med-btn:not(:disabled):hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 14px rgba(0,0,0,0.15);
        }

        .med-btn:not(:disabled):active {
            transform: translateY(0);
        }

        /* ============================================================
           Loading
        ============================================================ */
        .loading-spinner {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 3rem;
            grid-column: 1 / -1;
            color: var(--primary);
        }

        .loading-spinner .spinner {
            width: 42px;
            height: 42px;
            border: 4px solid #e0e6ed;
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin-bottom: 1rem;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* ============================================================
           Portal Admin: tabs y tabla de pedidos
        ============================================================ */
        .admin-tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.8rem;
            border-bottom: 2px solid #eee;
            flex-wrap: wrap;
        }

        .admin-tab-btn {
            background: none;
            border: none;
            padding: 0.8rem 1.4rem;
            font-weight: 600;
            font-size: 1rem;
            color: #888;
            cursor: pointer;
            border-bottom: 3px solid transparent;
            transition: all 0.25s ease;
        }

        .admin-tab-btn:hover {
            color: var(--primary);
        }

        .admin-tab-btn.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }

        .admin-tab-content {
            display: none;
        }

        .admin-tab-content.active {
            display: block;
        }

        .admin-delete-btn {
            background-color: var(--accent);
            color: white;
            border: none;
            padding: 0.5rem 0.9rem;
            border-radius: 5px;
            cursor: pointer;
            font-weight: 600;
            margin-left: 0.4rem;
        }

        .admin-delete-btn:hover {
            background-color: #e14d4d;
        }

        .estado-select {
            padding: 0.4rem 0.8rem;
            border-radius: 50px;
            border: none;
            font-weight: 600;
            color: white;
            cursor: pointer;
        }

        .estado-Pendiente { background-color: #f0ad4e; }
        .estado-Confirmado { background-color: #17a2b8; }
        .estado-Preparando { background-color: #8200ff; }
        .estado-Enviado { background-color: #2a7fba; }
        .estado-Entregado { background-color: #4CAF50; }
        .estado-Cancelado { background-color: #e5484d; }

        .pedido-productos-list {
            font-size: 0.85rem;
            color: #555;
            max-width: 260px;
        }

        .admin-empty {
            text-align: center;
            padding: 2rem;
            color: #999;
        }

        /* ============================================================
           Modal: datos del cliente
        ============================================================ */
        .modal-form-group {
            margin-bottom: 1rem;
            text-align: left;
        }

        .modal-form-group label {
            display: block;
            font-weight: 600;
            margin-bottom: 0.3rem;
            font-size: 0.9rem;
        }

        .modal-form-group input,
        .modal-form-group textarea {
            width: 100%;
            padding: 0.6rem 0.8rem;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 0.95rem;
            font-family: inherit;
        }

        @keyframes fadeInOut {
            0% { opacity: 0; transform: translateY(20px); }
            20% { opacity: 1; transform: translateY(0); }
            80% { opacity: 1; transform: translateY(0); }
            100% { opacity: 0; transform: translateY(20px); }
        }

        /* ============================================================
           Toasts
        ============================================================ */
        #toastContainer {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 5000;
            display: flex;
            flex-direction: column;
            gap: 0.7rem;
            max-width: 340px;
        }

        .toast {
            background: var(--bg-surface);
            color: var(--text-main);
            border-left: 5px solid var(--primary);
            border-radius: 10px;
            padding: 0.9rem 1.1rem;
            box-shadow: var(--shadow-lg);
            display: flex;
            align-items: flex-start;
            gap: 0.7rem;
            font-size: 0.92rem;
            animation: toastIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .toast.hide {
            animation: toastOut 0.3s ease forwards;
        }

        .toast i { margin-top: 2px; }
        .toast-success { border-left-color: var(--stock-ok); }
        .toast-error { border-left-color: var(--stock-out); }
        .toast-warning { border-left-color: var(--stock-low); }
        .toast-info { border-left-color: var(--primary); }

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

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

        /* ============================================================
           Skeleton loading
        ============================================================ */
        .skeleton-card {
            background: var(--bg-surface);
            border-radius: var(--radius-md);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
        }

        .skeleton-block {
            background: linear-gradient(90deg, #e6e9ee 25%, #f2f4f7 37%, #e6e9ee 63%);
            background-size: 400% 100%;
            animation: skeletonShine 1.4s ease infinite;
        }

        @keyframes skeletonShine {
            0% { background-position: 100% 0; }
            100% { background-position: 0 0; }
        }

        .skeleton-img { height: 160px; }
        .skeleton-line { height: 14px; margin: 12px; border-radius: 6px; }
        .skeleton-line.short { width: 40%; }

        /* ============================================================
           Tooltips simples
        ============================================================ */
        [data-tooltip] {
            position: relative;
        }

        [data-tooltip]:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 125%;
            left: 50%;
            transform: translateX(-50%);
            background: #1f2833;
            color: white;
            padding: 5px 10px;
            border-radius: 6px;
            font-size: 0.75rem;
            white-space: nowrap;
            z-index: 100;
            box-shadow: var(--shadow-sm);
        }

        /* ============================================================
           Badges de stock y vencimiento
        ============================================================ */
        .stock-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 0.78rem;
            font-weight: 700;
            padding: 3px 10px;
            border-radius: 50px;
            margin-left: 6px;
        }

        .stock-badge.ok { background: rgba(46,170,95,0.12); color: var(--stock-ok); }
        .stock-badge.low { background: rgba(240,168,58,0.15); color: var(--stock-low); }
        .stock-badge.out { background: rgba(229,72,77,0.15); color: var(--stock-out); }

        .vencimiento-badge {
            display: inline-block;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--stock-low);
            margin-top: 4px;
        }

        /* ============================================================
           Panel Admin — encabezado y tabs modernos
        ============================================================ */
        .admin-header-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 1.2rem;
        }

        .admin-tabs {
            gap: 0.3rem;
        }

        .admin-tab-btn {
            border-radius: 50px 50px 0 0;
        }

        /* ============================================================
           Dashboard
        ============================================================ */
        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.2rem;
            margin-bottom: 2rem;
        }

        .dashboard-card {
            background: var(--bg-surface);
            border-radius: var(--radius-lg);
            padding: 1.4rem;
            box-shadow: var(--shadow-sm);
            transition: transform var(--transition-fast), box-shadow var(--transition-fast);
            border-top: 4px solid var(--primary);
        }

        .dashboard-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--shadow-md);
        }

        .dashboard-card.warn { border-top-color: var(--stock-low); }
        .dashboard-card.danger { border-top-color: var(--stock-out); }
        .dashboard-card.success { border-top-color: var(--stock-ok); }

        .dashboard-card .dc-label {
            font-size: 0.82rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .dashboard-card .dc-value {
            font-size: 2rem;
            font-weight: 800;
            color: var(--text-main);
            margin-top: 0.3rem;
        }

        .dashboard-charts {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .chart-card {
            background: var(--bg-surface);
            border-radius: var(--radius-lg);
            padding: 1.4rem;
            box-shadow: var(--shadow-sm);
        }

        .chart-card h4 {
            margin-bottom: 1rem;
            color: var(--text-main);
        }

        .chart-card canvas {
            max-height: 260px;
        }

        .actividad-list {
            list-style: none;
        }

        .actividad-list li {
            padding: 0.7rem 0;
            border-bottom: 1px solid var(--border-soft);
            font-size: 0.9rem;
            display: flex;
            justify-content: space-between;
            gap: 1rem;
        }

        .actividad-list li:last-child { border-bottom: none; }

        /* ============================================================
           Reportes / exportar
        ============================================================ */
        .reportes-bar {
            display: flex;
            gap: 0.6rem;
            flex-wrap: wrap;
            margin-bottom: 1.5rem;
        }

        .export-btn {
            background: var(--bg-surface-alt);
            border: 1px solid var(--border-soft);
            color: var(--text-main);
            padding: 0.55rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all var(--transition-fast);
        }

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

        /* ============================================================
           Whatsapp acciones de pedido
        ============================================================ */
        .pedido-acciones {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }

        .pedido-accion-btn {
            border: none;
            border-radius: 6px;
            padding: 5px 8px;
            font-size: 0.78rem;
            cursor: pointer;
            color: white;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .pedido-accion-btn.wa { background: var(--whatsapp); }
        .pedido-accion-btn.pdf { background: #e5484d; }
        .pedido-accion-btn.print { background: #555f6b; }

        .pedido-descuento-cell {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .pedido-descuento-input {
            width: 60px;
            padding: 5px 6px;
            border: 1px solid var(--border-soft);
            border-radius: 6px;
            font-size: 0.85rem;
        }

        /* ============================================================
           Clientes
        ============================================================ */
        .clientes-toolbar {
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 1.2rem;
        }

        /* ============================================================
           Confirmación modal genérica
        ============================================================ */
        .confirm-modal-content {
            max-width: 380px;
            text-align: center;
        }

        .confirm-modal-content i.warn-icon {
            font-size: 2.6rem;
            color: var(--accent);
            margin-bottom: 0.8rem;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .menu {
                flex-direction: column;
                align-items: center;
            }
            
            .menu li {
                width: 100%;
                text-align: center;
            }
            
            .hero {
                height: 300px;
            }
            
            .hero h1 {
                font-size: 2rem;
            }
            
            #cartSidebar {
                width: 100%;
                right: -100%;
            }
            
            #cartSidebar.show {
                right: 0;
            }

            .toolbar-filtros {
                flex-direction: column;
                align-items: stretch;
            }

            .filter-select {
                width: 100%;
            }

            .admin-table {
                display: block;
                overflow-x: auto;
                white-space: nowrap;
            }

            .admin-tabs {
                justify-content: center;
            }

            .medicamentos-grid {
                grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
                gap: 1rem;
            }

            .med-img {
                height: 140px;
            }
        }

        @media (max-width: 480px) {
            .hero h1 {
                font-size: 1.6rem;
            }

            .hero p {
                font-size: 1rem;
            }

            .medicamentos-grid {
                grid-template-columns: 1fr 1fr;
            }

            .dashboard-grid {
                grid-template-columns: 1fr 1fr;
            }

            .admin-header-bar {
                flex-direction: column;
                align-items: stretch;
            }
        }

/* ============================================================
   Footer
============================================================ */
footer {
    background: var(--dark);
    color: #e8e8e8;
    margin-top: 3rem;
    padding-top: 2.5rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.footer-column {
    flex: 1 1 220px;
    min-width: 200px;
}

.footer-column h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-column p {
    color: #c7c7c7;
    line-height: 1.6;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 0.6rem;
    color: #c7c7c7;
}

.footer-column ul li a {
    color: #c7c7c7;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-column ul li a:hover {
    color: var(--primary);
}

.copyright {
    text-align: center;
    padding: 1.2rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #a3a3a3;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================================
   Sección Contacto
============================================================ */
.contact-container {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
    align-items: start;
}

.contact-info {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
}

.contact-info h3 {
    color: var(--primary);
    margin-bottom: 1.4rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 1.2rem;
}

.contact-item i {
    color: var(--primary);
    font-size: 1.1rem;
    margin-top: 0.2rem;
    width: 20px;
    text-align: center;
}

.map-container {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.map-address {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.5;
}

.map-address i {
    color: var(--primary);
}

/* Tarjeta de dirección independiente (sin mapa embebido) */
.map-address-standalone {
    flex-direction: column;
    gap: 1rem;
    padding: 2rem 1.5rem;
    margin-top: 0;
}

.map-address-standalone i {
    font-size: 2.4rem;
    color: var(--primary);
}

.map-address-standalone strong {
    display: block;
    color: var(--primary);
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.map-address-standalone span {
    color: var(--text-main);
    font-weight: 500;
    max-width: 320px;
    display: inline-block;
}

@media (max-width: 900px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
}
