/**
 * Valpet — product catalog pages (product page, /produse/, categories).
 * Loaded only on those pages (inc/product-catalog.php), after Storefront's WooCommerce CSS
 * and the child style.css, whose :root tokens it uses.
 */

/* ============================================
   Product page — gallery left, summary right, sections below (full width, no sidebar)
   ============================================ */
.single-product div.product {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 3rem;
    align-items: start;
}

.single-product div.product > * {
    grid-column: 1 / -1;
}

.single-product div.product > .woocommerce-product-gallery {
    grid-column: 1;
}

.single-product div.product > .summary {
    grid-column: 2;
}

.single-product div.product .woocommerce-product-gallery,
.single-product div.product .images,
.storefront-full-width-content.single-product div.product .images,
.storefront-full-width-content.single-product div.product .summary,
.single-product div.product .summary {
    width: auto;
    float: none;
    margin: 0 0 2rem;
}

.single-product div.product .woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
}

.single-product div.product .woocommerce-product-gallery img {
    border-radius: var(--vp-radius-lg);
    background: var(--vp-pearl);
}

.single-product div.product .flex-control-thumbs li img {
    border-radius: var(--vp-radius);
}

@media (max-width: 767px) {
    .single-product div.product {
        display: block;
    }
}

/* Summary */
.vp-product-cat {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.vp-product-cat a {
    color: var(--vp-primary-dark);
    text-decoration: none;
}

.single-product div.product .summary .price {
    margin: 0 0 1rem;
}

.single-product div.product .woocommerce-product-details__short-description {
    color: var(--vp-slate);
    margin-bottom: 1.5rem;
}

/* ============================================
   Choices — colour samples, thickness, grain size
   ============================================ */
.variations_form:not(.vp-has-choices) .vp-choices {
    display: none;
}

/* Prefixed to beat Storefront's `.single-product div.product table.variations th/td` (list-item). */
.single-product div.product .vp-has-choices table.variations,
.single-product div.product .vp-has-choices table.variations tbody,
.single-product div.product .vp-has-choices table.variations tr,
.single-product div.product .vp-has-choices table.variations td {
    display: block;
    padding: 0;
    border: 0;
    background: none;
}

.vp-has-choices table.variations {
    margin: 0 0 0.5rem;
}

.single-product div.product .vp-has-choices table.variations th.label,
.single-product div.product .vp-has-choices table.variations select {
    display: none;
}

.vp-choices,
.vp-colour-single {
    border: 0;
    margin: 0 0 1.25rem;
    padding: 0;
    background: none;
}

.vp-choices__legend {
    display: block;
    padding: 0;
    margin: 0 0 0.6rem;
    font-weight: 600;
    color: var(--vp-obsidian);
}

.vp-choices__current {
    font-weight: 400;
    color: var(--vp-slate);
}

.vp-choices__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.vp-choice {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0.35rem;
    border: 2px solid var(--vp-silver);
    border-radius: var(--vp-radius);
    background: #ffffff;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.2;
    transition: var(--vp-transition);
}

.vp-choice--text {
    flex-direction: row;
    padding: 0.55rem 1rem;
    font-weight: 500;
}

.vp-choice:hover {
    border-color: var(--vp-primary-light);
}

.vp-choice__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.vp-choice:has(.vp-choice__input:checked) {
    border-color: var(--vp-primary);
    background: rgba(212, 160, 23, 0.08);
    box-shadow: 0 0 0 1px var(--vp-primary);
}

.vp-choice:has(.vp-choice__input:focus-visible) {
    outline: 3px solid var(--vp-secondary);
    outline-offset: 2px;
}

.vp-choice.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.vp-choice.is-static {
    cursor: default;
}

.vp-choice__swatch {
    display: block;
    width: 72px;
    height: 52px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--vp-pearl);
}

.vp-choice__swatch img.vp-choice__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vp-choice--swatch .vp-choice__name {
    padding: 0 0.15rem 0.1rem;
}

.single-product div.product form.cart .reset_variations {
    display: inline-block;
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--vp-text-secondary);
}

.single-product div.product .woocommerce-variation-description p {
    margin: 0 0 1rem;
    color: var(--vp-slate);
}

/* Quantity + unit + "Adaugă la comandă" + wishlist on one row. Flex also neutralises the
   float that quote mode gives the unit label. */
.single-product div.product .woocommerce-variation-add-to-cart,
.single-product div.product form.cart:not(.variations_form) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.single-product div.product form.cart .quantity,
.single-product div.product form.cart .vp-qty-unit {
    margin: 0;
}

.single-product div.product form.cart .quantity .qty {
    width: 5.5em;
}

.single-product div.product form.cart .single_add_to_cart_button {
    margin: 0;
}

.single-product div.product form.cart .yith-wcwl-add-to-wishlist {
    margin: 0;
    font-size: 0.85rem;
}

/* ============================================
   Badges — "Produs destinat pentru" and the properties
   ============================================ */
.vp-usage {
    margin: 1.75rem 0 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--vp-silver);
}

.vp-usage__title {
    margin: 0 0 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--vp-text-secondary);
}

.vp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.vp-badges--usage .vp-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 5.75rem;
    gap: 0.4rem;
    font-size: 0.8rem;
    line-height: 1.25;
    text-align: center;
}

.vp-badges--usage .vp-badge svg {
    box-sizing: content-box;
    padding: 0.7rem;
    border-radius: 50%;
    background: var(--vp-pearl);
    color: var(--vp-secondary);
}

.vp-badges--properties {
    margin-top: 1.25rem;
}

