/* WCI Product List Presentation 0.10.0 — ΜΟΝΟ για λίστες (κατάστημα / κατηγορίες / αναζήτηση).
   Το κοινό CSS (popup, φίλτρα, πεδία σελίδας προϊόντος) είναι στο wci-product-extras.css */

/* Hide the original Astra/WooCommerce product card.
   Keep only the custom WCI product row. */
.woocommerce ul.products li.product > :not(.wci-product-row) {
    display: none !important;
}
.woocommerce ul.products li.product {
    width: 100% !important;
    float: none !important;
    clear: both;
    margin: 0 0 6px !important;
    padding: 0 !important;
}

.woocommerce ul.products {
    display: block !important;
    margin: 0 !important;
}

.wci-product-row {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) minmax(150px, 190px);
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 76px;
    padding: 7px 10px;
    border: 1px solid #a6a6a6;
    border-radius: 5px;
    background: #fff;
    color: #222;
    text-align: left;
}

.wci-product-row__image {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

.wci-product-row__image a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.wci-product-row__image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    object-fit: contain;
    margin: 0 !important;
}

.wci-product-row__details {
    min-width: 0;
    line-height: 1.35;
}

.wci-product-row__heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 14px;
    row-gap: 2px;
    margin-bottom: 3px;
}

.wci-product-row__sku {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    color: #222;
}

.wci-product-row__title {
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    color: #171717;
    text-decoration: none;
}

.wci-product-row__title:hover {
    color: #247a24;
    text-decoration: underline;
}

.wci-product-row__oem {
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.4;
    color: #222;
}

.wci-product-row__oem > span:first-child {
    color: #222;
}

.wci-product-row__oem a {
    color: #0756a5;
    text-decoration: underline;
}

.wci-product-row__more {
    margin-left: 2px;
}

.wci-product-row__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 5px;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.35;
    color: #333;
}

.wci-product-row__models strong {
    color: #218322;
    text-decoration: underline;
}

.wci-product-row__brand::before,
.wci-product-row__type::before {
    content: "|";
    margin-right: 5px;
    color: #777;
}

.wci-product-row__purchase {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    grid-template-areas:
        "stock stock"
        "price add";
    align-items: center;
    justify-items: end;
    gap: 4px 8px;
}

.wci-product-row__stock {
    grid-area: stock;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}

.wci-product-row__price {
    grid-area: price;
    align-self: center;
    color: #188329;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.wci-product-row__price del {
    display: block;
    color: #888;
    font-size: 10px;
    font-weight: 400;
}

.wci-product-row__price ins {
    text-decoration: none;
}

.wci-product-row__add.button {
    grid-area: add;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 31px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    border-radius: 7px;
    background: #dce1d1;
    color: #222;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-shadow: none;
}

.wci-product-row__add.button:hover {
    background: #c9d2b8;
    color: #111;
}

@media (max-width: 767px) {
    .wci-product-row {
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 8px;
        padding: 8px;
    }

    .wci-product-row__image {
        width: 50px;
        height: 50px;
    }

    .wci-product-row__heading {
        display: block;
    }

    .wci-product-row__sku {
        display: inline-block;
        margin-right: 7px;
        font-size: 11px;
    }

    .wci-product-row__title {
        font-size: 13px;
    }

    .wci-product-row__purchase {
        grid-column: 2;
        grid-template-columns: minmax(0, 1fr) 34px;
        margin-top: 4px;
        width: 100%;
    }

    .wci-product-row__stock {
        justify-content: flex-start;
    }

    .wci-product-row__price {
        justify-self: start;
        text-align: left;
    }
}

@media (max-width: 380px) {
    .wci-product-row__oem,
    .wci-product-row__meta {
        font-size: 10px;
    }
}

/* Επισκέπτες: χωρίς τιμή, διαθεσιμότητα και καλάθι — η γραμμή δεν έχει δεξιά στήλη */
.wci-product-row.wci-product-row--no-purchase {
    grid-template-columns: 64px minmax(0, 1fr);
}

@media (max-width: 767px) {
    .wci-product-row.wci-product-row--no-purchase {
        grid-template-columns: 54px minmax(0, 1fr);
    }
}

/* ------------------------------------------------------------------
   0.7.0 — χωρίς τίτλο σελίδας + alert επιλεγμένου κατασκευαστή
   Χρώμα φόντου: το βασικό χρώμα του θέματος (Astra → --ast-global-color-0, block themes → --wp--preset--color--primary,
   Elementor, Kadence). Αλλαγή: --wci-alert-bg / --wci-alert-fg σε οποιονδήποτε κανόνα CSS.
   ------------------------------------------------------------------ */
body:not(.search) .woocommerce-products-header__title {
    display: none !important;
}

.wci-category-alert {
    margin: 0 0 14px;
    padding: 12px 18px;
    border-radius: 6px;
    background: var(--wci-alert-bg, var(--ast-global-color-0, var(--wp--preset--color--primary, var(--e-global-color-primary, var(--global-palette1, #0f766e)))));
    color: var(--wci-alert-fg, #fff);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    letter-spacing: normal;
    text-transform: none;
    overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------
   0.8.0 — διαχωριστικά κατηγορίας (ομαδοποίηση προϊόντων κατά κατηγορία)
   ------------------------------------------------------------------ */
.woocommerce ul.products li.wci-category-heading {
    width: 100% !important;
    float: none !important;
    clear: both;
    grid-column: 1 / -1;
    list-style: none;
    margin: 18px 0 8px !important;
    padding: 0 0 6px !important;
    background: none !important;
    border: 0 !important;
    border-bottom: 2px solid var(--wci-alert-bg, var(--ast-global-color-0, var(--wp--preset--color--primary, var(--e-global-color-primary, var(--global-palette1, #0f766e))))) !important;
    box-shadow: none !important;
}

.woocommerce ul.products li.wci-category-heading:first-child {
    margin-top: 0 !important;
}

.wci-category-heading__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: normal;
    text-transform: none;
}

/* ------------------------------------------------------------------
   0.10.0 — χωρίς επιλογή ταξινόμησης (η σειρά καθορίζεται από την ομαδοποίηση κατά κατηγορία)
   ------------------------------------------------------------------ */
body.wci-hide-sorting .woocommerce-ordering {
    display: none !important;
}
