/* Stage 2 — internal pages REFRESH, Concept 02 v2, batch 04. */

/* Category index. */
.th-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.th-category-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--th-line);
    border-radius: 17px;
    box-shadow: var(--th-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.th-category-card:hover {
    transform: translateY(-3px);
    border-color: rgba(243, 148, 48, .42);
    box-shadow: var(--th-shadow-md);
}

.th-category-image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1.4 / 1;
    padding: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);
}

.th-category-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .25s ease;
}

.th-category-card:hover .th-category-image img {
    transform: scale(1.035);
}

.th-category-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
    border-top: 1px solid var(--th-line);
}

.th-category-copy h2 {
    margin: 0 0 12px;
    color: var(--th-ink);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
}

.th-category-copy h2 a {
    color: inherit;
    text-decoration: none;
}

.th-category-sublinks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.th-category-sublinks a {
    color: var(--th-muted);
    font-size: 13px;
    line-height: 1.35;
    text-decoration: none;
}

.th-category-sublinks a:hover {
    color: var(--th-orange-hover);
}

.th-category-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    margin-top: auto;
    padding: 10px 13px;
    color: var(--th-ink);
    background: var(--th-orange-soft);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
}

.th-category-cta span:last-child {
    color: var(--th-orange-hover);
    font-size: 18px;
}

/* Catalog toolbar. */
.th-catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--th-line);
    border-radius: 14px;
    box-shadow: var(--th-shadow-sm);
}

.th-catalog-toolbar label {
    margin: 0;
    color: var(--th-muted);
    font-size: 13px;
    font-weight: 400;
}

.th-catalog-toolbar select {
    min-width: 250px;
    min-height: 44px;
    padding: 9px 38px 9px 12px;
    color: var(--th-ink);
    background-color: #FBFCFD;
    border: 1px solid #DDE1E7;
    border-radius: 10px;
    font: 400 14px/1.3 "Segoe UI", Arial, sans-serif;
}

.th-catalog-toolbar select:focus {
    border-color: var(--th-orange);
    box-shadow: 0 0 0 3px rgba(243, 148, 48, .14);
}

/* Product grid and cards. */
.th-catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.th-catalog-product {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--th-line);
    border-radius: 16px;
    box-shadow: var(--th-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.th-catalog-product:hover {
    transform: translateY(-3px);
    border-color: rgba(243, 148, 48, .42);
    box-shadow: var(--th-shadow-md);
}

.th-catalog-product-image {
    display: block;
    width: 100%;
    height: 230px;
    background-color: #fff;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    border-bottom: 1px solid var(--th-line);
    transition: transform .25s ease;
}

.th-catalog-product:hover .th-catalog-product-image {
    transform: scale(1.018);
}

.th-catalog-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: flex;
    gap: 6px;
}

.th-catalog-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 5px 8px;
    color: #fff;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.th-catalog-badge--promo {
    background: var(--th-orange);
}

.th-catalog-badge--new {
    background: #6BAFE0;
}

.th-catalog-product-data {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 16px;
}

.th-catalog-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    min-height: 28px;
    margin-bottom: 10px;
    text-align: center;
}

.th-catalog-price-current {
    color: var(--th-orange-hover);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
}

.th-catalog-price-old {
    color: #7B8491;
    font-size: 13px;
    font-weight: 400;
    text-decoration: line-through;
}

.th-catalog-stock {
    min-height: 28px;
    margin-bottom: 10px;
    color: #9A332B;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
}

.th-catalog-product-name {
    display: -webkit-box;
    min-height: 60px;
    margin: 0 0 13px;
    overflow: hidden;
    color: var(--th-ink);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42;
    text-align: center;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.th-catalog-product-name a {
    color: inherit;
    font-weight: 400;
    text-decoration: none;
}

.th-catalog-product-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 43px;
    margin-top: auto;
    padding: 10px 12px;
    color: #fff;
    background: var(--th-orange);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 400;
    text-decoration: none;
    transition: background-color .2s ease;
}

.th-catalog-product-cta:hover {
    color: #fff;
    background: var(--th-orange-hover);
}

.th-catalog-pagination {
    margin-top: 26px;
    text-align: center;
}

.th-catalog-pagination .pagination {
    justify-content: center;
}

@media (max-width: 1120px) {
    .th-category-grid,
    .th-catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .th-category-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .th-category-card {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        border-radius: 14px;
    }

    .th-category-image {
        aspect-ratio: auto;
        min-height: 142px;
        padding: 10px;
        border-right: 1px solid var(--th-line);
    }

    .th-category-copy {
        padding: 14px;
        border-top: 0;
    }

    .th-category-copy h2 {
        margin-bottom: 8px;
        font-size: 16px;
    }

    .th-category-sublinks {
        gap: 3px;
        margin-bottom: 10px;
    }

    .th-category-sublinks a {
        font-size: 11px;
    }

    .th-category-cta {
        min-height: 36px;
        padding: 7px 10px;
        font-size: 11px;
    }

    .th-catalog-toolbar {
        justify-content: space-between;
        padding: 11px 12px;
    }

    .th-catalog-toolbar select {
        width: min(100%, 220px);
        min-width: 0;
        min-height: 42px;
        font-size: 12px;
    }

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

    .th-catalog-product {
        border-radius: 13px;
    }

    .th-catalog-product-image {
        height: 150px;
    }

    .th-catalog-badges {
        top: 8px;
        left: 8px;
        gap: 4px;
    }

    .th-catalog-badge {
        min-height: 21px;
        padding: 4px 6px;
        border-radius: 5px;
        font-size: 8px;
    }

    .th-catalog-product-data {
        padding: 11px;
    }

    .th-catalog-price {
        flex-wrap: wrap;
        gap: 3px 6px;
        min-height: 38px;
        margin-bottom: 7px;
    }

    .th-catalog-price-current {
        width: 100%;
        font-size: 16px;
    }

    .th-catalog-price-old {
        font-size: 11px;
    }

    .th-catalog-product-name {
        min-height: 55px;
        margin-bottom: 10px;
        font-size: 12px;
        line-height: 1.48;
    }

    .th-catalog-product-cta {
        min-height: 39px;
        padding: 8px;
        font-size: 10px;
    }
}

@media (max-width: 355px) {
    .th-catalog-grid {
        gap: 8px;
    }

    .th-catalog-product-image {
        height: 138px;
    }

    .th-catalog-product-data {
        padding: 9px;
    }
}
