:root {
    /* Premium Palette */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --background: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --text-main: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;

    /* Elegant Accents */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    --gradient-hover: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);

    /* Refined Shadows & Radius */
    --radius: 1rem;
    --radius-sm: 0.5rem;
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.01);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--surface-alt);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Glassmorphism Header */
header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1.25rem 0;
    transition: all 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
    text-decoration: none;
}

.nav-icons button {
    color: var(--text-main);
    transition: transform 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-icons button:hover {
    transform: scale(1.1);
    color: var(--primary);
}

.cart-btn {
    position: relative;
    padding: 0.5rem;
}

.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Minimalist Hero */
.hero {
    padding: 6rem 0 4rem;
    background-color: var(--surface-alt);
    text-align: left;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    max-width: 800px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 500px;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Search Bar */
.search-container {
    position: relative;
    max-width: 600px;
    margin: -3rem auto 3rem 0;
    /* Lifted up slightly */
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    /* Pill shape */
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-main);
    background-color: white;
    box-shadow: var(--shadow-subtle);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.search-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    font-size: 1.1rem;
}

/* Category Filters */
.categories-section {
    margin-top: 3rem;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2rem;
    text-align: left;
    position: relative;
    padding-left: 1rem;
    border-left: 4px solid var(--primary);
}

.categories-grid {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.categories-grid::-webkit-scrollbar {
    display: none;
}

.category-tag {
    background-color: white;
    padding: 0.75rem 1.75rem;
    border-radius: 2rem;
    font-weight: 600;
    color: var(--text-light);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-tag i {
    font-size: 1rem;
    opacity: 0.7;
}

.category-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-subtle);
}

.category-tag.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.category-tag.active i {
    opacity: 1;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    margin-bottom: 6rem;
}

.product-card {
    background-color: white;
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    padding: 1rem;
    box-shadow: var(--shadow-subtle);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

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

/* Disable hover on touch devices */
@media (hover: none) {
    .product-card:hover {
        transform: none !important;
        box-shadow: var(--shadow-subtle) !important;
        border-color: var(--border) !important;
    }

    .product-card:hover .product-image {
        transform: none !important;
    }
}

.product-image-container {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
    aspect-ratio: 1;
    background-color: #f1f5f9;
    box-shadow: var(--shadow-card);
}

.product-image-nav {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 2;
    padding: 0 10px;
}

.image-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.image-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.image-dot.active {
    background-color: var(--primary);
    width: 20px;
    border-radius: 4px;
}

.image-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.product-card:hover .image-arrow {
    opacity: 1;
}

.image-arrow:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.image-arrow-prev {
    left: 10px;
}

.image-arrow-next {
    right: 10px;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-info {
    padding: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.product-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.product-size-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 0 3px transparent;
}

.product-size-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.product-size-select option {
    padding: 0.5rem;
}

.btn-add {
    width: 100%;
    padding: 0.875rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    margin-top: auto;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(37, 99, 235, 0.3);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 450px;
    height: 100%;
    background-color: white;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

/* .cart-open handled specifically for #cartSidebar and #checkoutSidebar below */

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(2px);
}

.cart-open .cart-overlay {
    opacity: 1;
    visibility: visible;
}

.cart-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.close-cart {
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-light);
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}


.close-cart:hover {
    color: var(--danger);
}

.icon-btn {
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-light);
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--primary);
    background-color: var(--surface-alt);
    border-radius: 50%;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    animation: fadeIn 0.3s ease;
}

.cart-item-img {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    box-shadow: var(--shadow-subtle);
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.3;
}

