.product-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.containers-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.containers-sidebar {
    padding: 20px;
    position: sticky;
    top: 88px;
}

.containers-sidebar h2 {
    margin: 0 0 10px;
}

.containers-content {
    min-width: 0;
}

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

.size-filter {
    display: inline-flex;
    gap: 10px;
    margin: 0 0 36px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
}

.size-filter__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.size-filter__btn:hover {
    background: #eef2ff;
    color: var(--primary);
}

.size-filter__btn.is-active {
    background: var(--primary);
    color: #fff;
}

.size-filter-empty {
    margin-top: 14px;
}

.size-filter--sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
}

.size-filter--sidebar .size-filter__btn {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    min-height: 42px;
}

.product-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    height: 100%;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
    will-change: transform;
    animation: catalog-card-fade-in 0.55s ease both;
}

.product-card__media {
    width: 100%;
    min-height: 180px;
    aspect-ratio: 16 / 10;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #e5ebf8, #edf2fb);
}

.product-card__media img {
    width: auto;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0 auto;
    object-fit: contain;
    display: block;
    border-radius: 10px;
    transition: transform 0.45s ease;
}

.product-card__body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.product-grid.product-grid--catalog .product-card__body h2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
    line-height: 1.34;
}

.product-grid.product-grid--catalog .product-card__body .button {
    margin-top: auto;
    width: 100%;
}

.product-grid.product-grid--catalog .product-card:nth-child(2) {
    animation-delay: 0.08s;
}

.product-grid.product-grid--catalog .product-card:nth-child(3) {
    animation-delay: 0.14s;
}

.product-grid.product-grid--catalog .product-card:nth-child(4) {
    animation-delay: 0.2s;
}

.product-grid.product-grid--catalog .product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
    border-color: rgba(37, 99, 235, 0.28);
}

.product-grid.product-grid--catalog .product-card:hover .product-card__media img {
    transform: scale(1.04);
}

@keyframes catalog-card-fade-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.price-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
}

.product-detail {
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
}

.gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: detail-panel-in 0.5s ease both;
}

.gallery-card {
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fbff, #ffffff);
    border-color: #d7e2f1;
}

.product-gallery-main {
    background: linear-gradient(180deg, #e5ebf8, #edf2fb);
    border-radius: 14px;
    min-height: 360px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #d7e2f1;
    position: relative;
}

.product-gallery-main img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(560px, 72vh);
    object-fit: contain;
    display: block;
    border-radius: 10px;
    transition: transform 0.45s ease, opacity 0.24s ease;
}

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

.product-gallery-main.is-switching img {
    opacity: 0.45;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.spec-table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.product-gallery-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.product-gallery-thumbs .thumb {
    border: 2px solid transparent;
    background: #fff;
    padding: 2px;
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-gallery-thumbs .thumb:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.38);
}

.product-gallery-thumbs .thumb.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.product-gallery-thumbs img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #d7e2f1;
    background: linear-gradient(180deg, #e5ebf8, #edf2fb);
}

.product-purchase {
    padding: 10px 6px;
    animation: detail-panel-in 0.6s ease both;
}

.product-purchase .tag {
    margin-bottom: 10px;
}

.product-purchase h1 {
    margin-bottom: 6px;
}

.price-box,
.zip-widget,
.add-cart {
    margin-top: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.price-value {
    font-size: 1.7rem;
    line-height: 1.2;
    font-weight: 800;
    margin: 4px 0 2px;
}

.toggle {
    display: flex;
    gap: 8px;
}

.toggle-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 10px;
}

.toggle-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.zip-widget button,
.add-cart button {
    margin-top: 8px;
}

@keyframes detail-panel-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .containers-sidebar {
        position: static;
    }

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

    .product-gallery-main {
        min-height: 280px;
    }

    .product-gallery-main img {
        max-height: min(420px, 62vh);
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-grid.product-grid--catalog .product-card {
        animation: none;
        transition: none;
    }

    .product-grid.product-grid--catalog .product-card .product-card__media img {
        transition: none;
        transform: none;
    }

    .gallery-wrapper,
    .product-purchase {
        animation: none;
    }

    .product-gallery-main:hover img {
        transform: none;
    }
}
