/*
 * Theme: Astra Child
 * File: base.css
 * Purpose: Global styles - product cards, images, Woo notices, search grid, cart widgets, related products
 * Split from: css/custom.css
 */

/* ===========================================
   Product Images - Rounded Corners
   =========================================== */

/* תמונות מוצרים - פינות עגולות */
.woocommerce ul.products li.product img {
    border-radius: 12px;
    transition: 0.3s;
    object-fit: cover;
}

/* עיגול פינות לתמונת מוצר בכל מקום */
.woocommerce ul.products li.product img,
.woocommerce .widget ul.product_list_widget li img,
.woocommerce div.product div.images img,
ul.wc-block-product-template img {
    border-radius: 12px;
    transition: 0.3s;
    object-fit: cover;
}

/* ===========================================
   Product Cards - Catalog
   =========================================== */

/* מסגרת עדינה לכל כרטיס מוצר בקטלוג */
.woocommerce ul.products li.product {
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 10px;
    transition: 0.3s;
    background-color: #ffffff;
}

/* מסגרת ועדינות גם לבלוק של מוצרים (גוטנברג / Spectra) */
ul.wc-block-product-template li {
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 10px;
    transition: 0.3s;
    background-color: #ffffff;
}

/* אפקט מעבר עכבר - צל קל */
.woocommerce ul.products li.product:hover,
ul.wc-block-product-template li:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

/* יישור טקסט */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .price,
ul.wc-block-product-template .wc-block-grid__product-title,
ul.wc-block-product-template .wc-block-grid__product-price {
    text-align: center;
}

/* ===========================================
   WooCommerce Notices
   =========================================== */

/* הסרה של אייקון ברירת מחדל של ווקומרס על תמונות והודעה בדף הזמנות */
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    display: none !important;
}

/* ===========================================
   Cart Widget Images
   =========================================== */

/* תיקון תצוגת תמונות בוידגט של סל הקניות */
/* עיגול פינות ומסגרת לכל תמונה של מוצר - כולל בווידג'טים */
.woocommerce ul.products li.product img,
.woocommerce .product img,
.woocommerce .widget img,
.woocommerce-page .widget img,
.wc-block-grid__product img,
.wc-block-components-product-image img {
    border-radius: 12px !important;
    border: 1px solid #e0e0e0 !important;
    object-fit: cover;
}

/* ===========================================
   Related Products Slider (Mobile)
   =========================================== */

/* תיקון תצוגת מוצרים נוספים מאותו המוכר בדף מכרז בגרסת מובייל */
@media (max-width: 768px) {
    /* בסיס משותף לשתי רשימות המוצרים */
    .related.products ul.products,
    #tab-more_seller_product ul.products {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 16px;
        padding: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .related.products ul.products li.product,
    #tab-more_seller_product ul.products li.product {
        flex: 0 0 80%;
        max-width: 80%;
        min-width: 250px;
        scroll-snap-align: start;
        border: 1px solid #ddd;
        border-radius: 12px;
        background: #fff;
        box-sizing: border-box;
        text-align: center;
        padding: 10px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .related.products ul.products li.product img,
    #tab-more_seller_product ul.products li.product img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
    }
}

/* ===========================================
   Product Template Widget (Mobile)
   =========================================== */

/* יישור הוידגט של מוצרים מובילים בגרסת המובייל */
@media (max-width: 768px) {
    ul.wc-block-product-template {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 10px !important;
        justify-content: center !important;
    }

    ul.wc-block-product-template > li {
        margin: 10px auto !important;
    }
}

/* ===========================================
   Auction Bid Form
   =========================================== */

/* שדה הצעת מחיר - רוחב מדויק ל־5 ספרות */
.auction_form .input-text.qty.bid {
    width: 90px !important;
    font-size: 16px;
    text-align: center;
    padding: 5px 8px;
}

/* ריווח נקי בין השדה לכפתורים */
.auction_form .quantity.buttons_added {
    gap: 6px;
    justify-content: center;
    align-items: center;
}

/* יישור כפתור הגש הצעה למרכז התצוגה */
@media (max-width: 768px) {
    .woocommerce ul.products li.product {
        text-align: center !important;
    }

    .woocommerce ul.products li.product a.button {
        display: inline-block !important;
        margin: 0 auto !important;
        width: auto !important;
    }
}

/* Auction history table */
@media (min-width: 768px) {
    .auction-history-table thead th {
        text-align: right !important;
    }
}

/* ===========================================
   Empty Cart Icon
   =========================================== */

