/* =========================================================
   JRABAWY CORE v1.5.0 — GLOBAL RESPONSIVE + TYPOGRAPHY
========================================================= */

:root{
    --jr-readable-xs:12px;
    --jr-readable-sm:13px;
    --jr-readable-md:14px;
    --jr-readable-base:16px;
}

/* Basic overflow safety across the branded WordPress/WooCommerce site. */
html,
body{
    max-width:100%;
}

body{
    overflow-x:hidden;
}

body #page,
body .site,
body .site-content,
body .content-area,
body main,
body article,
body .entry-content,
body .woocommerce{
    min-width:0;
    max-width:100%;
}

body img,
body video,
body iframe,
body svg{
    max-width:100%;
}

body input,
body select,
body textarea,
body button{
    max-width:100%;
    font-family:"IBM Plex Sans Arabic",sans-serif;
}

body table{
    max-width:100%;
}

/* Product-category / shop alignment safety. */
body.tax-product_cat,
body.post-type-archive-product{
    overflow-x:hidden!important;
}

body.tax-product_cat article,
body.tax-product_cat li.product,
body.post-type-archive-product article,
body.post-type-archive-product li.product{
    min-width:0!important;
    max-width:100%!important;
}

body.tax-product_cat img,
body.post-type-archive-product img{
    height:auto;
}

/* Native archive fallback buttons now act as product-page links. */
body.tax-product_cat .jr-view-product,
body.post-type-archive-product .jr-view-product{
    cursor:pointer;
}

/* =========================================================
   MOBILE READABILITY
========================================================= */
@media (max-width:767px){

    html{
        -webkit-text-size-adjust:100%;
        text-size-adjust:100%;
    }

    body{
        font-size:16px;
        line-height:1.65;
    }

    /* Avoid tiny 7–10px UI copy in old Jrabawy components. */
    body [class^="jr-"][class*="eyebrow"],
    body [class*=" jr-"][class*="eyebrow"],
    body [class^="jr-"][class*="kicker"],
    body [class*=" jr-"][class*="kicker"]{
        font-size:11px!important;
        line-height:1.5!important;
    }

    body [class^="jr-"][class*="category"],
    body [class*=" jr-"][class*="category"]{
        font-size:12px!important;
        line-height:1.55!important;
    }

    body [class^="jr-"][class*="meta"],
    body [class*=" jr-"][class*="meta"],
    body [class^="jr-"][class*="info"],
    body [class*=" jr-"][class*="info"],
    body [class^="jr-"][class*="availability"],
    body [class*=" jr-"][class*="availability"]{
        font-size:12px!important;
        line-height:1.65!important;
    }

    body [class^="jr-"][class*="price"],
    body [class*=" jr-"][class*="price"]{
        font-size:14px!important;
        line-height:1.5!important;
    }

    body [class^="jr-"][class*="price"] strong,
    body [class*=" jr-"][class*="price"] strong{
        font-size:15px!important;
    }

    body [class^="jr-"][class*="button"],
    body [class*=" jr-"][class*="button"],
    body [class^="jr-"][class*="btn"],
    body [class*=" jr-"][class*="btn"]{
        font-size:13px!important;
    }

    body [class^="jr-"] small,
    body [class*=" jr-"] small{
        font-size:11px!important;
        line-height:1.55!important;
    }

    /* Comfortable touch targets for actual actions, without enlarging icon-only dots. */
    body a[class*="button"],
    body button:not([class*="dot"]):not([class*="close"]){
        min-height:42px;
    }

    /* Product names on custom shop/category cards. */
    body.tax-product_cat h2,
    body.tax-product_cat h3,
    body.post-type-archive-product h2,
    body.post-type-archive-product h3{
        line-height:1.45!important;
        overflow-wrap:anywhere;
    }

    body.tax-product_cat h3 a,
    body.post-type-archive-product h3 a,
    body.tax-product_cat .woocommerce-loop-product__title,
    body.post-type-archive-product .woocommerce-loop-product__title{
        font-size:15px!important;
        line-height:1.5!important;
    }

    body.tax-product_cat .price,
    body.post-type-archive-product .price{
        font-size:14px!important;
    }

    /* Current Jrabawy Shop template. */
    .jr-shop-product__category{
        font-size:12px!important;
    }

    .jr-shop-product__body h3,
    .jr-shop-product__body h3 a{
        font-size:15px!important;
        line-height:1.5!important;
    }

    .jr-shop-product__availability{
        font-size:12px!important;
        line-height:1.6!important;
    }

    .jr-shop-product__price,
    .jr-shop-product__price strong,
    .jr-shop-product__price del{
        font-size:14px!important;
    }

    .jr-shop-product__button{
        min-height:43px!important;
        font-size:13px!important;
    }

    /* Custom Jrab configurator readability. */
    .jr-cc-card__heading span,
    .jr-cc-field-head small,
    .jr-cc-preview-meta small,
    .jr-cc-preview-meta p,
    .jr-cc-manual small,
    .jr-cc-price-note small,
    .jr-cc-offer p{
        font-size:11px!important;
    }

    .jr-cc-card__heading h3{
        font-size:17px!important;
    }

    .jr-cc-field-head label,
    .jr-cc-upload__empty strong{
        font-size:13px!important;
    }

    .jr-cc-brand,
    .jr-cc-model-option{
        font-size:12px!important;
    }

    /* Single product readability — catches both current and older selectors. */
    body.single-product [class^="jr-sp-"] small,
    body.single-product [class*=" jr-sp-"] small{
        font-size:11px!important;
    }

    body.single-product [class^="jr-sp-"][class*="label"],
    body.single-product [class*=" jr-sp-"][class*="label"]{
        font-size:12px!important;
    }

    body.single-product [class^="jr-sp-"][class*="button"],
    body.single-product [class*=" jr-sp-"][class*="button"],
    body.single-product [class^="jr-sp-"][class*="btn"],
    body.single-product [class*=" jr-sp-"][class*="btn"]{
        font-size:13px!important;
    }

    /* Checkout readability, while keeping the responsive structure from v1.3.x. */
    body.woocommerce-checkout .form-row label{
        font-size:12px!important;
    }

    body.woocommerce-checkout .form-row input.input-text,
    body.woocommerce-checkout .form-row textarea,
    body.woocommerce-checkout .form-row select,
    body.woocommerce-checkout .select2-selection__rendered{
        font-size:13px!important;
    }

    body.woocommerce-checkout table.shop_table th,
    body.woocommerce-checkout table.shop_table td{
        font-size:11px!important;
    }

    body.woocommerce-checkout #payment ul.payment_methods li{
        font-size:12px!important;
    }

    body.woocommerce-checkout .woocommerce-privacy-policy-text{
        font-size:11px!important;
    }

    /* Thank-you readability. */
    body.woocommerce-order-received table.order_details th,
    body.woocommerce-order-received table.order_details td{
        font-size:11px!important;
    }

    body.woocommerce-order-received table.order_details dl.wc-item-meta,
    body.woocommerce-order-received table.order_details ul.wc-item-meta{
        font-size:10.5px!important;
    }

    body.woocommerce-order-received .woocommerce-customer-details address{
        font-size:11.5px!important;
    }
}

@media (max-width:420px){
    body{
        font-size:15px;
    }

    body.tax-product_cat h3 a,
    body.post-type-archive-product h3 a,
    body.tax-product_cat .woocommerce-loop-product__title,
    body.post-type-archive-product .woocommerce-loop-product__title{
        font-size:14.5px!important;
    }
}

@media (prefers-reduced-motion:reduce){
    html{
        scroll-behavior:auto!important;
    }
}
