/* Beds — Design System */

:root {
    /* Semantic color tokens (single source of truth; dark theme overrides below) */
    --color-bg: #f7f7f8;
    --color-surface: #ffffff;
    --color-surface-alt: #eef0f3;
    --color-text: #15171c;
    --color-text-secondary: #5b6068;
    --color-border: #e3e6ea;
    --color-accent: #0f766e;
    --color-accent-hover: #115e59;
    --color-accent-soft: rgba(15, 118, 110, 0.08);

    /* Legacy --apple-* aliases (kept so existing inline template styles keep
       working and adapt to the active theme automatically) */
    --apple-white: var(--color-surface);
    --apple-black: var(--color-text);
    --apple-gray: #86868b;
    --apple-light-gray: var(--color-surface-alt);
    --apple-blue: var(--color-accent);
    --apple-dark-blue: var(--color-accent-hover);
    --apple-text: var(--color-text);
    --apple-text-secondary: var(--color-text-secondary);

    /* Radius & shadow */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-hero: clamp(2.5rem, 5vw, 4rem);
    --font-size-large: clamp(1.5rem, 3vw, 2.5rem);
    --font-size-body: 1.0625rem;
    --line-height-tight: 1.1;
    --line-height-normal: 1.5;
    
    /* Spacing */
    --spacing-section: clamp(4rem, 8vw, 8rem);
    --spacing-large: clamp(2rem, 4vw, 4rem);
    --spacing-medium: clamp(1rem, 2vw, 2rem);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-body);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: var(--line-height-tight);
}

a {
    color: var(--apple-blue);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Glassmorphism Sticky Navbar */
.navbar-glass {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: background 0.3s ease;
}

.navbar-glass .navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.375rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-glass .navbar-brand {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--apple-text);
    text-decoration: none;
}

.navbar-glass .navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
}

.navbar-glass .navbar-menu li {
    position: relative;
}

.navbar-glass .navbar-menu a {
    color: var(--apple-text);
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
    transition: opacity 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.navbar-glass .navbar-menu a:hover {
    opacity: 0.6;
}

.navbar-glass .navbar-menu .product-link {
    text-align: center;
}

.navbar-glass .navbar-menu .product-subtitle {
    font-size: 0.6875rem;
    color: var(--apple-text-secondary);
    margin-top: 0.015625rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--apple-text);
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Persistent Price Bar (Configurator) */
.price-bar {
    position: fixed;
    top: 3rem;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 0.75rem 2rem;
    display: none;
}

.price-bar.visible {
    display: block;
}

.price-bar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-bar-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--apple-text-secondary);
}

.price-bar-amount {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--apple-blue);
}


/* Cart Icon */
.cart-icon {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
}

.cart-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--apple-text);
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--apple-blue);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
}

/* Cart Dropdown */
.cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 1rem;
    width: 400px;
    max-height: 600px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: none;
    animation: fadeIn 0.2s ease;
}

.cart-dropdown.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-dropdown-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--apple-light-gray);
}

.cart-dropdown-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.cart-dropdown-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.cart-dropdown-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--apple-text-secondary);
}

.cart-dropdown-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--apple-light-gray);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Buttons */
.btn-apple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-apple-primary {
    background: var(--apple-blue);
    color: white;
}

.btn-apple-primary:hover {
    background: var(--apple-dark-blue);
    color: white;
    opacity: 1;
}

.btn-apple-secondary {
    background: transparent;
    color: var(--apple-blue);
    border: 2px solid var(--apple-blue);
}

.btn-apple-secondary:hover {
    background: var(--apple-blue);
    color: white;
}

.btn-apple-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Hero Section */
.hero-section {
    padding: var(--spacing-section) 2rem;
    text-align: center;
    background: var(--apple-light-gray);
    margin-top: 4rem;
}

.hero-title {
    font-size: var(--font-size-hero);
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: var(--font-size-large);
    color: var(--apple-text-secondary);
    margin-bottom: 2rem;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--apple-text-secondary);
    max-width: 800px;
    margin: 0 auto 2rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Content Section */
.content-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-section) 2rem;
}

