.product-main {
    padding-top: 118px;
}

.product-hero {
    display: block;
    max-width: 760px;
    margin-bottom: 42px;
}

.product-hero h1 {
    margin-top: 10px;
    color: var(--ink);
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.08;
    font-weight: 800;
}

.product-hero p:not(.eyebrow) {
    max-width: 640px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.85;
}

.product-toolbar {
    position: sticky;
    top: 82px;
    z-index: 20;
    display: flex;
    justify-content: flex-start;
    gap: 18px;
    align-items: center;
    padding: 18px;
    margin-bottom: 28px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(520px, 100%);
    min-width: 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--muted);
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 95, 191, 0.10);
}

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

.product-card {
    display: grid;
    grid-template-rows: 248px 1fr;
    overflow: hidden;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid rgba(216, 222, 232, 0.96);
    box-shadow: none;
    cursor: pointer;
    touch-action: manipulation;
    position: relative;
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s ease, border-color 0.28s ease;
}

.product-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        135deg,
        transparent 40%,
        rgba(31, 95, 191, 0.04) 45%,
        rgba(31, 95, 191, 0.08) 50%,
        rgba(31, 95, 191, 0.04) 55%,
        transparent 60%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: rgba(31, 95, 191, 0.30);
    box-shadow: 0 20px 48px rgba(16, 34, 58, 0.12);
}

.product-card:hover::before {
    transform: translateX(40%);
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.18)),
        linear-gradient(180deg, #f8fafc, #eef3f8);
    transition: transform 0.32s var(--ease-out);
}

.product-card:hover img {
    transform: scale(1.03);
}

.product-card div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 24px 24px;
}

.product-card h2 {
    width: 100%;
    margin: 0;
    color: var(--ink);
    font-size: 19px;
    line-height: 1.28;
    font-weight: 760;
    overflow-wrap: anywhere;
}

.product-card button {
    margin-top: 18px;
    padding: 0;
    border: 0;
    color: var(--primary);
    background: transparent;
    font-weight: 760;
    cursor: pointer;
}

.product-card button:focus-visible,
.close-modal:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.product-empty {
    display: none;
    padding: 36px;
    margin-top: 20px;
    text-align: center;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.product-empty.active {
    display: block;
}

.modal {
    display: grid;
    position: fixed;
    inset: 0;
    z-index: 2000;
    place-items: center;
    padding: 28px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 17, 31, 0.68);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    z-index: 1;
    width: min(1120px, 96vw);
    max-height: 88vh;
    overflow: auto;
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 30px 90px rgba(0,0,0,0.30);
    transform: scale(0.97);
    transition: transform 0.25s var(--ease-out);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 20px 26px;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
}

.modal-header h2 {
    color: var(--ink);
    font-size: 24px;
    line-height: 1.25;
}

.close-modal {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--bg);
    cursor: pointer;
    color: var(--ink);
    font-size: 26px;
    line-height: 1;
}

.modal-body {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
    gap: 22px;
    padding: 24px;
    background: linear-gradient(180deg, #fff, #f7f9fc);
}

.modal-body img {
    width: 100%;
    max-height: 68vh;
    object-fit: contain;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--soft-shadow);
    border: 1px solid rgba(216, 222, 232, 0.9);
}

@media (max-width: 980px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .product-hero {
        text-align: left;
    }

    .product-hero p:not(.eyebrow) {
        margin-left: auto;
        margin-right: auto;
    }

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

    .product-toolbar {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }
}

@media (max-width: 620px) {
    .product-main {
        padding-top: 96px;
    }

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

    .product-card {
        grid-template-rows: 230px 1fr;
    }

    .modal {
        padding: 14px;
    }

    .modal-body {
        padding: 16px;
    }
}
