/*
Theme Name: HeartHubStore ShopFlow
Theme URI: https://heart-hub-store.com
Author: HeartHubStore
Description: Launch-ready Arabic WooCommerce theme with editable hero/category imagery, stronger product pages, SEO and conversion enhancements.
Version: 9.1.7.1
Text Domain: hearthubstore-commerce
Requires at least: 6.0
Requires PHP: 7.4
License: Proprietary - HeartHubStore
*/

/* الصفحة الرئيسية فقط: 6 منتجات في الصف */
@media (min-width: 1200px) {
    .hhs-product-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}

/* صفحة المتجر فقط */
@media (min-width: 1200px) {

    body.post-type-archive-product ul.products {
        display: grid !important;
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }

    body.post-type-archive-product ul.products li.product {
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 10px !important;
        float: none !important;
        box-sizing: border-box !important;
    }

    body.post-type-archive-product ul.products li.product img {
        width: 100% !important;
        height: 175px !important;
        object-fit: contain !important;
    }

    body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title {
        font-size: 13px !important;
        line-height: 1.45 !important;
        margin: 10px 0 6px !important;
    }

    body.post-type-archive-product ul.products li.product .price {
        font-size: 17px !important;
        line-height: 1.2 !important;
        margin: 6px 0 10px !important;
    }

    body.post-type-archive-product ul.products li.product .button {
        width: 100% !important;
        min-height: 36px !important;
        padding: 8px 4px !important;
        font-size: 11px !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        box-sizing: border-box !important;
    }
}
/* إصلاح شبكة متجر WooCommerce */
body.post-type-archive-product ul.products::before,
body.post-type-archive-product ul.products::after {
    display: none !important;
    content: none !important;
}
/* موبايل: 4 منتجات في السطر بشكل مصغّر */
@media (max-width: 767px) {

    .hhs-product-grid {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    .hhs-card {
        min-width: 0 !important;
        padding: 4px !important;
        border-radius: 10px !important;
    }

    .hhs-card__image img {
        width: 100% !important;
        height: 95px !important;
        object-fit: cover !important;
        border-radius: 8px !important;
    }

    .hhs-card__content {
        padding: 6px 3px !important;
    }

    .hhs-card__content h3 {
        font-size: 9px !important;
        line-height: 1.35 !important;
        height: 25px !important;
        overflow: hidden !important;
        margin: 3px 0 !important;
    }

    .hhs-card__price {
        font-size: 12px !important;
        margin: 4px 0 !important;
    }

    .hhs-card__actions {
        display: block !important;
    }

    .hhs-card__button {
        display: none !important;
    }

    .hhs-card__buy {
        display: block !important;
        width: 100% !important;
        font-size: 9px !important;
        padding: 6px 2px !important;
        text-align: center !important;
        border-radius: 7px !important;
    }

    .hhs-card__badge {
        font-size: 8px !important;
        padding: 3px 5px !important;
    }
}
/* ===== MOBILE PRODUCT GRID - FINAL ===== */
@media screen and (max-width: 767px) {

  body.home .hhs-products-section .hhs-product-grid,
  body.home .hhs-product-grid.hhs-product-grid--priority {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 5px !important;
    width: 100% !important;
    overflow: visible !important;
  }

  body.home .hhs-products-section .hhs-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 3px !important;
    border-radius: 9px !important;
  }

  body.home .hhs-products-section .hhs-card__image {
    width: 100% !important;
    height: 82px !important;
    min-height: 82px !important;
    display: block !important;
    overflow: hidden !important;
  }

  body.home .hhs-products-section .hhs-card__image img {
    width: 100% !important;
    height: 82px !important;
    min-height: 82px !important;
    object-fit: cover !important;
  }

  body.home .hhs-products-section .hhs-card__content {
    padding: 5px 2px !important;
  }

  body.home .hhs-products-section .hhs-card__content h3 {
    font-size: 8px !important;
    line-height: 1.3 !important;
    height: 22px !important;
    min-height: 22px !important;
    margin: 2px 0 4px !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
  }

  body.home .hhs-products-section .hhs-card__price {
    font-size: 11px !important;
    line-height: 1.2 !important;
    margin: 3px 0 5px !important;
  }

  body.home .hhs-products-section .hhs-card__actions {
    display: block !important;
  }

  body.home .hhs-products-section .hhs-card__button {
    display: none !important;
  }

  body.home .hhs-products-section .hhs-card__buy {
    display: block !important;
    width: 100% !important;
    min-height: 25px !important;
    padding: 5px 1px !important;
    font-size: 7px !important;
    line-height: 1.1 !important;
    border-radius: 6px !important;
    white-space: normal !important;
  }

  body.home .hhs-products-section .hhs-card__badge {
    font-size: 7px !important;
    padding: 2px 4px !important;
  }
}
/* ===== HeartHubStore - تحسين صفحة المنتج ===== */

body.single-product table.variations {
    width: 100% !important;
    margin: 18px 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
}

body.single-product table.variations th,
body.single-product table.variations td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
}

body.single-product table.variations label {
    display: block !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    margin-bottom: 6px !important;
}

body.single-product table.variations select {
    width: 100% !important;
    min-height: 46px !important;
    padding: 0 14px !important;
    background: #ffffff !important;
    color: #0b1728 !important;
    border: 1px solid #284869 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    outline: none !important;
}

body.single-product table.variations select:focus {
    border-color: #1a8cff !important;
    box-shadow: 0 0 0 3px rgba(26,140,255,.15) !important;
}

body.single-product .quantity {
    margin: 12px 0 !important;
}

body.single-product .quantity input.qty {
    width: 70px !important;
    height: 44px !important;
    background: #ffffff !important;
    color: #0b1728 !important;
    border: 1px solid #284869 !important;
    border-radius: 9px !important;
    text-align: center !important;
    font-size: 15px !important;
}

body.single-product button.single_add_to_cart_button {
    min-height: 48px !important;
    padding: 12px 22px !important;
    background: #1687ff !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    opacity: 1 !important;
}

body.single-product button.single_add_to_cart_button:hover {
    background: #0875e6 !important;
    transform: translateY(-1px);
}

body.single-product button.single_add_to_cart_button.disabled,
body.single-product button.single_add_to_cart_button:disabled {
    background: #2d4560 !important;
    color: #b8c6d6 !important;
    opacity: .85 !important;
}

body.single-product .woocommerce-variation-price {
    margin: 10px 0 !important;
    font-size: 20px !important;
    font-weight: 800 !important;
}

body.single-product .reset_variations {
    color: #35c7ff !important;
    font-size: 12px !important;
}

@media (max-width: 767px) {
    body.single-product table.variations select {
        min-height: 44px !important;
        font-size: 13px !important;
    }

    body.single-product button.single_add_to_cart_button {
        width: 100% !important;
    }
}
