@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Brand Colors */
    --brand-primary: #FF6B6B;
    --brand-secondary: #FF8E53;
    --brand-gradient: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    --brand-dark: #D43F3F;
    
    /* UI Colors */
    --bg-body: #F8F9FA;
    --surface: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.85);
    
    /* Text Colors */
    --text-main: #1A1A1A;
    --text-muted: #6C757D;
    --text-light: #FFFFFF;
    
    /* Functional */
    --success: #2ECC71;
    --warning: #F1C40F;
    --danger: #E74C3C;
    --border: #F0F0F0;
    
    /* Effects */
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.02);
    --shadow-md: 0 10px 15px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px rgba(0,0,0,0.08);
    --shadow-brand: 0 10px 20px rgba(255, 107, 107, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
    /* Subtle background pattern */
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 107, 107, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 142, 83, 0.03) 0%, transparent 20%);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

/* --- Auth Wizard Styles --- */
.auth-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 60px;
    height: 60px;
    background: var(--brand-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-brand);
}

.auth-step-container {
    position: relative;
    min-height: 200px; /* Adjust based on content */
}

.auth-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-step.active {
    position: relative;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.auth-step.prev {
    transform: translateX(-20px);
    opacity: 0;
}

/* Modern Floating Input */
.input-group-float {
    position: relative;
    margin-bottom: 20px;
}

.input-float {
    width: 100%;
    padding: 16px 16px 16px 50px; /* Space for icon */
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.input-float:focus {
    background: white;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
    outline: none;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.input-float:focus + .input-icon {
    color: var(--brand-primary);
}

.auth-btn-large {
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    border-radius: 16px;
    background: var(--brand-gradient);
    color: white;
    border: none;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-brand);
    position: relative;
    overflow: hidden;
}

.auth-btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(255, 107, 107, 0.3);
}

.auth-btn-large:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.user-welcome-badge {
    background: #f1f3f5;
    padding: 12px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.user-avatar-small {
    width: 40px;
    height: 40px;
    background: var(--brand-dark);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}
.mt-6 {
    margin-top: 4rem !important;
}

/* --- Desktop Product Gallery --- */
.desktop-gallery-main {
    position: relative;
    width: 100%;
    height: 500px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 1rem;
}
.desktop-gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.desktop-gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}
.desktop-gallery-thumb {
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
    border: 1px solid #f0f0f0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    opacity: 0.6;
}
.desktop-gallery-thumb.active, .desktop-gallery-thumb:hover {
    opacity: 1;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.1);
}
.desktop-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.desktop-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}
.desktop-gallery-nav:hover {
    background: var(--brand-primary);
    color: white;
}
.desktop-gallery-nav.prev { left: 10px; }
.desktop-gallery-nav.next { right: 10px; }

/* --- Layout --- */

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

.site-main {
    min-height: 80vh;
    padding-bottom: 60px;
}

.section {
    padding: 20px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.5rem;
}

/* --- Components: Header --- */

.site-header {
    position: sticky;
    top: 16px;
    z-index: 100;
    margin: 0 16px;
    border-radius: var(--radius-full);
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255,255,255,0.5);
    transition: var(--transition);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    height: 70px;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav a {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-gradient);
    transition: var(--transition);
    border-radius: 2px;
}

.nav a:not(.btn):hover::after {
    width: 100%;
}

.cart-icon {
    position: relative;
    font-size: 1.25rem;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--brand-gradient);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 99px;
    border: 2px solid white;
}

/* --- Components: Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(255, 107, 107, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.btn-ghost {
    background: rgba(255, 107, 107, 0.1);
    color: var(--brand-dark);
}

.btn-ghost:hover {
    background: rgba(255, 107, 107, 0.15);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border);
    color: var(--text-main);
    transition: var(--transition);
    cursor: pointer;
}

.btn-icon:hover {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    transform: scale(1.1);
}

.btn-pulse {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    animation: pulse-orange 2s infinite;
    font-size: 1.1rem;
    padding: 16px 32px;
    width: 100%;
}

@keyframes pulse-orange {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* --- Components: Product Card --- */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.product-carousel {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 24px; /* Space for shadows */
    padding-left: 4px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.product-carousel::-webkit-scrollbar {
    display: none;
}

.product-carousel .product-card {
    min-width: 220px;
    max-width: 220px;
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.product-carousel .product-image-wrapper {
    height: 220px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    border: 1px solid transparent;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 107, 107, 0.1);
}

.product-image-wrapper {
    position: relative;
    aspect-ratio: 1;
    background: #f1f3f5;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--warning);
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    z-index: 2;
}

.product-actions-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.product-card:hover .product-actions-overlay {
    opacity: 1;
    transform: translateY(0);
}

.product-details {
    padding: 16px;
}

.product-category {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 4px;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.product-price {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

/* --- Components: Hero --- */

.hero-section {
    margin-top: 24px;
    margin-bottom: 40px;
}

/* --- Components: Carousels --- */
.category-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: none; /* Firefox */
}
.category-carousel::-webkit-scrollbar {
    display: none;
}

.category-pill {
    flex: 0 0 auto;
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: var(--transition);
}

.category-pill:hover, .category-pill.active {
    background: var(--brand-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand);
}

/* --- Components: Cart --- */

.cart-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
}

.cart-items-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #f1f3f5;
}

