/* --- Base --- */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #FBFAF7;
    color: #2B2B2B;
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1:focus { outline: none; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Header --- */
.site-header {
    text-align: center;
    padding: 64px 16px 40px;
}

.site-header__brand {
    display: inline-block;
    font-size: 30px;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    text-decoration: none;
    color: #2B2B2B;
}

.site-header__tagline {
    margin: 10px 0 0;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #8A8378;
}

/* --- Home grid (masonry) --- */
.grid {
    column-count: 3;
    column-gap: 28px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px 96px;
}

.tile {
    display: block;
    position: relative;
    break-inside: avoid;
    margin: 0 0 28px;
    text-decoration: none;
}

.tile__img {
    display: block;
    width: 100%;
    object-fit: contain;
    background: #F3F1EC;
    transition: opacity 220ms ease;
}

.tile:hover .tile__img { opacity: 0.86; }

.tile__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    background: #F3F1EC;
    color: #8A8378;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-align: center;
}

.tile--sold .tile__img,
.tile--sold .tile__placeholder { opacity: 0.55; }

.tile__sold {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: #FBFAF7;
    color: #6B675F;
    font-size: 10px;
    letter-spacing: 0.2em;
}

/* --- Not found --- */
.notfound {
    margin: 80px 0 8px;
    text-align: center;
    color: #6B675F;
}

.notfound__back {
    margin: 0 0 80px;
    text-align: center;
    font-size: 13px;
}

@media (max-width: 900px) {
    .grid { column-count: 2; column-gap: 20px; padding: 0 20px 64px; }
    .tile { margin-bottom: 20px; }
}

@media (max-width: 600px) {
    .grid { column-count: 1; padding: 0 16px 48px; }
    .site-header { padding: 40px 16px 28px; }
}

/* --- Detail --- */
.detail {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 56px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px 96px;
}

.detail__main {
    display: block;
    width: 100%;
    background: #F3F1EC;
}

.detail__thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.detail__thumb {
    padding: 0;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    width: 72px;
}

.detail__thumb img { display: block; width: 100%; }

.detail__thumb.is-selected { border-color: #2B2B2B; }

.detail__title {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.detail__price {
    margin: 0 0 28px;
    font-size: 15px;
    color: #6B675F;
}

.detail__meta {
    margin: 0 0 28px;
    font-size: 12px;
}

.detail__meta dt {
    color: #8A8378;
    letter-spacing: 0.18em;
    margin-top: 14px;
}

.detail__meta dd { margin: 4px 0 0; }

.detail__desc {
    margin: 0 0 32px;
    line-height: 1.65;
}

.buy {
    padding: 12px 28px;
    border: 1px solid #2B2B2B;
    background: none;
    color: #2B2B2B;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
}

.buy[disabled] {
    border-color: #C9C3B8;
    color: #A8A197;
    cursor: default;
}

.buy__msg {
    margin: 16px 0 0;
    font-size: 13px;
    color: #6B675F;
}

.detail__back {
    margin: 40px 0 0;
    font-size: 13px;
}

@media (max-width: 900px) {
    .detail { grid-template-columns: 1fr; gap: 28px; padding: 0 20px 64px; }
}
