.products-banner {}

.products-main {
    background: #f4f6f8;
}

.products-layout {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 34px;
}

.category-nav {
    position: sticky;
    top: 92px;
    align-self: start;
}

.category-nav ul {
    list-style: none;
    border-left: 1px dashed #d6dde3;
    padding-left: 16px;
}

.category-nav li {
    margin-bottom: 6px;
}

.category-nav a {
    display: block;
    padding: 10px 12px;
    color: var(--text-muted);
    border-left: 2px solid transparent;
    margin-left: -18px;
    font-size: 14px;
}

.category-nav a.active,
.category-nav a:hover {
    color: var(--primary);
    border-left-color: var(--primary);
}

.category-nav .category-title {
    color: var(--primary);
    font-weight: 600;
}

.products-content section {
    margin-bottom: 38px;
    scroll-margin-top: 128px;
}

.products-content h2 {
    font-size: 24px;
    margin-bottom: 18px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.product-card {
    background: #fff;
    border: 1px solid #e8edf1;
    padding: 16px;
    text-align: center;
    transition: .2s;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(15, 41, 53, 0.08);
}

.product-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.product-card .tags {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 12px;
    min-height: 18px;
}

.product-card .tags span + span {
    margin-left: 8px;
}

.product-image {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f6f9fa;
    border: 1px solid #edf1f4;
    overflow: hidden;
    margin-bottom: 12px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    font-size: 12px;
    color: var(--text-light);
    border: 1px solid #dfe6eb;
    padding: 7px 16px;
    border-radius: 2px;
    transition: color .2s, border-color .2s, background-color .2s;
}

.btn-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: #f7fffd;
}

body.product-modal-open {
    overflow: hidden;
}

.product-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
}

.product-detail-modal.is-open {
    display: block;
}

.product-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
}

.product-detail-dialog {
    position: relative;
    width: min(1120px, calc(100% - 72px));
    margin: 50px auto;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 22px 60px rgba(15, 27, 45, 0.22);
    padding: 26px 34px 34px;
}

.product-detail-head {
    padding-bottom: 20px;
}

.product-detail-head h2 {
    text-align: center;
    font-size: 28px;
    font-weight: 500;
    color: #1e2732;
    letter-spacing: 2px;
}

.product-detail-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #f2f5f7;
    color: #6f7b86;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.product-detail-close:hover {
    background: #e7edf2;
    color: #1f2a35;
}

.product-detail-nav {
    position: absolute;
    top: 50%;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(15, 27, 45, 0.18);
    color: #5f6975;
    font-size: 34px;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
}

.product-detail-nav.prev {
    left: -26px;
}

.product-detail-nav.next {
    right: -26px;
}

.product-detail-nav:hover {
    color: var(--primary);
}

.product-detail-nav:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.product-detail-body {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    gap: 28px;
    align-items: stretch;
}

.product-detail-media {
    min-height: 470px;
    border: 1px solid #e7edf1;
    background: linear-gradient(180deg, #f8fbfc 0%, #eff4f7 100%);
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail-media img {
    display: block;
    width: 100%;
    max-height: 410px;
    object-fit: contain;
}

.product-detail-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: #f5f7f9;
    border: 1px solid #e1e7ec;
    padding: 18px 20px;
}

.product-detail-specs {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.product-detail-specs tr + tr {
    border-top: 1px solid #eef2f5;
}

.product-detail-specs th,
.product-detail-specs td {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    vertical-align: top;
}

.product-detail-specs th {
    width: 148px;
    background: #fbfcfd;
    color: #5a6570;
    font-weight: 500;
    text-align: left;
}

.product-detail-specs td {
    color: #28313a;
    word-break: break-word;
}

.product-detail-features {
    background: #ffffff;
    border: 1px solid #e8edf1;
    padding: 16px 18px;
}

.product-detail-features h3 {
    font-size: 15px;
    color: #1f2a35;
    margin-bottom: 10px;
}

.product-detail-features ul {
    list-style: none;
}

.product-detail-features li {
    position: relative;
    padding-left: 14px;
    font-size: 13px;
    color: #5d6874;
}

.product-detail-features li + li {
    margin-top: 8px;
}

.product-detail-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--primary);
}

@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 1fr;
    }

    .category-nav {
        position: static;
    }

    .category-nav ul {
        border-left: 0;
        border-bottom: 1px dashed #d6dde3;
        padding-left: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding-bottom: 10px;
    }

    .category-nav a {
        margin-left: 0;
        border-left: 0;
        border-bottom: 2px solid transparent;
    }

    .category-nav a.active,
    .category-nav a:hover {
        border-bottom-color: var(--primary);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-detail-dialog {
        width: min(980px, calc(100% - 36px));
        margin: 34px auto;
        padding: 22px 22px 24px;
    }

    .product-detail-nav.prev {
        left: 12px;
    }

    .product-detail-nav.next {
        right: 12px;
    }

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

    .product-detail-media {
        min-height: 360px;
    }
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-detail-dialog {
        width: calc(100% - 20px);
        margin: 14px auto;
        padding: 18px 14px 16px;
    }

    .product-detail-head {
        padding: 10px 32px 16px;
    }

    .product-detail-head h2 {
        font-size: 22px;
        letter-spacing: 1px;
    }

    .product-detail-nav {
        top: auto;
        bottom: 16px;
        transform: none;
        width: 42px;
        height: 42px;
        font-size: 26px;
        z-index: 2;
    }

    .product-detail-nav.prev {
        left: 14px;
    }

    .product-detail-nav.next {
        right: 14px;
    }

    .product-detail-media {
        min-height: 240px;
        padding: 16px;
    }

    .product-detail-panel {
        padding: 12px;
        margin-bottom: 44px;
    }

    .product-detail-specs th,
    .product-detail-specs td {
        display: block;
        width: 100%;
        padding: 10px 12px;
    }

    .product-detail-specs th {
        border-bottom: 1px solid #eef2f5;
    }
}
