/* ==========================================================================
   EnfermerArt - Design System & Main Styles
   ========================================================================== */

/* --- 1. Variables & Design Tokens --- */
:root {
    /* Colors - Estilo Pastel (Enfermera en Apuros Inspired) */
    --color-primary: #F8C8D1; /* Rosa Pastel */
    --color-primary-dark: #F2A3B3; /* Rosa más intenso para hovers */
    --color-primary-light: #FFF0F3; /* Fondo rosa pálido */

    --color-secondary: #A4B8DF; /* Azul Cielo Suave */
    --color-secondary-dark: #86A0CE; /* Azul más profundo */
    --color-secondary-light: #EBF1FF; /* Fondo azul pálido */

    --color-mint: #B2DFDB; /* Verde Menta (Recomendación Cali) */
    --color-accent-lila: #D1C4E9; /* Lila suave */

    /* Typography */
    --font-heading: 'Poppins', 'Outfit', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --font-accent: 'Dancing Script', cursive;

    /* Neutrals */
    --color-text-main: #333333;
    --color-text-light: #666666;
    --color-bg-body: #FFFFFF;
    --color-bg-white: #FFFFFF;
    --color-border: #F5F5F5;

    /* Spacing & Utilities */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.06);
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-full: 100px;
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- 2. Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-main);
    background-color: var(--color-bg-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.promo-bar {
    background-color: var(--color-mint);
    color: var(--color-text-main);
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    /* meaningful for animation to work from 0 */
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

@keyframes pulse-subtle {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(56, 178, 172, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(56, 178, 172, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(56, 178, 172, 0); }
}

.animate-pulse {
    animation: pulse-subtle 2s infinite;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

/* --- 3. Typography Utilities --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-accent-blue);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

.text-accent {
    font-family: var(--font-accent);
    color: var(--color-secondary);
}

.text-primary {
    color: var(--color-primary);
}

.text-center {
    text-align: center;
}

/* --- 4. Layout Utilities --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.section {
    padding: var(--spacing-xl) 0;
}

.grid {
    display: grid;
    gap: var(--spacing-md);
}

.flex {
    display: flex;
    gap: var(--spacing-sm);
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

/* --- 5. Components --- */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-main);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--color-secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-text-main);
}

.btn-outline:hover {
    background-color: var(--color-primary-light);
}

/* Cards */
.card {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-img-container {
    height: 250px; 
    overflow: hidden;
    position: relative;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img-container img {
    transform: scale(1.08); /* Sutil zoom interactivo */
}

/* Cross-Selling Banner */
.cross-sell-banner {
    background: linear-gradient(135deg, var(--color-secondary-light) 0%, #fff 100%);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-md);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}
.cross-sell-banner::before {
    content: "✨";
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 8rem;
    opacity: 0.1;
    transform: rotate(15deg);
}

/* --- 6. Search Overlay --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5rem;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
}

.search-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.search-content {
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close-search {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

#search-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    background: white;
}

.search-results {
    margin-top: 1rem;
}

/* --- 8. Footer Styles --- */
.site-footer {
    background-color: var(--color-text-main);
    /* Dark background */
    color: white;
    padding-top: 4rem;
    padding-bottom: 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo-img {
    height: 80px;
    width: auto;
    margin-bottom: 1.5rem;
    background-color: white;
    /* Ensure logo is visible on dark bg */
    padding: 5px;
    border-radius: var(--radius-md);
}

.footer-brand p {
    color: var(--color-text-light);
    /* Lighter text for description */
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
    max-width: 300px;
}

.footer-links-col h4 {
    color: white;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.footer-links-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-col li {
    margin-bottom: 0.8rem;
}

.footer-links-col a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-links-col a:hover {
    color: var(--color-secondary);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease, transform 0.3s ease;
    color: white;
}

.social-links a:hover {
    background-color: var(--color-secondary);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* --- 7. Enhanced Header & Navigation --- */
.site-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.5rem 0;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-img {
    height: 70px;
    width: auto;
    object-fit: contain;
}

.desktop-nav {
    display: none;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text-main);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--color-text-main);
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--color-primary);
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--color-secondary);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.mobile-nav-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text-main);
    position: relative;
    transition: background-color 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--color-text-main);
    transition: transform 0.3s;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

.mobile-nav-toggle.is-active .hamburger {
    background-color: transparent;
}

.mobile-nav-toggle.is-active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-nav-toggle.is-active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

.mobile-nav {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: white;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 999;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-nav.is-active {
    transform: translateX(0);
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    text-align: center;
    width: 100%;
}

.mobile-nav-list li {
    margin-bottom: 2rem;
}

.mobile-nav-list a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-main);
    display: block;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: block;
    }

    .mobile-nav-toggle {
        display: none;
    }

    .mobile-nav {
        display: none;
    }
}

/* --- 9. Toast Notifications --- */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--color-bg-white);
    color: var(--color-text-main);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 3000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-notification.success {
    border-left: 4px solid var(--color-primary);
}

.toast-notification.error {
    border-left: 4px solid var(--color-secondary);
}



.toast-icon {
    font-size: 1.25rem;
}

/* --- 10. Product Preview Modal --- */
.unit-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--color-text-main);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 2;
    pointer-events: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 4000;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--color-bg-white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 90%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.5rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--color-primary);
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.modal-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .modal-content {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-image {
        height: 250px;
    }
}

/* --- 8. Floating WhatsApp (Nurse Only) --- */
.whatsapp-float-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

.whatsapp-float-container * {
    pointer-events: auto;
}

.whatsapp-badge {
    background: white;
    padding: 10px 18px;
    border-radius: 20px 20px 0 20px;
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 5px;
    border: 3px solid var(--color-primary);
    position: relative;
    white-space: nowrap;
    animation: fadeInOut 4s infinite;
}

.whatsapp-only-nurse {
    width: 130px;
    height: 130px;
    display: block;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.nurse-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 15px rgba(0,0,0,0.2));
    animation: nurseWiggle 4s ease-in-out infinite;
}

.whatsapp-only-nurse:hover {
    transform: scale(1.1) rotate(5deg);
}

@keyframes nurseWiggle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(-3deg); }
    75% { transform: translateY(-3px) rotate(3deg); }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.95; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* --- Responsive Global Overrides --- */
@media (max-width: 992px) {
    h1 { font-size: 2.8rem !important; }
}

@media (max-width: 768px) {
    .container { padding: 0 1.25rem; }
    
    .grid { 
        grid-template-columns: 1fr !important; 
        gap: 2rem !important;
    }
    
    .site-header {
        padding: 0.5rem 0;
    }
    
    .header-inner {
        flex-direction: row !important;
        justify-content: space-between !important;
    }

    .desktop-nav { display: none; }
    .mobile-nav-toggle { display: block; }

    section { padding: 3rem 0; }
    
    h1 { 
        font-size: 2.2rem !important; 
        text-align: center; 
        line-height: 1.2 !important;
    }
    
    .text-center-mobile { text-align: center !important; }
    .justify-center-mobile { justify-content: center !important; }
    
    .flex { 
        flex-direction: column; 
        align-items: center;
        gap: 1rem;
    }
    
    .card { margin-bottom: 1rem; }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 2.5rem;
    }
    
    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .whatsapp-float-container {
        bottom: 20px;
        right: 20px;
    }
    
    .nurse-avatar {
        width: 55px;
        height: 55px;
        top: -35px;
        right: 10px;
    }
    
    .whatsapp-float {
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8rem !important; }
    .logo-img { height: 40px; }
    .btn { width: 100%; text-align: center; }
}