:root {
    --color-bg: #f5f5f7;
    --color-surface: #ffffff;
    --color-primary: #1d1d1f;
    --color-accent: #0071e3;
    --color-accent-hover: #0077ed;
    --color-text: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-border: #d2d2d7;
    --color-success: #34c759;
    --color-error: #ff3b30;
    --color-warning: #ff9500;
    --color-badge-bg: #f0f0f5;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    --transition: 0.2s ease;
    --sidebar-width: 260px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.5;
}

/* ─── Header ─── */
#site-header {
    background: var(--color-primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    cursor: pointer;
    user-select: none;
}

.logo:hover {
    opacity: 0.85;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.nav-link.active, .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-btn {
    position: relative;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.cart-btn:hover {
    background: rgba(255,255,255,0.1);
}

.cart-icon {
    width: 22px;
    height: 22px;
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    transition: var(--transition);
}

.cart-count.empty {
    display: none;
}

/* ─── Layout ─── */
.layout {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    align-self: flex-start;
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: var(--color-text-secondary);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2.25rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
    background: var(--color-bg);
}

.search-box input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}

.filter-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 0.35rem;
    margin-top: 0.85rem;
}

.sidebar select {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--color-bg);
    color: var(--color-text);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 2rem;
}

.sidebar select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}

.price-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-range input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--color-bg);
    outline: none;
    transition: var(--transition);
}

.price-range input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}

.price-sep {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.clear-btn {
    margin-top: 1rem;
    width: 100%;
    padding: 0.5rem;
    background: none;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.clear-btn:hover {
    border-color: var(--color-text-secondary);
    color: var(--color-text);
}

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    min-width: 0;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-filter-btn:hover {
    border-color: var(--color-accent);
}

.results-info {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* ─── Product Grid ─── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.product-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

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

.card-image {
    height: 160px;
    background: linear-gradient(135deg, #e8e8ed, #d2d2d7);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image .placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

.card-body {
    padding: 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.card-brand {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
}

.card-model {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.4rem;
}

.badge {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    background: var(--color-badge-bg);
    color: var(--color-text-secondary);
    text-transform: capitalize;
}

.badge.gender {
    background: #e8f0fe;
    color: #1a73e8;
}

.card-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    margin-top: 0.3rem;
}

/* ─── Loading ─── */
.loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--color-text-secondary);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 0.75rem;
}

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

/* ─── Error / Empty States ─── */
.error-state, .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-secondary);
}

.error-state p {
    color: var(--color-error);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
}

.retry-btn {
    padding: 0.5rem 1.25rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.retry-btn:hover {
    background: var(--color-accent-hover);
}

.hidden {
    display: none !important;
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 2rem;
    padding-bottom: 1rem;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--color-text);
}

.page-btn:hover:not(:disabled):not(.active) {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.page-btn.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0 0.25rem;
    color: var(--color-text-secondary);
}

/* ─── Modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    color: var(--color-text-secondary);
}

.modal-close:hover {
    background: var(--color-border);
}

.modal-body {
    padding: 1.5rem;
}

.modal-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, #e8e8ed, #d2d2d7);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-image .placeholder-icon {
    font-size: 3.5rem;
    opacity: 0.3;
}

.modal-brand {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
}

.modal-model {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.2rem 0 0.5rem;
}

.modal-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.modal-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.modal-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

/* ─── Variants Table ─── */
.variants-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.variants-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.variants-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
    padding: 0.5rem 0.5rem 0.5rem 0;
    border-bottom: 1.5px solid var(--color-border);
}

.variants-table td {
    padding: 0.55rem 0.5rem 0.55rem 0;
    border-bottom: 1px solid var(--color-bg);
    vertical-align: middle;
}

.variants-table tr:last-child td {
    border-bottom: none;
}

.add-to-cart-btn {
    padding: 0.35rem 0.85rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: var(--color-accent-hover);
}

.add-to-cart-btn:disabled {
    background: var(--color-border);
    cursor: not-allowed;
}

.out-of-stock {
    color: var(--color-text-secondary);
    font-size: 0.78rem;
    font-style: italic;
}

/* ─── Toast ─── */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.25s ease;
    max-width: 320px;
}

.toast.success {
    background: var(--color-success);
    color: #fff;
}

.toast.error {
    background: var(--color-error);
    color: #fff;
}

.toast.info {
    background: var(--color-primary);
    color: #fff;
}

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

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .sidebar {
        width: 100%;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 150;
        border-radius: 0;
        max-height: none;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        padding-top: 0.5rem;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-filter-btn {
        display: flex;
    }

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

    .card-image {
        height: 120px;
    }

    .modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--radius-md);
    }

    .modal-image {
        height: 180px;
    }

    .modal-model {
        font-size: 1.25rem;
    }

    .variants-table {
        font-size: 0.78rem;
    }

    .header-inner {
        padding: 0 0.75rem;
    }

    .logo {
        font-size: 1.15rem;
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .card-body {
        padding: 0.6rem;
    }

    .card-model {
        font-size: 0.85rem;
    }

    .card-price {
        font-size: 0.9rem;
    }

    .pagination {
        gap: 0.2rem;
    }

    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.78rem;
    }
}