.section-title {
    font-size: var(--font-size-large);
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.section-description {
    font-size: 1.125rem;
    color: var(--apple-text-secondary);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.product-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-text-secondary);
}

.product-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.product-card-content {
    padding: 1.5rem;
}

.product-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-card-subtitle {
    font-size: 0.875rem;
    color: var(--apple-text-secondary);
    margin-bottom: 1rem;
}

.product-card-description {
    font-size: 1rem;
    color: var(--apple-text-secondary);
    margin-bottom: 1.5rem;
}

/* Feature Section */
.feature-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin: var(--spacing-section) 0;
}

.feature-section.reverse {
    direction: rtl;
}

.feature-section.reverse > * {
    direction: ltr;
}

.feature-content h2 {
    font-size: var(--font-size-large);
    margin-bottom: 1rem;
}

.feature-content p {
    font-size: 1.125rem;
    color: var(--apple-text-secondary);
    margin-bottom: 1.5rem;
}

.feature-image {
    width: 100%;
    border-radius: 18px;
}

/* Configurator Layout */
.configurator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
    min-height: 100vh;
}

.configurator-hero {
    position: sticky;
    top: 8rem;
    height: fit-content;
}

.configurator-hero-image {
    width: 100%;
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.configurator-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.configurator-header {
    margin-bottom: 2rem;
}

.configurator-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.configurator-price {
    font-size: 1.5rem;
    color: var(--apple-blue);
    font-weight: 600;
}

/* Configuration Step */
.config-step {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--apple-light-gray);
    transition: opacity 0.3s ease;
}

.config-step:last-child {
    border-bottom: none;
}

.config-step.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.config-step.disabled .option-card {
    cursor: not-allowed;
}

/* Configuration Step Group */
.config-step-group {
    background: var(--apple-light-gray);
    border-radius: 18px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.config-step-group-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--apple-text);
}