/* הסרת האייקון פרצוץ בסל הקניות שמצורף דרך המחלקה with-empty-cart-icon */
.with-empty-cart-icon::before,
.with-empty-cart-icon::after,
.with-empty-cart-icon {
    background: none !important;
    content: none !important;
    display: block;
}

/* ===========================================
   Mobile Cart
   =========================================== */

/* סידור תצוגת סל קניות בגרסת מובייל */
@media (max-width: 768px) {
    .wc-block-cart {
        padding: 0 15px !important;
    }

    .wc-block-cart__submit-button {
        width: 100% !important;
    }
}

/* ===========================================
   Search Page Grid
   =========================================== */

/* גריד: 5 מוצרים בשורה */
body.search ul.products {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 20px;
    padding: 0;
    list-style: none;
    direction: rtl;
}

/* כל כרטיס מוצר */
body.search ul.products li.product {
    width: calc(20% - 16px); /* 5 בשורה עם מרווח */
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0,0,0,0.08);
    box-sizing: border-box;
    text-align: center;
    padding-bottom: 10px;
    transition: transform 0.3s ease;
}

body.search ul.products li.product:hover {
    transform: translateY(-5px);
}

/* תמונת המוצר */
body.search ul.products li.product img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    display: block;
}

/* כותרת המוצר */
body.search ul.products li.product h2.woocommerce-loop-product__title {
    font-size: 16px;
    margin: 10px 0 5px;
    color: #111;
    line-height: 1.3;
    min-height: 40px;
}

/* קטגוריה */
body.search .ast-woo-product-category {
    font-size: 13px;
    color: #888;
    display: block;
    margin-top: 8px;
}

/* מחיר */
body.search .price {
    font-size: 15px;
    font-weight: bold;
    color: #111;
    margin: 6px 0;
}

/* כפתור סיום מכרז */
body.search a.button.product_type_auction {
    background-color: #4CAF50;
    color: white !important;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 14px;
    display: inline-block;
    margin-top: 5px;
    transition: background 0.3s;
}

body.search a.button.product_type_auction:hover {
    background-color: #388E3C;
}

/* מובייל – 1 מוצר בשורה */
@media (max-width: 768px) {
    body.search ul.products li.product {
        width: 100% !important;
    }
}

/* טאבלט – 3 מוצרים בשורה */
@media (max-width: 1024px) {
    body.search ul.products li.product {
        width: calc(33.333% - 16px);
    }
}

/* ===========================================
   10Bid: Guest login prompt button RTL (auction/product page)
   Align "להתחברות →" button to the right (desktop + mobile)
   =========================================== */

/* Make message area RTL-friendly */
.single-product .woocommerce-message,
.single-product .woocommerce-info,
.single-product .woocommerce-error {
  direction: rtl;
  text-align: right;
}

/* Target ONLY the login link button inside Woo notices */
.single-product .woocommerce-message a.button[href*="/my-account/"],
.single-product .woocommerce-info a.button[href*="/my-account/"],
.single-product .woocommerce-error a.button[href*="/my-account/"] {
  float: right !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

/* Ensure it doesn't get centered by flex rules from theme */
.single-product .woocommerce-message,
.single-product .woocommerce-info,
.single-product .woocommerce-error {
  display: block;
}

/* Clear floats inside notices */
.single-product .woocommerce-message::after,
.single-product .woocommerce-info::after,
.single-product .woocommerce-error::after {
  content: "";
  display: block;
  clear: both;
}

/* ===========================================
   10Bid: Desktop spacing for login button inside Woo notice
   Keep mobile unchanged
   =========================================== */

@media (min-width: 769px) {
  /* Target only the notice list item that contains the /my-account/ button */
  .single-product .woocommerce-error li:has(a.button[href*="/my-account/"]),
  .single-product .woocommerce-info li:has(a.button[href*="/my-account/"]),
  .single-product .woocommerce-message li:has(a.button[href*="/my-account/"]) {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;               /* space between text and button */
    flex-wrap: wrap;         /* if narrow container, allow wrap */
    direction: rtl;
    text-align: right;
  }

  /* Ensure the button stays on the right side in RTL */
  .single-product .woocommerce-error li a.button[href*="/my-account/"],
  .single-product .woocommerce-info li a.button[href*="/my-account/"],
  .single-product .woocommerce-message li a.button[href*="/my-account/"] {
    float: none !important;  /* disable float for desktop flex layout */
    margin-right: 0 !important;
    margin-left: 0 !important;
    white-space: nowrap;
  }
}
