/* ─── Fonts ─────────────────────────────────────────────────────────── */

@font-face {
    font-family: 'SF Pro Display';
    src: url('fonts/SF-Pro-Display-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('fonts/SFPRODISPLAYREGULAR.OTF') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('fonts/SFPRODISPLAYMEDIUM.OTF') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* ─── Reset & Base ─────────────────────────────────────────────────── */

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

/* Global hidden utility — used by JS everywhere */
.hidden { display: none !important; }

:root {
    --color-bg:       #ffffff;
    --color-text:     #0a0a0a;
    --color-muted:    #888888;
    --color-border:   #e5e5e5;
    --color-hover:    #0a0a0a;
    --sidebar-width:  200px;
    --font:           'SF Pro Display', ui-sans-serif, system-ui, sans-serif;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font);
    font-weight: 400;
    line-height: 1.5;
    text-transform: lowercase;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* ─── Layout ───────────────────────────────────────────────────────── */

.layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ──────────────────────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    padding: 2rem 1.75rem;
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
}

/* Logo / Site Name */
.sidebar-logo a {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--color-text);
    transition: opacity 0.2s ease;
}

.sidebar-logo a:hover {
    opacity: 0.6;
}

/* Navigation list */
.nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.nav-link {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--color-muted);
    padding: 0.3rem 0;
    transition: color 0.15s ease;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--color-text);
}

.nav-link.active {
    color: var(--color-text);
}

/* Subcategories — slightly indented, smaller */
.nav-link--sub {
    padding-left: 0.75rem;
    font-size: 0.75rem;
}

/* No separator before Bio */
.nav-link--bio {}

/* ─── Search ───────────────────────────────────────────────────────── */

.search-wrapper {
    /* Sits right below nav list, no auto-push to bottom */
    padding-top: 0;
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border);
    outline: none;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text);
    padding: 0.3rem 0;
    transition: border-color 0.2s ease;
    caret-color: var(--color-text);
}

.search-input::placeholder {
    color: var(--color-muted);
    font-weight: 300;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

.search-input:focus {
    border-bottom-color: var(--color-text);
}

/* ─── Main Content ─────────────────────────────────────────────────── */

.main-content {
    flex: 1;
    padding: 2.5rem 2.5rem 4rem;
    min-width: 0;
}

/* ─── Products Grid ────────────────────────────────────────────────── */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2.5rem 2rem;
    align-items: start;
}

/* ─── Product Card ─────────────────────────────────────────────────── */

.product-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    cursor: pointer;
    animation: fadeIn 0.4s ease both;
    text-decoration: none;
    color: inherit;
}

/* .product-card.hidden — covered by global .hidden rule */

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Placeholder квадратный — показывается пока нет фото */
.product-image-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f0f0f0;
    transition: background-color 0.2s ease;
}

.product-card:hover .product-image-placeholder {
    background-color: #e8e8e8;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-image img {
    opacity: 0.85;
}

/* Product info */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.product-title {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text);
    letter-spacing: 0.01em;
    text-transform: none;
}

.product-meta {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--color-muted);
    letter-spacing: 0.01em;
}

.product-price {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-text);
    letter-spacing: 0.01em;
    margin-top: 0.2rem;
}

/* Loading state */
.loading-state {
    padding: 3rem 0;
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* ─── No Results ───────────────────────────────────────────────────── */

.no-results {
    padding: 3rem 0;
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* .no-results.hidden — covered by global .hidden rule */

/* ─── Product Detail Page ──────────────────────────────────────────── */

/* Vertically center product content within the main area */
body.product-page .main-content {
    display: flex;
    flex-direction: column;
}

body.product-page .pd-wrap {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
}

.pd-back {
    display: inline-block;
    padding: 0;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    color: var(--color-muted);
    transition: color 0.15s ease;
    line-height: 1;
}

.pd-back:hover {
    color: var(--color-text);
}

/* Three-column layout: thumbs | main image | info */
.pd-wrap {
    display: flex;
    align-items: center;    /* center all columns relative to the main image */
    gap: 2rem;
    padding: 0;
    max-width: 1160px;
    width: 100%;
}

/* ── Thumbnail column ── */
.pd-thumbs {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 72px;
    flex-shrink: 0;
}

.pd-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.15s ease;
}

.pd-thumb--active,
.pd-thumb:hover {
    opacity: 1;
}

/* ── Main image ── */
.pd-main {
    flex: 0 1 460px;
    min-width: 0;
    cursor: pointer;
}

.pd-main-img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.22s ease;
}

