/* ==========================================
   ARCHIVE.CSS - A-ART.GR (ΚΑΤΑΛΟΓΟΣ ΠΡΟΪΟΝΤΩΝ)
   Στόχος: B2B Απόλυτη συμμετρία, καθαρότητα & ταχύτητα
   ========================================== */

/* ==========================================
   1. ΕΠΙΚΕΦΑΛΙΔΑ, ΦΙΛΤΡΑ & BREADCRUMBS
   ========================================== */
.woocommerce-products-header {
    text-align: left;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.woocommerce-breadcrumb {
    font-size: 0.85rem;
    color: var(--secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.woocommerce-breadcrumb a { color: var(--secondary); opacity: 0.8; }
.woocommerce-breadcrumb a:hover { color: var(--accent); opacity: 1; }

.woocommerce-products-header__title {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--primary);
    margin: 0;
}

.woocommerce-notices-wrapper + .woocommerce-result-count,
.woocommerce-result-count {
    float: left;
    font-size: 0.95rem;
    color: var(--secondary);
    margin-top: 10px;
}

.woocommerce-ordering {
    float: right;
    margin-bottom: 30px;
}

.woocommerce-ordering select {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: #fff;
    color: var(--primary);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    min-width: 220px;
}

.woocommerce-ordering::after, .woocommerce-products-header::after {
    content: ""; display: table; clear: both;
}

/* ==========================================
   2. ΑΠΟΛΥΤΟ GRID (4 ΣΤΗΛΕΣ & ΚΕΝΑ) - BULLETPROOF
   ========================================== */
body.woocommerce ul.products,
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    margin: 40px 0 !important;
    padding: 0 !important;
    width: 100% !important;
    list-style: none !important;
}

body.woocommerce ul.products::before,
body.woocommerce ul.products::after {
    display: none !important;
}

/* ==========================================
   3. Η ΚΑΡΤΑ ΤΟΥ ΠΡΟΪΟΝΤΟΣ (ΑΠΟΛΥΤΗ ΣΤΟΙΧΙΣΗ)
   ========================================== */
body.woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important; 
    max-width: 100% !important;
    margin: 0 !important; 
    padding: 25px 20px !important;
    background: #fff !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-sizing: border-box !important;
    float: none !important; 
    clear: none !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

body.woocommerce ul.products li.product:hover {
    transform: translateY(-5px) !important;
    box-shadow: var(--shadow-hover) !important;
    border-color: #d1d5db !important;
}

/* Εικόνα Προϊόντος */
body.woocommerce ul.products li.product a img {
    width: 100% !important;
    height: 240px !important;
    object-fit: contain !important;
    margin: 0 auto 20px auto !important;
    display: block !important;
}

/* Τίτλος (Ζυγισμένος στις 2 γραμμές) */
body.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1.05rem !important;
    font-weight: 400 !important;
    color: var(--primary) !important;
    line-height: 1.4 !important;
    margin: 0 0 10px 0 !important;
    text-align: center !important;
    min-height: 2.8em !important; 
    max-height: 2.8em !important;
    overflow: hidden !important;
}

/* SKU */
.b2b-loop-sku {
    display: block !important;
    font-size: 0.8rem !important;
    color: #6b7280 !important;
    margin-bottom: 8px !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

/* Απόθεμα */
.b2b-stock {
    display: block !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    margin-bottom: 15px !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}
.b2b-stock.in-stock { color: var(--success) !important; }
.b2b-stock.out-of-stock { color: #c00d6d !important; }

/* Τιμή */
body.woocommerce ul.products li.product .price {
    font-size: 1.25rem !important;
    font-weight: 500 !important;
    color: var(--secondary) !important;
    margin-bottom: 25px !important;
    text-align: center !important;
    display: block !important;
}
/* Σήμανση B2B κάτω από την τιμή */
body.woocommerce ul.products li.product .price::after {
    content: " ΧΟΝΔΡΙΚΗ ΠΡΟ ΦΠΑ";
    display: block;
    font-size: 0.65rem;
    color: var(--secondary);
    font-weight: 400;
    margin-top: 3px;
    letter-spacing: 0.05em;
}

/* ==========================================
   4. B2B ACTIONS: ΠΟΣΟΤΗΤΑ, ΜΑΤΑΚΙ & ΚΑΛΑΘΙ
   ========================================== */

/* Το κεντρικό Wrapper οργανώνει τα στοιχεία σε 2 γραμμές (στήλη) */
.b2b-add-to-cart-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important; 
    width: 100% !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
}

/* Η πάνω γραμμή: Ποσότητα (Αριστερά) + Ματάκι (Δεξιά) */
.b2b-actions-top-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
}

/* Εξαφάνιση βελών browser στο input */
.b2b-qty-input::-webkit-outer-spin-button,
.b2b-qty-input::-webkit-inner-spin-button { -webkit-appearance: none !important; margin: 0 !important; }
.b2b-qty-input[type=number] { -moz-appearance: textfield !important; }

/* Το μοντέρνο κουτί ποσότητας (+/-) */
.b2b-qty-modern {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    height: 42px !important;
    background: #fff !important;
    width: 100px !important;
    flex-grow: 1 !important;
    flex-shrink: 0 !important;
}
/* Κουμπιά + και - */
.b2b-qty-btn {
    background: var(--bg-alt) !important;
    border: none !important;
    color: var(--secondary) !important;
    font-size: 1.2rem !important;
    width: 35px !important;
    height: 100% !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
}
.b2b-qty-btn:hover { background: var(--border) !important; color: var(--primary) !important; }
/* Το νούμερο στη μέση */
.b2b-qty-input {
    width: 30px !important;
    height: 100% !important;
    border: none !important;
    text-align: center !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--primary) !important;
    background: transparent !important;
    flex-grow: 1 !important;
    outline: none !important;
}