.cart-info {
    flex: 1;
}

.cart-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-variant {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cart-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.qty-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f1f3f5;
    padding: 4px;
    border-radius: var(--radius-full);
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: white;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.qty-btn:hover {
    transform: scale(1.1);
}

.qty-value {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.remove-btn {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.remove-btn:hover {
    color: var(--danger);
    text-decoration: underline;
}

.cart-summary {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.summary-total {
    border-top: 2px dashed var(--border);
    margin-top: 16px;
    padding-top: 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    justify-content: space-between;
}

/* --- Panel Styles (Preserved) --- */
.panel-sidebar {
    width: 260px;
    min-height: 100vh;
    position: sticky;
    top: 0;
}
.panel-link {
    color: #1b1b1b;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.panel-link:hover {
    background: #f4efe6;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .cart-grid {
        grid-template-columns: 1fr;
    }
    
    .header-inner {
        padding: 12px 16px;
    }
    
    .nav {
        gap: 16px;
    }
    
    /* REMOVED: Site header override that was hiding/breaking the sticky header on mobile
    .site-header {
        top: 0;
        margin: 0;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border);
    }
    */
    
    /* Ensure sticky header works on mobile too but simpler */
    .site-header {
        margin: 0;
        border-radius: 0;
        top: 0;
        border: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
}

/* --- Product Detail Pro Layout --- */

.product-detail-layout {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 60px;
    align-items: start;
    padding-top: 20px;
}

.product-gallery-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.product-gallery-item {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.product-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.product-info-sticky {
    position: sticky;
    top: 110px; /* Below header */
    padding: 20px;
    /* Clean look, no background box if possible, or minimal */
}

.pro-price-tag {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.pro-old-price {
    font-size: 1.25rem;
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.7;
}

.product-info-sticky .btn-primary {
    padding: 16px 32px;
    font-size: 1.1rem;
    width: 100%;
    border-radius: var(--radius-full);
}

@media (max-width: 991px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .product-info-sticky {
        position: static;
        padding: 0;
    }
}

/* --- Hero Product Mobile --- */
.hero-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    width: 100%;
}

.hero-slider::-webkit-scrollbar {
    display: none;
}

.hero-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    position: relative;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slider-dots {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
    pointer-events: none;
}

.hero-slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transition: all 0.3s ease;
}

.hero-slider-dot.active {
    background: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 4px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .product-hero-mobile {
        position: relative;
        overflow: hidden;
        border-bottom-left-radius: 24px;
        border-bottom-right-radius: 24px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        margin-bottom: 24px;
        background: #fff;
    }
    
    .product-hero-image-container {
        height: 60vh; /* Reduced height to show buttons below */
        max-height: 400px;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8f9fa;
        overflow: hidden;
    }
    
    .product-hero-image {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Cover for immersive hero feel */
    }
    
    /* Overlay Icons */
    .hero-overlay-nav {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 16px;
        display: flex;
        justify-content: space-between;
        z-index: 10;
        pointer-events: none;
    }
    
    .hero-btn-glass {
        pointer-events: auto;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255,255,255,0.9);
        backdrop-filter: blur(4px);
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        color: #1a1a1a;
        font-size: 1.2rem;
        text-decoration: none;
    }

    .product-main-info {
        padding: 0 16px;
    }
    
    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* --- Checkout Components --- */
.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 8px;
}

.payment-option-input {
    display: none;
}

.payment-option-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 5px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    background: white;
    height: 100%;
}

.payment-option-input:checked + .payment-option-card {
    border-color: var(--brand-primary);
    background: rgba(255, 107, 107, 0.05);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

.payment-icon {
    font-size: 1.5rem;
    margin-bottom: 0px;
    color: var(--text-muted);
}

.payment-option-input:checked + .payment-option-card .payment-icon {
    color: var(--brand-primary);
}

.payment-label {
    font-weight: 600;
    font-size: 0.95rem;
}
