/*
 * 2B Trade Child – WooCommerce kiegészítő stílusok
 * Betöltés: functions.php (csak ha WooCommerce aktív)
 */

/* Termék lista – 4 oszlopos grid finomhangolás */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.25rem !important;
    float: none !important;
}

.woocommerce ul.products.columns-4 li.product {
    width: 100% !important;
    margin: 0 !important;
}

@media (max-width: 900px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr !important;
    }
}

/* Termék kép – square ratio */
.woocommerce ul.products li.product .attachment-woocommerce_thumbnail,
.woocommerce ul.products li.product img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
}

/* Ajánlatkérés termékek – speciális stílus */
.woocommerce ul.products li.product.product-type-external .button,
.woocommerce ul.products li.product.requires-quote .button {
    background: transparent !important;
    color: var(--2bt-brand) !important;
    border: 1px solid var(--2bt-brand) !important;
}

.woocommerce ul.products li.product.requires-quote .button:hover {
    background: var(--2bt-brand) !important;
    color: #ffffff !important;
}

/* Üres kosár */
.woocommerce-cart .cart-empty,
.woocommerce .cart-empty {
    text-align: center;
    padding: 3rem;
    color: var(--2bt-text-muted);
    font-size: 16px;
}

/* Rendelés összesítő */
.woocommerce-checkout-review-order table.shop_table {
    border: 1px solid var(--2bt-border) !important;
    border-radius: var(--2bt-radius-md) !important;
    overflow: hidden;
}

.woocommerce table.shop_table th {
    background: var(--2bt-bg-sec);
    font-weight: 600;
    color: var(--2bt-text);
}

/* Account oldalak */
.woocommerce-account .woocommerce-MyAccount-navigation {
    background: var(--2bt-bg-sec);
    border: 1px solid var(--2bt-border);
    border-radius: var(--2bt-radius-lg);
    padding: 1.5rem;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    color: var(--2bt-text-muted) !important;
    font-size: 14px;
    padding: 0.4rem 0;
    display: block;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    color: var(--2bt-brand) !important;
    font-weight: 600;
}

/* Kosar / Penztar - "Futarszolgalat - Egyedi ajanlat" szallitasi mod
   (flat_rate:2 rate, csak Nagy csomagos termekeknel). A WooCommerce
   Blocks a 0 Ft-os szallitasi dijat mindig "Ingyenes"/"Free" felirattal
   jeleniti meg (ezt PHP-bol nem lehet felulirni, sajat React-komponens
   dontese), de ide ez felrevezeto lenne, hiszen a szallitas dija NEM
   ingyenes, csak meg nincs meghatarozva. A "for"/"value" attributumban
   szereplo egyedi rate-azonosito (flat_rate:2) alapjan elrejtjuk csak
   ennel az egy szallitasi modnal a masodlagos (ar) cimket - a Helyszini
   atvetel "Ingyenes" felirata tovabbra is lathato marad. */
label[for$="flat_rate:2"] .wc-block-components-radio-control__secondary-label,
li[aria-label*="flat_rate:2"] .wc-block-components-radio-control__secondary-label {
    display: none !important;
}

/* Ajanlatkeres (Request-a-Quote) urlap - kotelezo mezok jelolese
   csillaggal. A plugin csak egy halvany piros/zold szegellyel jelzi a
   kotelezo mezoket (input stilus), ami nem eleg feltuno - ezert a
   label/checkbox-szoveg vegere piros csillagot teszunk, ugyanugy mint a
   Penztarnal. A label MEGELOZI az inputot ebben az urlapban (forditva,
   mint a WooCommerce Blocks checkoutnal), ezert a ":has()" szelektorral
   nezunk elore a testver inputra/textareara. */
.addify-option-field:has(> input[required]) > label::after,
.addify-option-field:has(> textarea[required]) > label::after {
    content: " *";
    color: #d63638;
    font-weight: 700;
}
.addify-option-field.adf-term-conditon:has(> input[required]) > span::after {
    content: " *";
    color: #d63638;
    font-weight: 700;
}

/* =============================================================================
   PENZTAR (BLOCKS CHECKOUT) - KOTELEZO MEZOK JELOLESE CSILLAGGAL
   A WooCommerce Blokk checkout az input elem UTAN rakja a labelt a DOM-ba,
   ezert a "+" kozvetlen testver szelektor mukodik. Csak a kotelezo (required)
   mezoknel jelenik meg a piros csillag, az opcionalis mezok mar amugy is
   "(opcionalis)"/"(optional)" szoveget kapnak a labeljukbe. */
.wc-block-components-text-input input[required] + label::after,
.wc-block-components-textarea input[required] + label::after {
    content: " *";
    color: #d63638;
    font-weight: 700;
}