/* ── Info panel ── */
.pd-info {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 75vh;
    overflow: hidden;
}

.pd-title {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--color-text);
    flex-shrink: 0;
    text-transform: none;
}

.pd-description {
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.85;
    color: var(--color-text);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    text-transform: none;
}

.pd-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.pd-price {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.pd-actions {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.pd-buy-btn {
    padding: 0.5rem 1.4rem;
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.pd-buy-btn:hover {
    opacity: 0.75;
}

/* ── Cart icon button ── */
.pd-cart-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.pd-cart-btn {
    width: auto;
    aspect-ratio: 1 / 1;
    height: 100%;
    flex-shrink: 0;
    border: none;
    background: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-bg);
    position: relative;
    transition: opacity 0.15s ease;
}

.pd-cart-btn:hover { opacity: 0.75; }

/* Иконка и галочка — плавная смена через opacity */
.pd-cart-icon-wrap,
.pd-cart-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.22s ease;
}
.pd-cart-check { opacity: 0; font-size: 0.85rem; }
.pd-cart-btn--added .pd-cart-icon-wrap { opacity: 0; }
.pd-cart-btn--added .pd-cart-check { opacity: 1; }

.pd-cart-hint {
    font-size: 0.73rem;
    color: var(--color-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
    animation: fadeIn 0.2s ease;
}

.pd-cart-hint:hover {
    color: var(--color-text);
    border-color: var(--color-muted);
}

/* Loading / error states for product page */
.pd-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--color-muted);
    padding: 4rem;
}

.pd-error {
    flex: 1;
    padding: 4rem 3rem;
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* ─── Lightbox ──────────────────────────────────────────────────────── */

.lb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lb-img {
    max-width: 93vw;
    max-height: 91vh;
    object-fit: contain;
    display: block;
    user-select: none;
    cursor: zoom-in;
}

.lb-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.15s ease;
}
.lb-close:hover { color: #fff; }

.lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 2.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 1rem 1.25rem;
    transition: color 0.15s ease;
    user-select: none;
}
.lb-arrow:hover { color: #fff; }
.lb-arrow--prev { left: 0; }
.lb-arrow--next { right: 0; }

/* ─── Cart badge ─────────────────────────────────────────────────────── */

.cart-badge {
    display: none;
    background: var(--color-text);
    color: var(--color-bg);
    font-size: 0.6rem;
    min-width: 15px;
    height: 15px;
    border-radius: 8px;
    text-align: center;
    line-height: 15px;
    padding: 0 3px;
    margin-left: 0.35rem;
    vertical-align: middle;
}

/* ─── Cart Page ──────────────────────────────────────────────────────── */

.cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: fixed;
}

.cart-table th {
    text-align: left;
    font-weight: 400;
    color: var(--color-muted);
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.cart-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.cart-td-img { width: 60px; }

.cart-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    display: block;
}

.cart-td-title { font-weight: 300; text-transform: none; }

.cart-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-qty-btn {
    background: none;
    border: 1px solid var(--color-border);
    width: 22px;
    height: 22px;
    font-family: var(--font);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease;
}
.cart-qty-btn:hover { border-color: var(--color-text); }

.cart-remove {
    background: none;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.1rem 0.4rem;
    transition: color 0.15s ease;
}
.cart-remove:hover { color: var(--color-text); }

.cart-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 0.75rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.25rem;
}

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

