@import "../shared/design-tokens.css";

/* ========== Quick Edit ========== */
/* Product center knobs: category bar height, product grid density, card radius, and archive spacing. */

/* ========== Base Layout ========== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
}

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

button {
    font: inherit;
}

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

.product-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    width: var(--space-content-width);
    margin: 0 auto;
    padding: 22px 0;
    color: var(--muted);
    font-size: 14px;
}

.product-breadcrumbs [hidden] {
    display: none;
}

.product-landing[hidden],
.product-category-bar[hidden],
.product-archive[hidden] {
    display: none;
}

.breadcrumb-separator {
    color: #9aa6b2;
}

.product-breadcrumbs a:hover {
    color: var(--accent-dark);
}

.home-section {
    width: var(--space-content-width);
    margin-inline: auto;
}

.product-landing {
    padding: 48px 0 76px;
}

.section-title {
    margin-bottom: 24px;
}

.section-title.centered {
    text-align: center;
}

.section-title p {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.section-title h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(30px, 3.8vw, 42px);
    line-height: 1.2;
}

.section-title > span {
    display: block;
    max-width: 680px;
    margin: 14px auto 0;
    color: var(--muted);
    font-size: 16px;
}

.product-landing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(220px, 1fr));
    gap: 18px;
}

.product-landing-card {
    position: relative;
    isolation: isolate;
    display: grid;
    min-height: 260px;
    overflow: hidden;
    align-content: end;
    gap: 16px;
    padding: 30px;
    color: #fff;
}

.product-landing-card-large {
    grid-row: span 2;
    min-height: 520px;
}

.product-landing-card::before {
    position: absolute;
    z-index: -2;
    inset: 0;
    content: "";
    background: var(--card-image) center / cover no-repeat;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.product-landing-card::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background:
        linear-gradient(90deg, rgba(3, 15, 25, 0.72), rgba(3, 15, 25, 0.16)),
        linear-gradient(0deg, rgba(3, 15, 25, 0.6), rgba(3, 15, 25, 0.08));
    transition: opacity 0.5s ease;
}

.product-landing-card:hover::before {
    transform: scale(1.055);
    filter: saturate(1.08);
}

.product-landing-card:hover::after {
    opacity: 0.62;
}

.product-landing-card small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.product-landing-card span {
    padding-left: 12px;
    border-left: 3px solid var(--primary);
    font-size: 24px;
    font-weight: 900;
}

.product-landing-card strong {
    max-width: 620px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 15px;
    line-height: 1.8;
}

.product-category-bar {
    display: grid;
    grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #e3e7ea;
    background: #fff;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 clamp(20px, 4vw, 72px);
    background: var(--primary);
    color: #fff;
}

.category-title img {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
}

.category-title h1 {
    margin: 0;
    font-size: clamp(22px, 2.8vw, 34px);
    line-height: 1.2;
    white-space: nowrap;
}

.product-filters {
    display: flex;
    min-width: 0;
    align-items: stretch;
    justify-content: flex-end;
    overflow-x: auto;
    padding-right: clamp(20px, 5vw, 72px);
}

.product-filter {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 84px;
    padding: 0 17px;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.product-filter::after {
    position: absolute;
    right: 16px;
    bottom: 0;
    left: 16px;
    height: 2px;
    content: "";
    background: transparent;
    transition: background 0.25s ease;
}

.product-filter:hover,
.product-filter.active {
    color: var(--accent-dark);
}

.product-filter.active::after,
.product-filter:hover::after {
    background: var(--primary);
}

.product-archive {
    width: var(--space-content-width);
    margin-inline: auto;
    padding: 72px 0;
}

.archive-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.archive-head p,
.archive-head h2 {
    margin: 0;
}

.archive-head p {
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.archive-head h2 {
    margin-top: 8px;
    color: var(--ink);
    font-size: 34px;
    line-height: 1.2;
}

.archive-head span {
    color: var(--muted);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 46px;
}

.product-card {
    display: grid;
    gap: 18px;
    align-content: start;
    padding: 20px;
    border-radius: 15px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.product-card-visual {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 15px;
    background: #edf3f5;
}

.product-card-visual::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1));
    opacity: 1;
    transition: opacity 0.5s ease;
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-card:hover .product-card-visual::after {
    opacity: 0;
}

.product-body {
    display: grid;
    justify-items: center;
    gap: 16px;
    text-align: center;
}

.product-body h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.3;
}

.product-title-link:hover {
    color: var(--accent-dark);
}

.product-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.product-link::after {
    content: "›";
    margin-left: 8px;
    font-size: 18px;
}

.product-link:hover {
    background: var(--primary-dark);
}

.product-pagination {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 34px;
}

.product-pagination button,
.product-pagination span {
    display: inline-flex;
    min-width: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-weight: 800;
}

.product-pagination button {
    cursor: pointer;
}

.product-pagination .current {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    color: var(--muted);
    text-align: center;
}

/* ========== Responsive ========== */
@media (max-width: 1100px) {
    .product-category-bar {
        grid-template-columns: 1fr;
    }

    .category-title {
        min-height: 86px;
        padding-right: 20px;
    }

    .product-filters {
        justify-content: flex-start;
        padding-left: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px;
    }

    .product-landing-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .product-landing-card-large {
        grid-row: auto;
        min-height: 320px;
    }
}

@media (max-width: 720px) {
    .archive-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-filter {
        min-height: 62px;
        padding-inline: 14px;
        font-size: 14px;
    }

    .product-archive {
        padding-top: 44px;
    }

    .product-landing {
        padding-top: 24px;
    }

    .product-landing-card,
    .product-landing-card-large {
        min-height: 240px;
        padding: 24px;
    }

    .product-landing-card span {
        font-size: 21px;
    }

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