/*
Theme Name: SaleX High Performance
Theme URI: https://salex.co.il
Author: SaleX Dev Team
Description: תבנית מותאמת אישית לביצועים מהירים.
Version: 1.0
Requires PHP: 8.2
*/

body {
    background-color: #f3f4f6; /* רקע אפור בהיר */
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
}

/* Accessibility: screen reader only text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
.screen-reader-text:focus {
    clip: auto;
    clip-path: none;
    height: auto;
    margin: 0;
    overflow: visible;
    padding: 0.25rem 0.5rem;
    position: static;
    width: auto;
}

/* Touch targets: minimum 44x44px for interactive elements */
@media (pointer: coarse) {
    .salex-mobile-nav a,
    .salex-mobile-nav button,
    .salex-floating-cart-trigger,
    a.salex-mini-cart-link,
    .salex-mini-cart-toggler,
    .salex-apply-coupon-btn,
    .salex-block-close,
    .salex-note-modal-close,
    .salex-note-modal-save {
        min-height: 44px;
        min-width: 44px;
    }
    .salex-mobile-nav a,
    .salex-mobile-nav button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 4px;
    }
}

/* --- חנות/קטגוריה: סיידבר + גריד 3 עמודות (ללא תלות ב-Tailwind) --- */
.salex-woo-archive-wrap {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: nowrap;
    gap: 2rem;
    max-width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
}
.salex-woo-archive-main {
    flex: 0 0 75%;
    width: 75%;
    min-width: 0;
    box-sizing: border-box;
}
.salex-woo-archive-sidebar {
    flex: 0 0 25%;
    width: 25%;
    min-width: 0;
    box-sizing: border-box;
}
.salex-woo-archive-sidebar-inner {
    background: #fff;
    padding: 1.5rem;
    border-radius: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    border: 1px solid #eee;
    position: sticky;
    top: 6rem;
}
@media (max-width: 1024px) {
    .salex-woo-archive-wrap { flex-direction: column; }
    .salex-woo-archive-main,
    .salex-woo-archive-sidebar { flex: 0 0 100%; width: 100%; }
    .salex-woo-archive-sidebar-inner { position: static; }
}
/* גריד מוצרים – 3 בשורה (בתוך .salex-woo-archive-main) */
.salex-woo-archive-main .salex-products-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
@media (max-width: 1024px) {
    .salex-woo-archive-main .salex-products-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 640px) {
    .salex-woo-archive-main .salex-products-grid { grid-template-columns: 1fr !important; }
}
@media (min-width: 1600px) {
    .salex-woo-archive-main .salex-products-grid { grid-template-columns: repeat(4, 1fr) !important; }
}
@media (min-width: 2000px) {
    .salex-woo-archive-main .salex-products-grid { grid-template-columns: repeat(5, 1fr) !important; }
}
.salex-woo-archive-main .salex-products-grid > .salex-product-card-wrapper {
    display: flex !important;
    min-height: 0 !important;
}

/* --- חשבון שלי: סיידבר + תוכן (תואם לתמונה ייחוס) --- */
.salex-myaccount-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}
.salex-myaccount-nav {
    flex: 0 0 280px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    border: 1px solid #eee;
    padding: 1rem 0;
    height: fit-content;
    position: sticky;
    top: 1.5rem;
}
.salex-myaccount-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.salex-myaccount-nav-item {
    margin: 0;
}
.salex-myaccount-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: #374151;
    text-decoration: none;
    font-size: 1rem;
    transition: background .15s, color .15s;
}
.salex-myaccount-nav-link:hover {
    background: #f9fafb;
    color: #111;
}
.salex-myaccount-nav-item.is-active .salex-myaccount-nav-link,
.salex-myaccount-nav-item.current .salex-myaccount-nav-link {
    background: #ec4899;
    color: #fff;
}
.salex-myaccount-nav-icon {
    font-size: 1.1rem;
    opacity: .9;
}
.salex-myaccount-nav-footer {
    padding: 1rem 1.25rem 0;
    margin-top: 0.5rem;
    border-top: 1px solid #eee;
}
.salex-myaccount-btn-ticket {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background .15s;
}
.salex-myaccount-btn-ticket:hover {
    background: #1d4ed8;
    color: #fff;
}
.salex-myaccount-content {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    border: 1px solid #eee;
    padding: 1.5rem 2rem;
}
.salex-myaccount-content .woocommerce-MyAccount-content {
    padding: 0;
}
@media (max-width: 768px) {
    .salex-myaccount-nav { flex: 0 0 100%; position: static; }
    .salex-myaccount-content { flex: 1 1 100%; }
}