.cart-total strong {
    font-weight: 500;
}

.cart-checkout-btn {
    padding: 0.65rem 1.75rem;
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: lowercase;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.cart-checkout-btn:hover { opacity: 0.75; }

.cart-empty {
    padding: 4rem 2.5rem;
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* ─── Bio Page ─────────────────────────────────────────────────────── */

.bio-content {
    max-width: 520px;
    padding-top: 0.25rem;
}

.bio-content p {
    font-size: 0.85rem;
    font-weight: 300;
    line-height: 1.75;
    color: var(--color-text);
    margin-bottom: 1.25rem;
}

.bio-content p:last-child {
    margin-bottom: 0;
}

.bio-requisites {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.bio-requisites p {
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.75;
    margin-bottom: 0.5rem;
}

.bio-requisites p:last-child {
    margin-bottom: 0;
}

.bio-requisites strong {
    font-weight: 500;
}

.bio-requisites a {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bio-requisites a:hover {
    color: var(--color-muted);
}

/* ─── Animation ────────────────────────────────────────────────────── */

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

/* ─── Scrollbar ────────────────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-muted);
}

/* ─── Site Footer ───────────────────────────────────────────────────── */

body {
    padding-bottom: 36px; /* space for fixed footer on desktop */
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 0 1.75rem;
    z-index: 50;
}

.site-footer a {
    font-size: 0.7rem;
    color: var(--color-muted);
    letter-spacing: 0.01em;
    transition: color 0.15s ease;
}

.site-footer a:hover {
    color: var(--color-text);
}

/* ─── Legal pages ───────────────────────────────────────────────────── */

.legal-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 2rem 3rem;
    text-transform: none;
}

.legal-back {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-bottom: 2rem;
    transition: color 0.15s ease;
}

.legal-back:hover { color: var(--color-text); }

.legal-wrap h1 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.legal-wrap h2 {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 1.5rem 0 0.5rem;
}

.legal-wrap p {
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

/* ─── Mobile Header (hidden on desktop) ────────────────────────────── */

.mobile-header {
    display: none;
}

/* Overlay backdrop for sidebar drawer */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 150;
}

.sidebar-overlay.visible {
    display: block;
}

/* ─── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 640px) {

    /* Flex column so header + content + footer fill exactly the viewport height.
       On short pages footer stays at the bottom; on long pages it scrolls with content. */
    body {
        display: flex;
        flex-direction: column;
        min-height: 100svh; /* svh = small viewport height, correct on mobile */
        min-height: 100vh;  /* fallback for older browsers */
        padding-bottom: 0;
    }

    .mobile-header {
        flex-shrink: 0;
    }

    /* ── Footer: static at bottom of page content on mobile ── */
    .site-footer {
        position: static;
        height: auto;
        padding: 0.9rem 1.25rem;
        gap: 1.5rem;
    }

    /* ── Mobile top bar ── */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        height: 52px;
        padding: 0 1.25rem;
        border-bottom: 1px solid var(--color-border);
        position: sticky;
        top: 0;
        background: var(--color-bg);
        z-index: 100;
    }

    .mobile-header-logo {
        font-size: 0.85rem;
        font-weight: 500;
        letter-spacing: 0.04em;
        color: var(--color-text);
    }

    .mobile-header-right {
        display: flex;
        align-items: center;
        gap: 1.1rem;
    }

    .mobile-cart-link {
        font-size: 0.78rem;
        color: var(--color-muted);
        transition: color 0.15s ease;
    }

    .mobile-cart-link:hover { color: var(--color-text); }

    .burger-btn {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        gap: 5px;
        padding: 6px 2px;
    }

    .burger-btn span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--color-text);
        border-radius: 1px;
        transition: opacity 0.2s ease;
        flex-shrink: 0;
    }

    /* ── Layout: sidebar is out of flow (fixed drawer); grows to push footer down ── */
    .layout {
        flex-direction: row;
        flex: 1;
        min-height: 0; /* override desktop min-height: 100vh */
    }

    /* ── Sidebar: slide-in drawer from left ── */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 72%;
        max-width: 260px;
        height: 100%;
        min-height: 100vh;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid var(--color-border);
        border-bottom: none;
        padding: 2rem 1.75rem;
        gap: 2.5rem;
        flex-direction: column;
        background: var(--color-bg);
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    }

    /* ── Nav: vertical column in drawer ── */
    .nav-list {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.1rem;
    }

    .nav-link--sub {
        padding-left: 0.75rem;
        font-size: 0.75rem;
    }

    /* ── Main content: full width ── */
    .main-content {
        padding: 1.5rem 1.25rem 2rem;
        width: 100%;
    }

    /* ── Products grid ── */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1.75rem 1.25rem;
    }

    /* ── Product detail ── */
    .pd-back {
        padding: 0;
        margin-bottom: 0.75rem;
    }

    .pd-wrap {
        flex: none; /* remove vertical centering on mobile — content stacks naturally */
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        gap: 1.25rem;
        max-width: 100%;
    }

    /* Main image: fixed square — prevents layout jump on image switch */
    .pd-main {
        flex: none;
        width: 100%;
        order: 1;
        aspect-ratio: 1 / 1;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .pd-main-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    /* Thumbnails: horizontal scroll row, below main image, centered */
    .pd-thumbs {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        order: 2;
        justify-content: center;
    }

    .pd-thumb {
        width: 56px;
        height: 56px;
        flex-shrink: 0;
    }

    /* Info panel: no height cap, page scrolls instead */
    .pd-info {
        order: 3;
        min-width: 0;
        max-height: none;
        overflow: visible;
    }

    .pd-description {
        overflow-y: visible;
    }

    /* ── Cart: card layout ── */
    .cart-table,
    .cart-table tbody {
        display: block;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tr {
        display: grid;
        grid-template-columns: 56px 1fr auto;
        grid-template-rows: auto auto;
        column-gap: 0.75rem;
        row-gap: 0.3rem;
        padding: 0.85rem 0;
        border-bottom: 1px solid var(--color-border);
    }

    .cart-table td {
        display: block;
        padding: 0;
        border: none;
    }

    .cart-td-img    { grid-column: 1; grid-row: 1 / 3; align-self: center; }
    .cart-td-title  { grid-column: 2; grid-row: 1; align-self: end; font-size: 0.8rem; line-height: 1.35; }
    .cart-td-remove { grid-column: 3; grid-row: 1; align-self: center; }

    /* Price: shown as small muted text, second row */
    .cart-td-price {
        display: block !important;
        grid-column: 2;
        grid-row: 2;
        font-size: 0.72rem;
        color: var(--color-muted);
        align-self: start;
    }

    /* Qty controls: second row, right column */
    .cart-td-qty {
        grid-column: 3;
        grid-row: 2;
        align-self: start;
    }

    /* Hide per-row subtotal */
    .cart-td-sub { display: none !important; }

    /* Smaller qty buttons */
    .cart-qty { gap: 0.3rem; }
    .cart-qty-btn { width: 20px; height: 20px; font-size: 0.85rem; }

    /* Cart footer: stacked */
    .cart-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem 0;
    }

    .cart-checkout-btn {
        width: 100%;
        padding: 0.85rem;
        text-align: center;
    }

    /* ── Lightbox: bigger tap targets ── */
    .lb-arrow {
        font-size: 2.2rem;
        padding: 1.5rem 0.75rem;
    }

    .lb-close {
        top: 0.5rem;
        right: 0.75rem;
    }

    .lb-img {
        cursor: default;
    }
}

