:root {
    --ink: #253038;
    --muted: #69757d;
    --line: #d8e0df;
    --paper: #fbfaf7;
    --panel: #ffffff;
    --mint: #7ab7a8;
    --amber: #e3b45f;
    --clay: #cc806d;
    --blue: #80a9c7;
    --shadow: 0 12px 30px rgba(37, 48, 56, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem max(1rem, 6vw);
    background: rgba(251, 250, 247, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    font-weight: 800;
    text-decoration: none;
}

.admin-link {
    color: var(--muted);
    text-decoration: none;
}

.page-shell {
    display: grid;
    grid-template-columns: minmax(170px, 15%) minmax(0, 70%);
    justify-content: center;
    gap: 2rem;
    padding: 2rem max(1rem, 5vw);
}

.home-shell {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 920px);
    grid-template-areas:
        "featured featured"
        "tags catalog";
    justify-content: center;
    gap: 1.5rem 2rem;
    padding: 2rem max(1rem, 5vw);
}

.item-detail-shell {
    grid-template-areas: "featured featured";
}

.tag-sidebar {
    position: sticky;
    top: 5rem;
    align-self: start;
}

.catalog-tags {
    grid-area: tags;
}

.tag-sidebar h1 {
    margin: 0 0 1rem;
    font-size: 1.55rem;
}

.featured-section {
    grid-area: featured;
}

.catalog-section {
    grid-area: catalog;
    min-width: 0;
}

.featured-section > h1,
.catalog-section > h2 {
    margin: 0 0 1rem;
    font-size: 1.35rem;
}

.filter-tags,
.tag-list,
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.filter-tag,
.tag {
    border: 1px solid color-mix(in srgb, var(--tag-color) 65%, #5d686f);
    background: color-mix(in srgb, var(--tag-color) 16%, #ffffff);
    color: var(--ink);
    border-radius: 999px;
    padding: 0.42rem 0.72rem;
}

.filter-tag {
    cursor: pointer;
}

.filter-tag.active {
    background: var(--tag-color);
    color: #172126;
}

.feed {
    display: grid;
    gap: 1.35rem;
    min-width: 0;
}

.product-card {
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.product-card-full {
    max-width: 980px;
    margin: 0 auto;
}

.media-carousel {
    position: relative;
    overflow: hidden;
    background: #edf2ef;
}

.media-track {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 10;
}

.media-slide {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: none;
    width: 100%;
    height: 100%;
}

.media-slide.active {
    display: grid;
    place-items: center;
}

.media-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.media-image-link .soft-image {
    width: 100%;
    height: 100%;
}

.soft-image {
    position: relative;
    display: block;
    overflow: hidden;
    background: #edf2ef;
    border-radius: inherit;
    isolation: isolate;
}

.soft-image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(237, 242, 239, 0.62);
    pointer-events: none;
}

.soft-image-background,
.soft-image-foreground {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.soft-image-background {
    z-index: 0;
    object-fit: cover;
    filter: blur(18px) grayscale(70%) saturate(45%) brightness(1.18);
    opacity: 0.72;
    transform: scale(1.1);
}

.soft-image-foreground {
    z-index: 2;
    object-fit: contain;
}

.media-placeholder,
.thumbnail-placeholder {
    display: grid;
    place-items: center;
    background: #edf2ef;
    color: var(--muted);
    font-weight: 800;
}

.media-placeholder {
    aspect-ratio: 16 / 10;
}

.video-player {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: #172126;
}

.video-player video,
.video-embed {
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

.video-toggle {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    min-width: 5.25rem;
    border: 0;
    border-radius: 6px;
    padding: 0.58rem 0.85rem;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    cursor: pointer;
}

.carousel-button.previous {
    left: 0.75rem;
}

.carousel-button.next {
    right: 0.75rem;
}

.product-body {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
}

.product-heading {
    margin: 0;
    font-size: 1.35rem;
}

.product-title {
    font-size: 1.35rem;
    font-weight: 800;
    text-decoration: none;
}

.product-description {
    margin: 0;
}

.color-groups p {
    margin: 0.25rem 0;
    color: var(--muted);
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.metadata-grid div {
    min-width: 0;
}

.metadata-grid dt {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.metadata-grid dd {
    margin: 0.1rem 0 0;
}

.product-list {
    display: grid;
    gap: 0.9rem;
}

.preview-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    min-height: 126px;
    padding: 0.75rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.preview-card:focus-visible {
    outline: 3px solid #1f6feb;
    outline-offset: 3px;
}

.preview-thumb {
    display: block;
    overflow: hidden;
    min-height: 110px;
    border-radius: 6px;
    background: #edf2ef;
    text-decoration: none;
}

.preview-thumb .soft-image,
.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    min-height: 110px;
}

.preview-body {
    display: grid;
    align-content: start;
    gap: 0.45rem;
    min-width: 0;
}

.preview-body h3 {
    margin: 0;
    font-size: 1.05rem;
}

.preview-body h3 a {
    text-decoration: none;
}

.preview-body p {
    margin: 0;
    color: var(--muted);
}

.catalog-back-link {
    display: inline-block;
    margin: 0 0 0.75rem;
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
}

.tag-list.compact .tag {
    padding: 0.26rem 0.5rem;
    font-size: 0.86rem;
}

.preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.button,
.icon-button {
    border: 1px solid var(--ink);
    background: var(--ink);
    color: white;
    border-radius: 6px;
    padding: 0.58rem 0.85rem;
    text-decoration: none;
    cursor: pointer;
}

.icon-button {
    position: relative;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    text-transform: uppercase;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.share-button {
    display: inline-grid;
    place-items: center;
    border: 0;
    font-weight: 800;
    line-height: 1;
}

.share-facebook {
    background: #1877f2;
}

.share-pinterest {
    background: #bd081c;
}

.share-x {
    background: #000000;
}

.order-button {
    margin-left: auto;
    background: var(--clay);
    border-color: var(--clay);
}

.order-price {
    margin: 0 0 1rem;
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 800;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(37, 48, 56, 0.45);
}

.modal.open {
    display: flex;
}

.modal-panel,
.login-card,
.admin-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.modal-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: 92vh;
    overflow: auto;
    padding: 1.25rem;
}

.close-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-weight: 700;
}

input,
textarea,
select {
    min-width: 0;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.62rem 0.72rem;
    color: var(--ink);
    background: #fff;
}

.wide {
    grid-column: 1 / -1;
}

.form-status {
    min-height: 1.5rem;
    font-weight: 700;
}

.payment-section {
    display: grid;
    gap: 1rem;
}

.payment-section h3 {
    margin: 0;
    font-size: 1.15rem;
}

.payment-section p {
    margin: 0;
}

.payment-qr {
    width: min(240px, 100%);
    height: auto;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.payment-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin: 0;
}

.payment-details div {
    min-width: 0;
}

.payment-details dt {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.payment-details dd {
    margin: 0.15rem 0 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.back-to-top {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 15;
    display: none;
    border: 0;
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    background: var(--amber);
    color: #1f2529;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.back-to-top.visible {
    display: block;
}

.login-page,
.empty-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(420px, 100%);
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem max(1rem, 4vw);
    background: var(--ink);
    color: #fff;
}

.admin-nav a,
.admin-nav button {
    color: #fff;
    background: transparent;
    border: 0;
    text-decoration: none;
    cursor: pointer;
}

.admin-shell {
    display: grid;
    gap: 1rem;
    padding: 1.5rem max(1rem, 5vw);
}

.admin-title-row,
.inline-form,
.search-form,
.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-form {
    display: grid;
    gap: 1rem;
}

.admin-panel {
    padding: 1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 0.7rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.empty-state {
    color: var(--muted);
}

@media (max-width: 860px) {
    .page-shell {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .home-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "tags"
            "featured"
            "catalog";
        padding: 1rem;
    }

    .item-detail-shell {
        grid-template-areas: "featured";
    }

    .tag-sidebar {
        position: static;
    }

    .product-card {
        width: 100%;
    }

    .metrics-grid,
    .form-grid,
    .payment-details {
        grid-template-columns: 1fr;
    }

    .site-header {
        padding: 0.75rem 1rem;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .preview-card {
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 0.75rem;
    }

    .preview-thumb,
    .preview-thumb .soft-image,
    .thumbnail-placeholder {
        min-height: 96px;
    }

}