/* --- סיכום הזמנה בקופה: כמו תמונה 2 – תמונה+שם במרכז, כמות, X --- */
.salex-review-order-rtl { 
    text-align: right;
    border-collapse: collapse;
}
.salex-review-order-rtl thead th {
    display: none;
}
.salex-review-order-rtl tbody tr {
    border-bottom: 1px solid #e5e7eb;
}
.salex-cart-item-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    direction: rtl;
}
/* בלוק כמות + הסרה – מצד שמאל, כפתורים מעוגלים */
.salex-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    direction: ltr;
}
.salex-item-quantity {
    display: flex;
    align-items: center;
    gap: 6px;
}
.salex-qty-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 20px;
    font-weight: 300;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.salex-qty-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111;
}
.salex-qty-input {
    width: 52px;
    height: 36px;
    line-height: 34px;
    padding: 0 6px;
    text-align: center !important;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 600;
    background: #f9fafb;
    box-sizing: border-box;
    vertical-align: middle;
}
.salex-qty-label {
    font-size: 13px;
    color: #6b7280;
    margin: 0 6px 0 0;
}
.salex-item-remove {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #6b7280;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    order: -1;
}
.salex-item-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}
/* בלוק תמונה + שם+מחיר (מוצמדים במרכז התא) */
.salex-item-product {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    direction: rtl;
}
.salex-item-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
}
.salex-item-thumb img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: block;
    object-fit: cover;
}
.salex-item-details {
    flex: 1;
    min-width: 0;
    text-align: right;
}
.salex-item-name {
    font-weight: 500;
    font-size: 14px;
    color: #111;
    margin-bottom: 4px;
    line-height: 1.4;
}
.salex-item-price {
    font-size: 15px;
    font-weight: 600;
    color: #111;
}
/* בלוק תשלום */
.salex-checkout-total-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
    border-top: 2px solid #111;
    font-size: 1.2rem;
    font-weight: 700;
}
.salex-checkout-total-line .salex-checkout-total-amount { 
    font-weight: 700;
    font-size: 1.3rem;
}
.woocommerce-Price-currencySymbol { margin-left: 3px; }

/* הודעות עגלה ריקה / תום סשן – עיצוב נעים (לא אדום בוהק) */
.woocommerce-error,
.woocommerce .woocommerce-error,
.wc-empty-cart-message .woocommerce-info,
.wc-empty-cart-message .cart-empty {
    background: #f0f4f8 !important;
    border: 1px solid #c5d3e0 !important;
    border-top-color: #94a3b8 !important;
    color: #334155 !important;
    padding: 14px 18px;
    border-radius: 10px;
}
.woocommerce-error::before,
.woocommerce .woocommerce-error::before {
    color: #64748b !important;
}
.wc-empty-cart-message a,
.woocommerce-error a.wc-backward {
    color: #2563eb !important;
    font-weight: 600;
}
.wc-empty-cart-message a:hover,
.woocommerce-error a.wc-backward:hover {
    color: #1d4ed8 !important;
}

@media (max-width: 768px) {
    .salex-cart-item-row {
        flex-wrap: wrap;
        gap: 12px;
    }
    .salex-item-product { order: 1; width: 100%; }
    .salex-item-quantity { order: 2; }
    .salex-item-remove { order: 3; margin-right: auto; }
}

/* עמוד מוצר: תיבה בגודל קבוע – התמונה נכנסת במלואה, בלי חיתוך (ללא מסגרת/צל) */
.salex-product-gallery-wrap {
    height: 380px !important;
    display: block;
    position: relative;
}
@media (min-width: 768px) {
    .salex-product-gallery-wrap {
        height: 480px !important;
    }
}
/* Swiper לכל גובה התיבה – לא מתכווץ לגובה התמונה */
.salex-product-gallery-wrap .productSwiper {
    direction: ltr;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box;
}
/* Swiper וסליידים – מילוי מלא של התיבה */
.salex-product-gallery-wrap .productSwiper .swiper-wrapper,
.salex-product-gallery-wrap .productSwiper .swiper-slide {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
}
/* ללא position:absolute על התמונה – transform של Swiper יוצר containing block ושובר מיקום absolute */
.salex-product-gallery-wrap .productSwiper .swiper-slide.salex-product-slide {
    position: relative;
    padding: 0 !important;
    box-sizing: border-box;
    width: 100% !important;
    /* רשת תא אחד – המיכל ממלא את הסלייד (לא shrink כמו ב-flex + align-items:center) */
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    direction: ltr;
}
/* תיבת התמונה – ממלאת את הסלייד, מרכוז באמצעות grid (עמיד ל־RTL ול־Swiper) */
.salex-product-img-box {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
    display: grid;
    place-items: center;
    align-content: center;
    justify-content: center;
    padding: 16px;
    direction: ltr;
}
/* תמונה נכנסת במלואה – קטנה במרכז, גדולה מוקטנת לתיבה (כמו zoom-out) */
.salex-product-img-box .salex-product-img,
.salex-product-img-box img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block;
}
.salex-product-img-box picture {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    display: grid;
    place-items: center;
    margin: 0;
}
.salex-product-img-box picture img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block;
}
/* דף מוצר: מובייל — רק עמודת מחיר ממורכזת (בלי תא ריק) */
@media (max-width: 1023px) {
    .salex-product-price-actions {
        grid-template-columns: 1fr !important;
    }
    .salex-product-price-actions .salex-product-price-spacer {
        display: none !important;
    }
    .salex-product-price-actions .salex-product-price-col {
        grid-column: 1 / -1;
    }
}
/* דף מוצר: מחיר+כמות ממורכזים אופקית מעל עמודת "הוסף לסל" */
.salex-product-price-actions .salex-product-price-inner,
.salex-product-price-actions .salex-product-price-inner p {
    text-align: center !important;
    width: 100%;
}
.salex-product-price-actions .salex-product-price-inner .price {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center !important;
    align-items: baseline;
    text-align: center !important;
    width: 100% !important;
    margin: 0 !important;
    gap: 0.15em;
}
.salex-product-price-actions .salex-product-price-inner .woocommerce-Price-amount,
.salex-product-price-actions .salex-product-price-inner .woocommerce-Price-amount bdi {
    text-align: center !important;
}