/* ─── Checkout Modal ────────────────────────────────────────────────── */

.checkout-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 600;
    padding: 1.5rem;
}

.checkout-modal {
    background: var(--color-bg);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    animation: fadeIn 0.18s ease both;
}

.checkout-close {
    position: absolute;
    top: 0.9rem;
    right: 1.1rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    transition: color 0.15s ease;
}
.checkout-close:hover { color: var(--color-text); }

.checkout-heading {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    padding-right: 2rem;
}

/* Order summary */
.checkout-summary {
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: 0.65rem 0;
    margin-bottom: 1.5rem;
}

.checkout-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
}

.checkout-item-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    flex-shrink: 0;
}

.checkout-item-img-placeholder {
    width: 44px;
    height: 44px;
    background: var(--color-border);
    flex-shrink: 0;
}

.checkout-item-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.checkout-item-title {
    font-size: 0.78rem;
    font-weight: 400;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checkout-item-price {
    font-size: 0.72rem;
    color: var(--color-muted);
}

.checkout-total {
    font-size: 0.78rem;
    font-weight: 400;
    text-transform: none;
    padding-top: 0.6rem;
    margin-top: 0.4rem;
    border-top: 1px solid var(--color-border);
    text-align: right;
}

.checkout-total strong { font-weight: 500; }

/* Form */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkout-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.checkout-label {
    font-size: 0.7rem;
    color: var(--color-muted);
    letter-spacing: 0.02em;
}

.checkout-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border);
    outline: none;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--color-text);
    padding: 0.35rem 0;
    transition: border-color 0.2s ease;
    text-transform: none;
    caret-color: var(--color-text);
}