/* ─── Cart Panel ─── */
.cart-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 250;
    animation: fadeIn 0.15s ease;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: var(--color-surface);
    z-index: 260;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    animation: slideInRight 0.25s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

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

.cart-panel-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.cart-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: var(--transition);
}

.cart-panel-close:hover {
    background: var(--color-border);
}

.cart-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-secondary);
    gap: 1rem;
}

.cart-empty p {
    font-size: 1rem;
}

.continue-shopping-btn {
    padding: 0.6rem 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.continue-shopping-btn:hover {
    background: var(--color-accent-hover);
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-variant {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.4rem;
}

.cart-item-price {
    font-size: 0.85rem;
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    flex-shrink: 0;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--color-text);
    transition: var(--transition);
}

.qty-btn:hover:not(:disabled) {
    background: var(--color-bg);
}

.qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.qty-value {
    width: 32px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    line-height: 28px;
}

.remove-item-btn {
    background: none;
    border: none;
    color: var(--color-error);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.2rem 0;
    transition: var(--transition);
}

.remove-item-btn:hover {
    text-decoration: underline;
}

.cart-panel-footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.cart-totals {
    margin-bottom: 0.75rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
}

.checkout-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.checkout-btn:hover {
    background: var(--color-accent-hover);
}

.clear-cart-btn {
    width: 100%;
    padding: 0.5rem;
    background: none;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.clear-cart-btn:hover {
    border-color: var(--color-error);
    color: var(--color-error);
}

@media (max-width: 480px) {
    .cart-panel {
        width: 100vw;
        max-width: 100vw;
    }

    .cart-item {
        padding: 0.6rem;
    }
}

/* ─── Order Confirmation ─── */
#order-confirmation {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.15s ease;
}

#order-confirmation .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.confirmation-content {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    color: var(--color-text-secondary);
}

.close-btn:hover {
    background: var(--color-border);
}

.confirmation-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--color-success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}

.confirmation-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.confirmation-message {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.25rem;
}

.order-id {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent);
    background: var(--color-bg);
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
}

.confirmation-items {
    text-align: left;
    margin-bottom: 1.25rem;
    max-height: 240px;
    overflow-y: auto;
}

.confirmation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-bg);
    font-size: 0.85rem;
}

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

.confirmation-item-details {
    flex: 1;
    min-width: 0;
}

.confirmation-item-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.confirmation-item-variant {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
}

.confirmation-item-price {
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.confirmation-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-top: 1.5px solid var(--color-border);
    border-bottom: 1.5px solid var(--color-border);
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--color-accent-hover);
}

@media (max-width: 480px) {
    .confirmation-content {
        padding: 1.5rem 1.25rem;
    }

    .confirmation-icon {
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
    }

    .confirmation-content h2 {
        font-size: 1.25rem;
    }
}

/* ─── Admin Panel ─── */

.admin-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-toggle-btn:hover {
    background: var(--color-accent);
}

#admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-content {
    position: relative;
    background: var(--color-surface);
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 1;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.admin-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.admin-section {
    padding: 24px;
}

#admin-login {
    text-align: center;
}

#admin-password-input {
    padding: 10px 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    width: 250px;
    margin-right: 8px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
}

.admin-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.admin-tab.active {
    border-bottom-color: var(--color-accent);
    color: var(--color-accent);
    font-weight: 600;
}

#admin-shoes-table-wrapper {
    overflow-x: auto;
}

#admin-shoes-table {
    width: 100%;
    border-collapse: collapse;
}

#admin-shoes-table th,
#admin-shoes-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

#admin-shoes-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #666;
}

#admin-shoes-table td button {
    padding: 4px 10px;
    margin-right: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.8rem;
}

#admin-shoes-table td button:hover {
    background: #f0f0f0;
}

#admin-shoes-table td button.btn-del {
    color: #d32f2f;
    border-color: #d32f2f;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.form-row label {
    flex: 1;
}

#admin-shoe-form label,
#admin-edit-form label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
}

#admin-shoe-form input,
#admin-shoe-form select,
#admin-shoe-form textarea,
#admin-edit-form input,
#admin-edit-form select,
#admin-edit-form textarea {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

#admin-shoe-form .btn-primary,
#admin-edit-form .btn-primary {
    margin-top: 16px;
}

.btn-secondary {
    padding: 8px 16px;
    border: 1px solid var(--color-accent);
    border-radius: 8px;
    background: none;
    color: var(--color-accent);
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 8px;
}

.btn-secondary:hover {
    background: var(--color-accent);
    color: #fff;
}

.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #d32f2f;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-danger:hover {
    background: #b71c1c;
}

.edit-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.variant-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.variant-row input,
.variant-row select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
}

.variant-row .v-size { width: 80px; }
.variant-row .v-color { width: 100px; }
.variant-row .v-sku { width: 160px; }
.variant-row .v-stock { width: 70px; }
.variant-row .v-price { width: 80px; }

.variant-row button {
    padding: 4px 8px;
    border: 1px solid #d32f2f;
    border-radius: 4px;
    background: none;
    color: #d32f2f;
    cursor: pointer;
}