/* Το "Ματάκι" (Γρήγορη Προβολή) - Στην πάνω γραμμή */
.b2b-quick-view-inline {
    background: var(--bg-alt) !important;
    color: var(--secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    width: 42px !important;
    height: 42px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important; 
    padding: 0 !important;
    font-size: 1.1rem !important;
}
.b2b-quick-view-inline:hover {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* Το Κουμπί Προσθήκης στο Καλάθι - Κάτω γραμμή, πιάνει όλο το πλάτος */
body.woocommerce ul.products li.product .b2b-add-to-cart-wrapper .button {
    width: 100% !important;
    margin: 0 !important; 
    padding: 12px 15px !important;
    height: 42px !important;
    line-height: 1.2 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    color: #fff !important;
    background-color: var(--primary) !important;
    border-radius: var(--radius) !important;
    border: none !important;
}
body.woocommerce ul.products li.product .b2b-add-to-cart-wrapper .button:hover {
    background-color: var(--accent) !important;
}


/* ==========================================
   5. QUICK VIEW MODAL (ΑΝΑΔΥΟΜΕΝΟ ΠΑΡΑΘΥΡΟ)
   ========================================== */
.b2b-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.b2b-modal-overlay.is-active { opacity: 1; visibility: visible; }

.b2b-modal-content {
    background: #fff;
    width: 1100px !important; /* Μεγάλο για άνεση */
    max-width: 95%;
    max-height: 90vh;
    border-radius: var(--radius);
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.b2b-modal-overlay.is-active .b2b-modal-content { transform: translateY(0); }

.b2b-modal-close {
    position: absolute;
    top: 15px; right: 15px;
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--secondary);
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
}
.b2b-modal-close:hover { color: #ef4444; }

/* Το Layout Μέσα στο Modal (Απόλυτο Ζύγισμα 50-50) */
.b2b-qv-layout {
    display: flex !important;
    flex-direction: row !important; 
    flex-wrap: nowrap !important;   
    align-items: flex-start !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.b2b-qv-image {
    width: 50% !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: var(--bg-alt) !important;
    border-right: 1px solid var(--border) !important;
}
.b2b-qv-image img {
    max-width: 100% !important;
    height: auto !important;
    max-height: 550px !important;
    object-fit: contain !important;
    transform: scale(1.03); 
}

.b2b-qv-summary {
    width: 50% !important;
    padding: 40px !important;
    box-sizing: border-box !important;
}

/* Κείμενα μέσα στο Modal */
.qv-title { font-size: 2rem !important; font-weight: 300 !important; color: var(--primary) !important; margin: 0 0 10px 0 !important; line-height: 1.2 !important; }
.qv-sku { font-size: 0.85rem !important; color: var(--secondary) !important; margin-bottom: 20px !important; text-transform: uppercase !important; letter-spacing: 0.05em !important; }
.qv-price { font-size: 1.5rem !important; font-weight: 500 !important; color: var(--accent) !important; margin-bottom: 25px !important; }
.qv-excerpt { font-size: 0.95rem !important; color: var(--secondary) !important; margin-bottom: 30px !important; line-height: 1.6 !important; }

/* Φόρμα Καλαθιού μέσα στο Modal */
.qv-action form.cart { 
    display: flex !important; 
    gap: 15px !important; 
    align-items: center !important; 
}
.qv-action form.cart .quantity { 
    margin: 0 !important; 
}
.qv-action form.cart .button { 
    background: var(--primary) !important; color: #fff !important; 
    padding: 14px 30px !important; border-radius: var(--radius) !important; 
    font-weight: 500 !important; text-transform: uppercase !important; 
    border: none !important; cursor: pointer !important;
}
.qv-action form.cart .button:hover { background: var(--accent) !important; }
.qv-loader { padding: 100px; text-align: center; color: var(--secondary); font-size: 1.2rem; }


/* ==========================================
   6. ΣΕΛΙΔΟΠΟΙΗΣΗ (PAGINATION)
   ========================================== */
.woocommerce-pagination {
    margin-top: 60px;
    margin-bottom: 40px;
    text-align: center;
    width: 100%;
}
.woocommerce-pagination ul {
    border: none !important;
    display: inline-flex !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
}
.woocommerce-pagination ul li { border: none !important; margin: 0 !important; }
.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: block !important;
    padding: 12px 18px !important;
    background: #fff !important;
    color: var(--primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}
.woocommerce-pagination ul li span.current,
.woocommerce-pagination ul li a:hover {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* ==========================================
   7. RESPONSIVE (MOBILE & TABLETS)
   ========================================== */
@media (max-width: 1100px) {
    body.woocommerce ul.products { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 768px) {
    .woocommerce-products-header { text-align: center; }
    .woocommerce-result-count, .woocommerce-ordering { float: none; text-align: center; width: 100%; }
    .woocommerce-ordering select { width: 100%; margin-top: 15px; }
    
    /* 2 Στήλες στα Κινητά */
    body.woocommerce ul.products { grid-template-columns: repeat(2, 1fr) !important; gap: 15px !important; }
    body.woocommerce ul.products li.product { padding: 15px 10px !important; }
    body.woocommerce ul.products li.product a img { height: 160px !important; }
    body.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 0.95rem !important; }
    
    /* Αναδιάταξη Modal σε Κινητά (Το ένα κάτω από το άλλο) */
    .b2b-qv-layout { flex-direction: column !important; flex-wrap: wrap !important; }
    .b2b-qv-image, .b2b-qv-summary { width: 100% !important; padding: 20px !important; border-right: none !important; }
    .qv-title { font-size: 1.5rem !important; }
}