.vp-badges--properties .vp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem 0.4rem 0.5rem;
    border-radius: 999px;
    background: var(--vp-pearl);
    font-size: 0.85rem;
}

.vp-badges--properties .vp-badge svg {
    width: 20px;
    height: 20px;
    color: var(--vp-primary-dark);
}

.vp-badge--text {
    padding-left: 0.8rem;
}

/* Catalog PDF link */
.vp-catalog-link-wrap {
    margin: 0 0 1rem;
}

.vp-catalog-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: var(--vp-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.vp-catalog-link::before {
    content: "↓";
    font-weight: 700;
    color: var(--vp-primary-dark);
}

.vp-catalog-link span {
    font-weight: 400;
    color: var(--vp-text-secondary);
}

/* ============================================
   Sections below the gallery
   ============================================ */
.vp-product-sections {
    margin: 1rem 0 3rem;
}

.vp-product-sections__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 2rem 3rem;
}

.vp-product-section {
    margin: 0 0 2rem;
}

.vp-product-section h2,
.vp-warranty h2,
.single-product section.related > h2,
.storefront-full-width-content .related.products > h2:first-child {
    position: relative;
    text-align: left;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    font-size: 1.3rem;
}

.vp-product-section h2::after,
.single-product section.related > h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 2.5rem;
    height: 3px;
    border-radius: 2px;
    background: var(--vp-primary);
}

.vp-product-section p {
    color: var(--vp-slate);
}

.vp-checklist {
    margin: 0;
    padding: 0;
    list-style: none;
}

.vp-checklist li {
    position: relative;
    padding: 0.3rem 0 0.3rem 1.75rem;
    color: var(--vp-slate);
}

.vp-checklist li::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 0.75em;
    width: 0.8rem;
    height: 0.45rem;
    border-left: 2px solid var(--vp-primary-dark);
    border-bottom: 2px solid var(--vp-primary-dark);
    transform: rotate(-45deg);
}

/* Specification table */
.vp-spec-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.vp-spec-table th,
.vp-spec-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--vp-silver);
    background: none;
    text-align: left;
    vertical-align: top;
}

.vp-spec-table th {
    width: 45%;
    font-weight: 500;
    color: var(--vp-text-secondary);
}

.vp-spec-table td {
    font-weight: 500;
    color: var(--vp-obsidian);
}

.vp-spec-table--cols td {
    text-align: center;
}

.vp-spec-table__head th,
.vp-spec-table__head td {
    background: var(--vp-pearl);
    font-weight: 700;
    color: var(--vp-obsidian);
}

.vp-spec-table td.is-selected {
    background: rgba(212, 160, 23, 0.14);
    font-weight: 700;
}

/* Warranty band */
.vp-warranty {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 0 0 1rem;
    padding: 1.5rem 2rem;
    border-radius: var(--vp-radius-lg);
    background: var(--vp-obsidian);
    color: #ffffff;
}

.vp-warranty h2 {
    margin: 0 0 0.35rem;
    padding: 0;
    color: #ffffff;
}

.vp-warranty p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

.vp-warranty__badge {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: var(--vp-primary);
    color: var(--vp-obsidian);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.vp-warranty__badge span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

@media (max-width: 480px) {
    .vp-warranty {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }
}

/* ============================================
   /produse/ and category pages
   ============================================ */
/* Same specificity as Storefront's full-width rule (centred, 4em bottom padding), loaded later. */
.storefront-full-width-content .woocommerce-products-header {
    margin: 1.5rem 0 2rem;
    padding: 0;
    text-align: left;
}

.woocommerce-products-header .page-description,
.woocommerce-products-header .term-description {
    max-width: 52rem;
    color: var(--vp-slate);
    font-size: 1.05rem;
}

.vp-archive-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 0;
}

.vp-cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vp-cat-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--vp-silver);
    border-radius: 999px;
    background: #ffffff;
    color: var(--vp-obsidian);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--vp-transition);
}

.vp-cat-nav a:hover {
    border-color: var(--vp-primary);
}

.vp-cat-nav a.is-current {
    border-color: var(--vp-primary);
    background: var(--vp-primary);
    color: var(--vp-obsidian);
    font-weight: 600;
}

.vp-cat-nav__count {
    font-size: 0.75rem;
    color: var(--vp-text-secondary);
}

.vp-cat-nav a.is-current .vp-cat-nav__count {
    color: var(--vp-obsidian);
}

/* Tiles */
.woocommerce ul.products li.product {
    text-align: left;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    justify-content: flex-start;
    min-height: 0;
    font-size: 1.05rem;
}

.vp-tile-cat {
    display: block;
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--vp-primary-dark);
}

.vp-tile-facts {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0.2rem 0 1rem;
    font-size: 0.85rem;
    color: var(--vp-text-secondary);
}

.vp-tile-colours {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.vp-dots {
    display: inline-flex;
}

.vp-dot {
    width: 16px;
    height: 16px;
    margin-right: -4px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: var(--vp-silver) center / cover no-repeat;
    box-shadow: 0 0 0 1px var(--vp-silver);
}

.woocommerce ul.products li.product .button.vp-tile-button {
    background: transparent;
    border: 2px solid var(--vp-primary);
    color: var(--vp-obsidian);
    padding: 0.6rem 1rem;
    text-align: center;
}

.woocommerce ul.products li.product .button.vp-tile-button:hover {
    background: var(--vp-primary);
    color: var(--vp-obsidian);
    box-shadow: none;
}

.woocommerce ul.products li.product .yith-wcwl-add-to-wishlist {
    text-align: center;
}
