* {
    box-sizing: border-box;
}

:root {
    --page-bg: #f3f1ed;
    --text: #1c1917;
    --muted: #6b625a;
    --card: #ffffff;
    --line: #e7e0d8;
    --dark: #1c1917;
    --accent-bg: #f7dfb4;
    --accent-text: #3b2406;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--page-bg);
    color: var(--text);
}

a {
    color: inherit;
}

.page-header {
    padding: 32px 20px 0;
}

.page-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 34px 38px;
    border-radius: 26px;
    background: var(--dark);
    color: white;
    box-shadow: 0 18px 45px rgba(80, 70, 60, 0.25);
}

.kicker {
    margin: 0 0 10px;
    color: #f7dfb4;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1;
    letter-spacing: -0.045em;
}

.page-header p {
    max-width: 780px;
    color: #d6d3d1;
    font-size: 18px;
    line-height: 1.6;
}


.items {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 20px 46px;
}

.item-card,
.empty-state {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: 0 18px 45px rgba(80, 70, 60, 0.13);
}

.item-card {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    max-height: 780px;
    overflow: auto;
    padding: 28px;
    margin-bottom: 28px;
    scroll-margin-top: 18px;
}

.empty-state {
    padding: 28px;
}

.item-text {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}


.item-text h2 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.item-text h2 a {
    text-decoration: none;
}

.item-text h2 a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.price {
    display: inline-flex;
    margin: 0 0 22px;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--accent-bg);
    color: var(--accent-text);
    font-size: 21px;
    font-weight: 850;
}

.description {
    max-width: 62ch;
    color: #49413b;
    font-size: 18px;
    line-height: 1.7;
}



.back-link a {
    text-underline-offset: 4px;
}

.contact-box {
    margin-top: 30px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #faf8f5;
    color: var(--muted);
    font-size: 15px;
}

.contact-box p {
    margin: 4px 0;
}

.contact-title {
    color: var(--text);
    font-weight: 850;
}

.contact-box a {
    font-weight: 700;
    text-decoration-color: #b9aea4;
    text-underline-offset: 4px;
}

.item-gallery {
    min-width: 0;
}

.main-picture-button {
    display: grid;
    place-items: center;
    width: 100%;
    max-height: 520px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #eee8df;
    cursor: zoom-in;
}

.main-picture {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    background: #eee8df;
    transition: transform 180ms ease;
}

.main-picture-button:hover .main-picture {
    transform: scale(1.018);
}

.thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    margin-top: 11px;
}

.thumbnail-button {
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 13px;
    background: #eee8df;
    cursor: pointer;
    opacity: 0.86;
    transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.thumbnail-button:hover {
    opacity: 1;
    transform: translateY(-1px);
    border-color: #cfc5bb;
}

.thumbnail-button.is-active {
    opacity: 1;
    border-color: #d99927;
}

.thumbnail-button img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #eee8df;
}

.thumbnail-more-button {
    position: relative;
}

.thumbnail-more-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    background: rgba(28, 25, 23, 0.68);
    color: white;
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.thumbnail-more-overlay small {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.back-link {
    margin: 0 0 18px;
    font-weight: 700;
}

.page-footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 44px;
    color: #655b53;
    font-size: 15px;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(20, 18, 16, 0.90);
}

.lightbox[hidden] {
    display: none;
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox img {
    max-width: min(1120px, 92vw);
    max-height: 88vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.6);
}

.lightbox-close,
.lightbox-arrow {
    position: fixed;
    z-index: 1001;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.96);
    color: #1c1917;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0,0,0,0.28);
}

.lightbox-close {
    top: 16px;
    right: 18px;
    width: 44px;
    height: 44px;
    font-size: 34px;
    line-height: 1;
}

.lightbox-arrow {
    top: 50%;
    width: 56px;
    height: 56px;
    transform: translateY(-50%);
    font-size: 48px;
    line-height: 0.7;
}

.lightbox-prev {
    left: 18px;
}

.lightbox-next {
    right: 18px;
}

.lightbox-counter {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,0.96);
    color: #1c1917;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 8px 28px rgba(0,0,0,0.20);
}

code {
    padding: 2px 6px;
    border-radius: 6px;
    background: #eee8df;
}

@media (max-width: 850px) {
    .page-header {
        padding: 16px 14px 0;
    }

    .page-header-inner {
        padding: 28px 24px;
        border-radius: 22px;
    }

    .items {
        padding: 18px 14px 34px;
    }

    .item-card {
        grid-template-columns: 1fr;
        gap: 22px;
        max-height: none;
        padding: 20px;
        border-radius: 22px;
    }

    .main-picture-button {
        max-height: 460px;
    }

    .main-picture {
        max-height: 460px;
    }

    .lightbox-arrow {
        width: 46px;
        height: 46px;
        font-size: 40px;
    }

    .item-gallery {
        order: -1;
    }
}