/* דף מוצר — קנה עכשיו ורוד, הוסף לסל slate כהה (כמו העיצוב המאושר).
 * !important — Tailwind מה-CDN */
.salex-product-cart-buttons .salex-product-btn-buy,
.salex-product-cart-buttons .salex-product-btn-buy:focus {
    background: #ec4899 !important;
    background-image: none !important;
    border: none !important;
    color: #fff !important;
    -webkit-tap-highlight-color: transparent;
}
.salex-product-cart-buttons .salex-product-btn-buy:hover,
.salex-product-cart-buttons .salex-product-btn-buy:active {
    background: #db2777 !important;
    color: #fff !important;
}
.salex-product-cart-buttons .salex-product-btn-cart,
.salex-product-cart-buttons .salex-product-btn-cart:focus {
    background: #2d3748 !important;
    background-image: none !important;
    border: none !important;
    color: #fff !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}
.salex-product-cart-buttons .salex-product-btn-cart:hover,
.salex-product-cart-buttons .salex-product-btn-cart:active {
    background: #1e293b !important;
    color: #fff !important;
}

.salex-lightbox:not(.hidden) {
    display: flex !important;
}
.salex-lightbox.hidden {
    display: none !important;
}
.salex-lightbox img {
    pointer-events: none;
}
/* דף מוצר — תצוגת מחיר מבצע בסגנון KSP:
 * מחיר מקורי מחוק (קטן/אפור) למעלה, מחיר המבצע גדול בוורוד למטה.
 * חל רק כשיש מבצע כי WooCommerce פולט <del>/<ins> רק אז. */
.salex-product-price-actions .salex-product-price-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    line-height: 1.05 !important;
}
.salex-product-price-actions .salex-product-price-inner del {
    display: block !important;
    font-size: 1.25rem !important;
    font-weight: 500 !important;
    color: #9ca3af !important;
    text-decoration: line-through !important;
    line-height: 1 !important;
    opacity: 1 !important;
}
.salex-product-price-actions .salex-product-price-inner ins {
    display: block !important;
    background: transparent !important;
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    color: #ec4899 !important;
    text-decoration: none !important;
    line-height: 1.1 !important;
}
.salex-product-price-actions .salex-product-price-inner del .woocommerce-Price-amount,
.salex-product-price-actions .salex-product-price-inner ins .woocommerce-Price-amount {
    white-space: nowrap;
}

/* כרטיס מוצר בקטלוג — תצוגת מבצע:
 * מחיר מקורי קטן/אפור/מחוק, מחיר מבצע ורוד ובולט (כמו בדף המוצר).
 * חל רק כשיש מבצע (WooCommerce פולט <del>/<ins> רק אז). */
.salex-card-price {
    display: inline-flex !important;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}
.salex-card-price del {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #9ca3af !important;
    text-decoration: line-through !important;
    opacity: 1 !important;
}
.salex-card-price ins {
    background: transparent !important;
    color: #ec4899 !important;
    font-weight: 900 !important;
    text-decoration: none !important;
}
.salex-card-price del .woocommerce-Price-amount,
.salex-card-price ins .woocommerce-Price-amount {
    white-space: nowrap;
}

/* --- עגלה ריקה: מצב נקי (הסתרת אייקון WooCommerce שדרס את הטקסט ב-RTL) --- */
.woocommerce .cart-empty.woocommerce-info {
    position: relative;
    border: none !important;
    background: transparent;
    padding: 2.5rem 1rem 1rem;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
}
.woocommerce .cart-empty.woocommerce-info::before {
    display: none;
}
.woocommerce .cart-empty.woocommerce-info::after {
    content: "";
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
}
.woocommerce .return-to-shop {
    text-align: center;
    margin-top: 1.25rem;
}
.woocommerce .return-to-shop .button {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    border-radius: 10px;
    padding: 0.7rem 1.6rem;
    font-weight: 700;
    text-decoration: none;
}