#admin-variants-section h4,
#admin-edit-variants-section h4 {
    margin: 16px 0 8px;
    font-size: 0.95rem;
}

/* ─── Chat Widget ─── */

.chat-toggle-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 5rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--color-accent);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 900;
    box-shadow: 0 4px 14px rgba(0,113,227,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), transform var(--transition);
}

.chat-toggle-btn:hover {
    background: var(--color-accent-hover);
    transform: scale(1.07);
}

.chat-panel {
    position: fixed;
    bottom: calc(1.5rem + 52px + 0.75rem);
    right: 1.5rem;
    width: 360px;
    height: 480px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 900;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.2s ease;
}

@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-panel.hidden {
    display: none !important;
}

.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.chat-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.2rem;
    transition: color var(--transition);
}

.chat-close-btn:hover {
    color: #fff;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.chat-msg {
    display: flex;
    max-width: 90%;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg.bot {
    align-self: flex-start;
}

.chat-msg__text {
    display: inline-block;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Markdown rendering inside bot bubbles */
.chat-msg.bot .chat-msg__text {
    white-space: normal;
}
.chat-msg.bot .chat-msg__text p { margin: 0 0 0.4rem; }
.chat-msg.bot .chat-msg__text p:last-child { margin-bottom: 0; }
.chat-msg.bot .chat-msg__text strong { font-weight: 600; }
.chat-msg.bot .chat-msg__text em { font-style: italic; }
.chat-msg.bot .chat-msg__text table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.8rem;
    margin: 0.4rem 0;
}
.chat-msg.bot .chat-msg__text th,
.chat-msg.bot .chat-msg__text td {
    border: 1px solid var(--color-border, #ddd);
    padding: 0.25rem 0.5rem;
    text-align: left;
}
.chat-msg.bot .chat-msg__text th {
    background: var(--color-surface, #f5f5f5);
    font-weight: 600;
}
.chat-msg.bot .chat-msg__text ul,
.chat-msg.bot .chat-msg__text ol {
    margin: 0.25rem 0 0.25rem 1.2rem;
    padding: 0;
}
.chat-msg.bot .chat-msg__text li { margin-bottom: 0.15rem; }
.chat-msg.bot .chat-msg__text code {
    background: rgba(0,0,0,0.07);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.85em;
    font-family: monospace;
}

.chat-msg.user .chat-msg__text {
    background: var(--color-accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg.bot .chat-msg__text {
    background: var(--color-badge-bg);
    color: var(--color-text);
    border-bottom-left-radius: 4px;
}

/* Product card in chat */
.chat-product-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 260px;
    font-size: 0.85rem;
}

.chat-product-card__img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #e8e8ed, #d2d2d7);
}

.chat-product-card__body {
    padding: 0.6rem 0.75rem;
}

.chat-product-card__brand {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

.chat-product-card__model {
    font-weight: 600;
    margin: 0.15rem 0;
    line-height: 1.3;
}

.chat-product-card__price {
    color: var(--color-accent);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.chat-product-card__variants {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.4rem;
}

.chat-product-card__view-btn {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: background var(--transition);
}

.chat-product-card__view-btn:hover {
    background: var(--color-accent-hover);
}

/* Inventory card in chat */
.chat-inventory-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 220px;
}

.chat-inventory-card__sku {
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--color-text-secondary);
}

.chat-inventory-card__name {
    font-weight: 600;
}

.chat-inventory-card__status {
    font-weight: 600;
    margin-top: 0.2rem;
}

.chat-inventory-card__status.in-stock {
    color: var(--color-success);
}

.chat-inventory-card__status.out-of-stock {
    color: var(--color-error);
}

/* Order card in chat */
.chat-order-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    min-width: 240px;
}

.chat-order-card__header {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.chat-order-card__items {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-order-card__items li {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.2rem;
}

.chat-order-card__items li:last-child {
    border-bottom: none;
}

.chat-order-card__total {
    font-weight: 700;
    color: var(--color-accent);
    margin-top: 0.35rem;
}

/* Chat input row */
.chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
    background: var(--color-surface);
}

#chat-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition);
}

#chat-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}

#chat-input:disabled {
    background: var(--color-bg);
    color: var(--color-text-secondary);
}

.chat-send-btn {
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--color-accent-hover);
}

.chat-send-btn:disabled {
    background: var(--color-border);
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .chat-panel {
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        bottom: calc(1.5rem + 52px + 0.5rem);
    }

    .chat-toggle-btn {
        right: 4.5rem;
        bottom: 0.75rem;
    }
}

/* ─── Auth Area (Sprint 6) ─── */
.auth-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#user-greeting {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
}

.auth-btn {
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1.5px solid transparent;
    white-space: nowrap;
}

.auth-btn--primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.auth-btn--primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

.auth-btn--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
}

.auth-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Login-to-checkout button variant */
.checkout-btn--secondary {
    background: var(--color-text-secondary);
    color: #fff;
}

.checkout-btn--secondary:hover {
    background: var(--color-primary);
}

@media (max-width: 480px) {
    #user-greeting {
        display: none;
    }
}
