/* ====================================
   CSS Variables & Reset
   ==================================== */
:root {
    /* Colors - Modern & Premium */
    --primary-color: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --secondary-color: #EC4899;
    --accent-color: #F59E0B;
    
    /* Neutrals */
    --text-dark: #1F2937;
    --text-medium: #6B7280;
    --text-light: #9CA3AF;
    --bg-white: #FFFFFF;
    --bg-light: #F9FAFB;
    --bg-gray: #F3F4F6;
    --border-color: #E5E7EB;
    
    /* Success/Error */
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-base: 16px;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --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);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    color: var(--text-dark);
    background-color: var(--bg-gray);
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-color);
}

/* ====================================
   Layout
   ==================================== */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* ====================================
   Header
   ==================================== */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    gap: var(--spacing-lg);
}

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-white);
}

.logo h1 {
    display: none;
}

.logo a {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo .logo-mark {
    display: none;
}

.search-bar {
    flex: 1;
    max-width: 700px;
    margin: 0 var(--spacing-xl);
}

.search-bar form {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 4px;
    transition: all var(--transition-fast);
}

.search-bar form:focus-within {
    background: white;
    border-color: var(--border-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 20px;
    font-size: 0.95rem;
    color: var(--text-dark);
    width: 100%;
}

.search-bar input:focus {
    outline: none;
    box-shadow: none;
}

.search-bar input::placeholder {
    color: var(--text-light);
}

.search-bar button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-bar button:hover {
    background: var(--primary-dark);
}

.search-bar button svg {
    width: 20px;
    height: 20px;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.mobile-profile {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--success-color);
    color: white;
    overflow: hidden; /* Ensure content is clipped to rounded corners */
}

.icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.icon-link:hover {
    background: var(--bg-light);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.mobile-profile .nav-user-avatar {
    width: 100%;
    height: 100%;
    border: none;
}

.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.main-nav {
    display: flex;
    gap: var(--spacing-lg);
    padding: var(--spacing-xs) 0;
    border-top: 1px solid var(--border-color);
}

.main-nav a {
    font-weight: var(--font-weight-medium);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.main-nav a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

/* ====================================
   Footer
   ==================================== */
.footer {
    background: var(--text-dark);
    color: white;
    margin-top: var(--spacing-2xl);
    padding: var(--spacing-2xl) 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    align-items: flex-start;
}

.footer-column h3 {
    margin-bottom: var(--spacing-md);
    font-size: 1.125rem;
}

.footer-column p {
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
    max-width: 420px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: var(--spacing-sm);
}

.footer-column ul li a {
    color: var(--text-light);
}

.footer-column ul li a:hover {
    color: white;
}

.newsletter-form {
    display: flex;
    gap: var(--spacing-sm);
}

.newsletter-form input {
    flex: 1;
    padding: var(--spacing-sm);
    border: none;
    border-radius: var(--radius-md);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.footer-brand .footer-logo {
    font-size: 1.4rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-sm);
    color: white;
}

.footer-links ul li a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-links ul li a::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: white;
}

.footer-contact .contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

@media (min-width: 1024px) {
    .footer-content {
        grid-template-columns: 2fr 1.2fr 1.4fr;
        column-gap: var(--spacing-2xl);
    }

    .footer-column {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .footer-links ul,
    .footer-contact .contact-list {
        margin-top: 0;
    }
}

.footer-contact .contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-light);
}

.footer-contact .contact-item a {
    color: var(--text-light);
}

.footer-contact .contact-item a:hover {
    color: white;
}

.footer-contact .contact-icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--secondary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    background: rgba(148, 163, 184, 0.08);
}

.footer-social {
    display: flex;
    gap: 1.25rem;
    margin-top: var(--spacing-md);
}

.footer-social .social-link {
    width: 50px;
    height: 50px;
    border-radius: 999px;
    border: 2px solid var(--secondary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    background: rgba(15, 23, 42, 0.85);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-social .social-link i {
    font-size: 24px;
}

.footer-social .social-link:hover {
    border-color: var(--primary-color);
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.footer-social .social-link-facebook {
    border-color: #1877F2;
    background: #1877F2;
    color: #ffffff;
}

.footer-social .social-link-facebook:hover {
    border-color: #1459b8;
    background: #1459b8;
    color: #ffffff;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(24, 119, 242, 0.3);
}

.footer-social .social-link-whatsapp {
    border-color: #25D366;
    background: #25D366;
    color: #ffffff;
}

.footer-social .social-link-whatsapp:hover {
    border-color: #1da851;
    background: #1da851;
    color: #ffffff;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(37, 211, 102, 0.3);
}

.footer-social .social-link-instagram {
    border-color: #d6249f;
    background: radial-gradient(circle at 30% 30%, #fdf497 0, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    color: #ffffff;
}

.footer-social .social-link-instagram:hover {
    border-color: #c0178c;
    background: radial-gradient(circle at 30% 30%, #fdf497 0, #fdf497 5%, #fd5949 40%, #d6249f 65%, #285AEB 95%);
    color: #ffffff;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(214, 36, 159, 0.3);
}

/* ====================================
   Messages
   ==================================== */
.messages-container {
    position: fixed;
    top: 80px;
    right: var(--spacing-lg);
    z-index: 1000;
    max-width: 400px;
}

.alert {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: var(--success-color);
    color: white;
}

.alert-error {
    background: var(--error-color);
    color: white;
}

.alert-warning {
    background: var(--warning-color);
    color: white;
}

.alert-info {
    background: var(--primary-color);
    color: white;
}

/* ====================================
   Mobile Bottom Navigation
   ==================================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding: 8px 0;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-medium);
    font-size: 0.75rem;
    gap: 4px;
}

.bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.bottom-nav .icon-wrapper {
    position: relative;
}

.bottom-nav .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #2563EB;
    color: white;
    font-size: 0.65rem;
    min-width: 16px;
    height: 16px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 60px;
    }

    .bottom-nav {
        display: flex;
    }

    .header-content {
        flex-wrap: wrap;
        padding-top: 0.5rem;
        padding-bottom: 0;
        gap: 0;
    }
    
    .mobile-menu-toggle {
        display: inline-flex;
        order: 0;
    }

    .logo {
        order: 1;
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .mobile-profile {
        display: inline-flex;
        order: 2;
    }

    .search-bar {
        order: 3;
        flex-basis: 100%;
        max-width: none;
        position: relative;
        margin-top: 0.5rem;
        margin-left: calc(var(--spacing-lg) * -1);
        margin-right: calc(var(--spacing-lg) * -1);
        width: calc(100% + (var(--spacing-lg) * 2));
        padding: 0.5rem var(--spacing-lg);
        background-color: #E0F2FE;
    }
    
    .search-bar form {
        position: relative;
        width: 100%;
        border: none;
        background: transparent;
        padding: 0;
        box-shadow: none;
    }

    .search-bar form:focus-within {
        background: transparent;
        border: none;
        box-shadow: none;
    }

    .search-bar input {
        width: 100%;
        height: 48px;
        padding: 0 55px 0 24px;
        border: 1px solid #E5E7EB;
        border-radius: var(--radius-full);
        background: var(--bg-white);
        font-size: 1rem;
        color: var(--text-dark);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    }

    .search-bar input::placeholder {
        color: #9CA3AF;
    }

    .search-bar input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        outline: none;
    }

    .search-bar button {
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--primary-color);
        border: none;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
    }

    .header-icons {
        display: none;
    }

    .main-nav {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        box-shadow: var(--shadow-lg);
        padding: var(--spacing-lg);
        flex-direction: column;
        gap: var(--spacing-md);
        z-index: 1000;
    }
    
    .header.nav-open .main-nav {
        display: flex;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}