.config-step-group .config-step {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.config-step-group .config-step:last-child {
    margin-bottom: 0;
}

.config-step-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.config-step-description {
    color: var(--apple-text-secondary);
    margin-bottom: 1.5rem;
}

/* Option Grid */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.option-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.option-card {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    background: var(--color-surface);
    transition: all 0.2s ease;
}

.option-card:hover {
    border-color: var(--color-accent);
}

.option-card.selected {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.option-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.option-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.option-price {
    font-size: 0.75rem;
    color: var(--apple-text-secondary);
}

/* Material Swatches */
.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
}

.material-swatch {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-border);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.material-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-swatch:hover {
    border-color: var(--apple-blue);
    transform: scale(1.05);
}

.material-swatch.selected {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-accent);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    float: right;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--apple-text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .configurator-container {
        grid-template-columns: 1fr;
    }
    
    .configurator-hero {
        position: relative;
        top: 0;
    }
    
    .feature-section {
        grid-template-columns: 1fr;
    }
    
    .navbar-glass .navbar-menu {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .navbar-glass .navbar-container {
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: flex;
        order: 3;
    }
    
    .navbar-glass .navbar-brand {
        order: 1;
    }
    
    .navbar-glass .navbar-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        margin-top: 0.75rem;
        border-radius: 12px;
        box-shadow: var(--glass-shadow);
        z-index: 999;
    }
    
    .navbar-glass .navbar-menu.active {
        display: flex;
    }
    
    .navbar-glass .navbar-menu li {
        width: 100%;
    }
    
    .navbar-glass .navbar-menu a {
        padding: 0.75rem;
        display: flex;
        justify-content: center;
    }
    
    .navbar-glass .navbar-menu .product-subtitle {
        font-size: 0.625rem;
    }
    
    .cart-dropdown {
        width: 100vw;
        max-width: 100vw;
        right: -1rem;
        left: -1rem;
        border-radius: 18px 18px 0 0;
    }
    
    .option-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-section {
        padding: 4rem 1rem;
        margin-top: 5rem;
    }
    
    .content-section {
        padding: 3rem 1rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .configurator-container {
        padding: 10rem 1rem 2rem;
    }
    
    .configurator-hero {
        top: 5rem;
    }
    
    .configurator-panel {
        padding: 1.5rem;
    }
    
    .price-bar {
        top: 2.5rem;
        padding: 0.5rem 1rem;
    }
    
    .price-bar-label {
        font-size: 0.75rem;
    }
    
    .price-bar-amount {
        font-size: 1rem;
    }
    
    .config-step {
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }
    
    .config-step-group {
        padding: 1.5rem;
    }
    
    .config-step-group .config-step {
        padding: 1rem;
    }
    
    /* Checkout responsive */
    section.content-section > div[style*="grid-template-columns: 1.5fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .btn-apple-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .option-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .material-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Footer */
.footer {
    background: var(--apple-light-gray);
    padding: 4rem 2rem 2rem;
    margin-top: var(--spacing-section);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links a {
    color: var(--apple-text-secondary);
    font-size: 0.875rem;
}

.footer-copyright {
    color: var(--apple-text-secondary);
    font-size: 0.75rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 4rem;
}

.mb-4 {
    margin-bottom: 4rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Checkout Grid */
.checkout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    max-width: 1200px;
}

.checkout-summary > div {
    position: sticky;
    top: 6rem;
}

@media (max-width: 1024px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .checkout-summary > div {
        position: relative;
        top: 0;
    }
}

/* ============================================================
   Shop page components (products, product, cart, checkout, success)
   ============================================================ */

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 7rem 2rem 4rem; /* clears the fixed navbar */
}

.page-narrow {
    max-width: 760px;
}

.page-title {
    font-size: var(--font-size-large);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

.card-surface {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.muted { color: var(--color-text-secondary); }
.price { color: var(--color-accent); font-weight: 600; }
.text-center { text-align: center; }

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    border: 1px solid transparent;
}
.alert-info {
    background: var(--color-accent-soft);
    color: var(--color-accent);
    border-color: color-mix(in srgb, var(--color-accent) 35%, transparent);
}
.alert-warning {
    background: rgba(176, 124, 0, 0.10);
    color: #8a6d00;
    border-color: rgba(176, 124, 0, 0.30);
}

/* Badges */
.badge-pill {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-muted { background: var(--color-surface-alt); color: var(--color-text-secondary); }
.badge-success { background: var(--color-accent-soft); color: var(--color-accent); }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.form-control {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}
textarea.form-control { resize: vertical; }

/* Product detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
.product-detail-image {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

/* Cart */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    align-items: start;
}
.cart-line {
    display: grid;
    grid-template-columns: 72px 1fr auto auto;
    gap: 1.25rem;
    align-items: center;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--color-border);
}
.cart-line:last-child { border-bottom: none; }
.cart-line-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* Order summary */
.summary-card { padding: 1.5rem; }
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: var(--color-text-secondary);
}
.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--color-border);
}

/* Simple line-item table */
.line-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.line-table th {
    text-align: left;
    font-weight: 600;
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--color-border);
}
.line-table td { padding: 0.6rem 0; border-bottom: 1px solid var(--color-border); }
.line-table .num { text-align: right; }

@media (max-width: 768px) {
    .cart-layout,
    .product-detail { grid-template-columns: 1fr; }
    .page { padding: 6rem 1.25rem 3rem; }
}

/* ============================================================
   Dark theme
   ============================================================ */

:root { color-scheme: light; }

:root[data-theme="dark"] {
    color-scheme: dark;

    --color-bg: #0f1115;
    --color-surface: #15181e;
    --color-surface-alt: #1d212a;
    --color-text: #e8eaed;
    --color-text-secondary: #9aa1ab;
    --color-border: #2a2f39;
    --color-accent: #2dd4bf;
    --color-accent-hover: #5eead4;
    --color-accent-soft: rgba(45, 212, 191, 0.14);

    --glass-bg: rgba(18, 20, 26, 0.72);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* Warning alert needs a dark-friendly amber */
:root[data-theme="dark"] .alert-warning {
    background: rgba(231, 193, 77, 0.12);
    color: #e7c14d;
    border-color: rgba(231, 193, 77, 0.30);
}

/* ============================================================
   Theme toggle (navbar)
   ============================================================ */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