.cart-item-price {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Empty Cart Styles - Refined */
.empty-cart {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    gap: 1rem;
}

.empty-cart svg {
    width: 3rem;
    /* w-12 */
    height: 3rem;
    /* h-12 */
    color: black;
}

.empty-cart p {
    color: black;
    font-weight: 700;
    font-size: 1rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: #eff6ff;
}

.cart-footer {
    padding: 2rem;
    background-color: white;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-checkout {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 700;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.btn-checkout:disabled {
    background: #e2e8f0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-checkout:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    background-color: var(--secondary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

@media (min-width: 768px) {
    .toast {
        left: auto;
        right: 2rem;
        transform: translateY(200%);
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* Footer */
.site-footer {
    background-color: white;
    padding: 4rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-light);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-light);
    font-size: 1.25rem;
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {

    /* Container adjustments */
    .container {
        padding: 0 1rem;
    }

    /* Disable hover effects on mobile to prevent layout shift */
    .product-card:hover {
        transform: none;
        box-shadow: var(--shadow-subtle);
    }

    .product-card:hover .product-image {
        transform: none;
    }

    /* Products Grid - 2 columns with optimized spacing */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 3rem;
    }

    /* Product Cards - Optimized for mobile */
    .product-card {
        padding: 0.65rem;
        border-radius: 0.75rem;
    }

    .product-image-container {
        margin-bottom: 0.5rem;
        border-radius: 0.65rem;
    }

    /* Product Info - Reduced spacing */
    .product-info {
        padding: 0.25rem 0 0;
    }

    .product-category {
        font-size: 0.65rem;
        margin-bottom: 0.15rem;
    }

    .product-name {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
        line-height: 1.3;
    }

    .product-price {
        font-size: 1.35rem;
        margin-bottom: 0.65rem;
    }

    /* Size Select - Compact */
    .product-size-select {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
        margin-bottom: 0.65rem;
        border-radius: 0.65rem;
        box-shadow: 0 0 0 3px transparent !important;
    }

    .product-size-select:focus {
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    }

    /* Add Button - Optimized */
    .btn-add {
        padding: 0.7rem;
        font-size: 0.85rem;
        border-radius: 0.65rem;
        gap: 0.35rem;
    }

    .btn-add i {
        font-size: 0.9rem;
    }

    /* Hero Section */
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero {
        min-height: 300px !important;
        padding: 1rem 0 !important;
    }

    .hero .container {
        padding: 0 1rem !important;
    }

    .hero iframe {
        width: 100% !important;
        border-radius: 8px !important;
    }

    /* Categories - Better mobile scrolling */
    .categories-section {
        margin-top: 2rem;
        margin-bottom: 2.5rem;
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .categories-grid {
        gap: 0.65rem;
        padding-bottom: 0.75rem;
    }

    .category-tag {
        padding: 0.6rem 1.25rem;
        font-size: 0.85rem;
    }

    /* Header adjustments */
    header {
        padding: 1rem 0;
    }

    .logo {
        font-size: 1.5rem;
    }

    /* Cart Sidebar - Full width on mobile */
    .cart-sidebar {
        max-width: 100%;
    }
}

/* Checkout Body */
.checkout-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: white;
}

.checkout-alert {
    background-color: #eff6ff;
    border: 1px solid #dbeafe;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 0.35rem;
    margin-left: 0.25rem;
    text-transform: uppercase;
}

.form-group input,
.checkout-textarea {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-group input::placeholder,
.checkout-textarea::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.form-group input:focus,
.checkout-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px #dbeafe;
}

.checkout-textarea {
    min-height: 100px;
    resize: none;
}

.form-hint {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 0.35rem;
    margin-left: 0.25rem;
}

.form-row {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.divider-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 900;
    font-size: 0.85rem;
    color: #0f172a;
    padding-top: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.divider-title i {
    font-size: 1rem;
}

/* Checkout Footer */
.checkout-footer {
    padding: 1.25rem;
    border-top: 1px solid #e2e8f0;
    background-color: white;
    display: flex;
    flex-direction: column;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.summary-col {
    display: flex;
    flex-direction: column;
}

.summary-col.right {
    text-align: right;
    align-items: flex-end;
}

.summary-label {
    color: #64748b;
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #2563eb;
    line-height: 1;
}

.summary-value-sm {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.btn-payment-large {
    width: 100%;
    height: 3.5rem;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 1rem;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px #dbeafe, 0 4px 6px -4px #dbeafe;
}

.btn-payment-large:hover {
    transform: scale(0.98);
}

.btn-payment-large:active {
    transform: scale(0.95);
}

.trust-badge {
    text-align: center;
    font-size: 0.6rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 1rem;
}

/* Sidebar Logic - Restored */
.cart-open #cartSidebar {
    transform: translateX(0);
}

.checkout-open #checkoutSidebar {
    transform: translateX(0);
    z-index: 110;
}

.checkout-open .cart-overlay {
    opacity: 1;
    visibility: visible;
    z-index: 105;
}

/* Ensure body scroll locking */
.cart-open,
.checkout-open {
    overflow: hidden;
}

/* Mobile Scroll Fixes */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        max-width: 100vw;
    }

    .checkout-body {
        padding: 1.25rem;
        padding-bottom: 4rem;
        /* Extra space for keyboard */
    }

    .form-row {
        gap: 0.75rem;
        /* Keep row consistency if inputs are small, or enable wrapping if needed */
        /* flex-direction: column; if really narrow */
    }
}