/*
 * storefront-responsive.css — RESP-01 (2026-11-22)
 *
 * Fixes for how the storefront reads on phones and tablets. Loaded by
 * resources/views/frontend/layout/header.blade.php AFTER the theme CSS and
 * after each page's own <style> block, so equal-specificity rules here win.
 * Every block names its finding in
 * docs/ai/responsive-perf-security-report-ar-2026-11-22.html.
 * The home-page hero (R3) is fixed in index.blade.php itself, where its CSS lives.
 */

/* R2 — the theme sets html{font-size:9px} under 768px (demo21*.min.css),
   so every rem-based size was 10% smaller on phones only. */
@media (max-width: 767px) {
    html { font-size: 62.5%; }
}

/* R2 — body text #777 is 4.48:1 on white, under the WCAG AA minimum of 4.5:1. */
body { color: #595959; }

/* R2 — the smallest texts on product cards (9–11.7px on phones before). */
.product-default .category-list,
.product-default .category-list a,
.product-default .product-category { font-size: 1.2rem; color: #666; }
.product-default .product-price { font-size: 1.6rem; }
.product-default .product-label { font-size: 1.2rem; }
.footer .widget-title { font-size: 1.3rem; }
.mobile-cart .dropdownmenu-wrapper p.text-center { font-size: 1.3rem; }

/* R4 — with the inline 217px sizes gone, keep every card photo square and
   whole, whatever ratio the uploaded file has. */
.product-default figure img { aspect-ratio: 1 / 1; object-fit: contain; }

/* R9 — product names were one line with an ellipsis (about 60% of the name
   visible in the 100px "special offer" cards). Two lines, same height per row. */
.product-default .product-title a {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
.product-default .product-title { min-height: 2.7em; }
/* the category line above the name could lose ~6px of a long English name at 320px */
.product-default .category-list a { white-space: normal; }

/* R6 — brand logos: fixed 200x50 stretched any logo that is not 4:1. */
.brands-section .brand-logo { width: 100%; height: 50px; object-fit: contain; }

/* R8 — Bootstrap .btn is nowrap, so long FAQ questions ran off the screen
   (the English page at 320–390px lost 20–90px). */
#accordionExample .btn-link {
    white-space: normal;
    text-align: start;
    line-height: 1.5;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* R5 — cart table on phones: the 250px product column plus overflow:hidden
   cut off the quantity and subtotal columns. Each row becomes a card. */
@media (max-width: 767px) {
    .cart-table-container { overflow: visible !important; }
    .table-cart thead { display: none; }
    .table-cart,
    .table-cart tbody,
    .table-cart tfoot,
    .table-cart tfoot tr,
    .table-cart tfoot td { display: block; width: 100%; }

    .table-cart tr.product-row {
        display: grid;
        grid-template-columns: 72px 1fr auto;
        grid-template-areas:
            "img name  name"
            "img price price"
            "img qty   total";
        gap: 6px 12px;
        align-items: center;
        padding: 14px 12px;
        border-bottom: 1px solid #eee;
    }
    .table-cart tr.product-row td {
        display: block;
        width: auto !important;
        min-width: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        text-align: start !important;
    }
    .table-cart tr.product-row td:nth-child(1) { grid-area: img; }
    .table-cart tr.product-row td:nth-child(2) { grid-area: name; }
    .table-cart tr.product-row td:nth-child(3) { grid-area: price; color: #666; }
    .table-cart tr.product-row td:nth-child(4) { grid-area: qty; }
    .table-cart tr.product-row td:nth-child(5) { grid-area: total; text-align: end !important; }
    .table-cart tr.product-row .product-title { font-size: 1.5rem; }
    .table-cart tr.product-row .product-single-qty input { max-width: 90px !important; margin: 0 !important; }

    .table-cart tfoot td { padding: 16px 12px !important; }
    .table-cart tfoot .float-left,
    .table-cart tfoot .float-right { float: none !important; }
    .table-cart tfoot .btn { display: block; width: 100%; margin-bottom: 8px; }
}

/* R7 — small offer banners: the name sat over a 190px image in half a column
   and wrapped one word per line. On phones it goes under the image. */
@media (max-width: 575px) {
    .new-products-section .banner1 .banner-layer-middle {
        position: static !important;
        transform: none !important;
        padding: 12px 14px 16px;
    }
    .new-products-section .banner1 .banner-layer-middle > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: start !important;
    }
    .new-products-section .banner1 h3 { font-size: 1.7rem; margin-bottom: 6px !important; }
}

/* R10 — tap targets under the 24px WCAG 2.2 minimum (search button 15x20,
   cart close 17px, footer links 18px tall). 40px is the comfortable size. */
@media (max-width: 991px) {
    .mobile-menu-toggler,
    .header-icon .search-toggle,
    .cart-toggle {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .mobile-menu-wrapper .search-wrapper .btn { min-width: 40px; min-height: 40px; }
    .mobile-cart .btn-close { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
    .footer .links li a,
    .footer .contact-widget a { display: inline-block; padding-top: 6px; padding-bottom: 6px; }
}

/* P3 — social icons are inline SVG now (frontend/layout/social-svg.blade.php),
   so the 73KB Font Awesome Brands font is no longer downloaded. */
.social-icon .social-svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
    vertical-align: middle;
}
.social-icons .social-icon:has(.social-svg) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Header height on phones: the larger base font made it 148px (26% of a
   320x568 screen). Less padding around the logo row brings it to ~121px,
   shorter than the original 135px, without shrinking the logo or the icons. */
@media (max-width: 767px) {
    header.header .header-middle {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

/* Review avatars: the reviewer's initial, drawn locally (they were images
   from ui-avatars.com, which received every reviewer's name). */
.review-avatar {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
    font-weight: 700;
    color: #fff;
    background: #00009c;
    border-radius: 6px;
}

/* A11Y-01 — text contrast under the WCAG AA minimum of 4.5:1 (axe/Lighthouse
   color-contrast). Each colour is the nearest darker shade of the original.
   Banner label #28a745 on #f4f4f4 = 2.85 -> #1e7e34 = 4.67 (5.14 on white).
   Footer links, newsletter box #777 = 4.48 -> #666 = 5.74.
   Header search box/select #8d8d8d = 3.32 -> #666.  Reviews link #999 = 2.85 -> #666.
   Product description #7b858a = 3.77 -> #5c666b = 5.89 (same slate tint). */
.intro-section .banner-content h2.font-weight-normal { color: #1e7e34 !important; }
.footer .widget .links a,
.footer input[type="email"],
.footer input[type="email"]::placeholder { color: #666; opacity: 1; }
.header-search-wrapper .form-control,
.header-search-wrapper .form-control::placeholder,
.header-search-wrapper select { color: #666; opacity: 1; }
.product-single-details .rating-link { color: #666; }
.product-single-tabs .product-desc-content,
.product-single-tabs .product-desc-content p { color: #5c666b; }
/* White text on the brand greens: "Shop now" #28a745 = 3.13, newsletter button
   #21b928 = 2.61, "hot" label #2ba968 = 3.0. One darker green for all three:
   #1e7e34 = 5.14 with white. Footer column titles #777 -> #666. */
.intro-section .btn-buy,
.intro-section .btn-buy:hover { background: #1e7e34 !important; }
.footer-submit-wrapper .btn { background-color: #1e7e34; border-color: #1e7e34; color: #fff; }
.product-default .product-label.label-hot,
.product-single-gallery .product-label.label-hot { background-color: #1e7e34; }
.footer .widget-title { color: #666; }
/* product page: "Add to cart" (white on #21b928 = 2.61) and the inactive tab (#818692 = 3.64) */
.product-action-custom .btn-dark,
.product-action-custom .btn-dark:hover { background-color: #1e7e34; border-color: #1e7e34; color: #fff; }
.product-single-tabs .nav-tabs .nav-link:not(.active) { color: #5c666b; }
/* category name on product cards: the theme dims .category-list to opacity .8,
   which turns its text into #858585 = 3.69. Full opacity and #666 = 5.74. */
.product-default .category-list { opacity: 1; }
/* ...and its link was 23px tall in Arabic, 16px in English: under the 24px target
   minimum. Vertical padding on an inline link grows its tap box without changing
   the line height, so the cards keep their size (a 24px line-height made every
   card 10px taller). */
.product-default a.product-category { color: #666; padding-top: 5px; padding-bottom: 5px; }

/* PERF-07 — the product gallery now shows its first image before Owl starts
   (owl-carousel-lazy, product.blade.php). Size it exactly as Owl will: full
   column width, square, so nothing moves when the carousel takes over. */
.product-single-carousel.owl-carousel-lazy:not(.owl-loaded) .product-single-image {
    display: block;
    width: 100%;
    height: auto;
}

/* A11Y-01 — touch targets under the 24px WCAG 2.2 minimum (target-size).
   Carousel dots were 20x20: the button grows to 24x24, the visible dot inside
   keeps its size. Desktop footer links were 23px apart with 24px-tall boxes
   (overlapping): one 24px line each. Phones already get 6px padding (R10). */
.owl-theme .owl-dots .owl-dot {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}
@media (min-width: 992px) {
    .footer .widget .links a { display: inline-block; min-height: 24px; line-height: 24px; }
}