.checkout-input:focus { border-bottom-color: var(--color-text); }

.checkout-input::placeholder {
    color: var(--color-muted);
    font-weight: 300;
    text-transform: none;
}

.checkout-textarea {
    resize: vertical;
    min-height: 54px;
}

.checkout-error {
    font-size: 0.73rem;
    color: #b00;
    margin: 0;
    text-transform: none;
}

.checkout-submit {
    margin-top: 0.25rem;
    padding: 0.65rem 1.75rem;
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: lowercase;
    cursor: pointer;
    transition: opacity 0.2s ease;
    align-self: flex-start;
}
.checkout-submit:hover    { opacity: 0.75; }
.checkout-submit:disabled { opacity: 0.45; cursor: default; }

/* Success screen */
.checkout-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 2.5rem 0 1rem;
    text-align: center;
    text-transform: none;
}

.checkout-success-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.checkout-success-sub {
    font-size: 0.78rem;
    color: var(--color-muted);
}

/* Mobile: slide up from bottom */
@media (max-width: 640px) {
    .checkout-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .checkout-modal {
        max-width: 100%;
        max-height: 92vh;
        padding: 1.5rem 1.25rem 2.5rem;
    }
}

/* ─── Pay page ──────────────────────────────────────────────────────────── */

body.pay-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.pay-wrap {
    width: 100%;
    max-width: 460px;
}

.pay-loading,
.pay-error {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-muted);
    padding: 4rem 0;
}

.pay-card {
    border: 1px solid var(--color-border);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pay-check-icon {
    color: var(--color-text);
    margin-bottom: 1.25rem;
}

.pay-title {
    font-size: 1rem;
    font-weight: 500;
    text-transform: none;
    margin-bottom: 0.35rem;
}

.pay-order-num {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-bottom: 1.75rem;
}

.pay-items {
    width: 100%;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pay-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8rem;
}

.pay-item-title {
    font-weight: 300;
    flex: 1;
}

.pay-item-price {
    color: var(--color-muted);
    white-space: nowrap;
}

.pay-total {
    width: 100%;
    text-align: right;
    font-size: 0.82rem;
    font-weight: 300;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.pay-total strong {
    font-weight: 500;
}

.pay-hint {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--color-muted);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.pay-btn {
    padding: 0.65rem 2rem;
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: lowercase;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.pay-btn:hover { opacity: 0.75; }

.pay-back {
    font-size: 0.75rem;
    color: var(--color-muted);
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color 0.15s ease;
    margin-top: 0.5rem;
}

.pay-back:hover { color: var(--color-text); }
