/*
Theme Name:     Al Wissam Waad — Child
Theme URI:      https://alwissam.dz
Description:    قالب طفل لقالب الوسام العربي – وعد. يُضيف نظام الكتب الإلكترونية، خيارات الشراء الثلاثية (ورقي / إلكتروني / قراءة على تطبيق وعد)، PWA، وREST API لتطبيق الهاتف.
Author:         Al Wissam Dev Team
Author URI:     https://alwissam.dz
Template:       alwissam-waad
Version: 2.4.8-single-product-format-line
License:        GNU General Public License v2 or later
License URI:    http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:    alwissam-child
Tags: woocommerce, rtl-language-support, books, publishing, ebook, pwa
*/

/* ════════════════════════════════════════════════════════════
   AL WISSAM WAAD – CHILD THEME OVERRIDES
   هذا الملف لا يحتوي إلا على تعديلات بسيطة. الأنماط الكبيرة
   موضوعة في /assets/css/ ويتم تحميلها عبر functions.php
═══════════════════════════════════════════════════════════════ */

:root {
  --waad-primary:    #7B1E28;
  --waad-accent:     #B38A45;
  --waad-bg:         #FBF6EC;
  --waad-radius:     14px;
  --waad-shadow:     0 6px 18px rgba(17,39,74,.08);
}

/* تكامل مع متغيرات القالب الأم */
body { -webkit-tap-highlight-color: transparent; }

/* تحسينات بسيطة للنسخة الجوّالة */
@media (max-width: 600px) {
  .aw-product__layout-3col { gap: 16px; }
}

/* وضع التطبيق لا يخفي الفوتر في نسخة الويب أو الهاتف.
   نخفي فقط الشريط العلوي الصغير عند فتح الموقع داخل التطبيق الحقيقي. */
body.waad-app-mode .aw-header__strip { display: none !important; }
body.waad-app-mode .aw-header { position: sticky; top: 0; z-index: 100; }
body.waad-app-mode .site-footer,
body.waad-app-mode .aw-footer { display: block !important; }


/* هوية وعد الجديدة: عنابي + بني ذهبي مستوحاة من قالب رشا الكتب */
:root{
  --navy:#7B1E28;--navy-deep:#4A1012;--navy-mid:#9A2F32;
  --gold:#B38A45;--gold-lt:#D8BF8A;--gold-pale:#F1E2C5;
  --cream:#FBF6EC;--cream-mid:#EFE0C5;--cream-lt:#FFFCF7;
}


/* ════════════════════════════════════════════════════════════
   2.3.4 — إصلاح فلتر المتجر على الهاتف
   يمنع ظهور السيدبار كعمود يزحزح الصفحة أو يخلق فراغًا كبيرًا.
═══════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  body.woocommerce-shop .aw-shop,
  body.tax-product_cat .aw-shop,
  body.post-type-archive-product .aw-shop {
    overflow-x: hidden !important;
  }

  body.woocommerce-shop .aw-shop__layout,
  body.tax-product_cat .aw-shop__layout,
  body.post-type-archive-product .aw-shop__layout {
    display: block !important;
    grid-template-columns: none !important;
    grid-template-areas: none !important;
  }

  body.woocommerce-shop .aw-products,
  body.tax-product_cat .aw-products,
  body.post-type-archive-product .aw-products {
    width: 100% !important;
    min-width: 0 !important;
  }

  body.woocommerce-shop .aw-sidebar,
  body.tax-product_cat .aw-sidebar,
  body.post-type-archive-product .aw-sidebar {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(86vw, 360px) !important;
    max-width: 360px !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 18px 14px 28px !important;
    margin: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #FBF6EC !important;
    border-left: 1px solid rgba(179,138,69,.32) !important;
    box-shadow: -18px 0 44px rgba(74,16,18,.18) !important;
    z-index: 99999 !important;
    transform: translateX(110%) !important;
    transition: transform .26s ease !important;
    grid-area: auto !important;
    overscroll-behavior: contain !important;
  }

  body.woocommerce-shop .aw-sidebar.is-open,
  body.tax-product_cat .aw-sidebar.is-open,
  body.post-type-archive-product .aw-sidebar.is-open {
    transform: translateX(0) !important;
  }

  body.admin-bar.woocommerce-shop .aw-sidebar,
  body.admin-bar.tax-product_cat .aw-sidebar,
  body.admin-bar.post-type-archive-product .aw-sidebar {
    top: 46px !important;
    height: calc(100dvh - 46px) !important;
    max-height: calc(100dvh - 46px) !important;
  }

  body.aw-filter-open {
    overflow: hidden !important;
    touch-action: none !important;
  }

  body.aw-filter-open::before {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(35, 18, 18, .38) !important;
    z-index: 99990 !important;
  }

  body.woocommerce-shop .aw-filter-panel,
  body.tax-product_cat .aw-filter-panel,
  body.post-type-archive-product .aw-filter-panel {
    margin-bottom: 14px !important;
    border-radius: 18px !important;
  }

  body.woocommerce-shop .aw-filter-panel__body ul li a,
  body.tax-product_cat .aw-filter-panel__body ul li a,
  body.post-type-archive-product .aw-filter-panel__body ul li a {
    min-height: 42px !important;
    font-size: 14px !important;
  }

  body.woocommerce-shop .aw-shop__toolbar,
  body.tax-product_cat .aw-shop__toolbar,
  body.post-type-archive-product .aw-shop__toolbar {
    align-items: stretch !important;
    gap: 10px !important;
  }

  body.woocommerce-shop .aw-shop__tools,
  body.tax-product_cat .aw-shop__tools,
  body.post-type-archive-product .aw-shop__tools {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    gap: 10px !important;
  }

  body.woocommerce-shop .woocommerce-ordering,
  body.tax-product_cat .woocommerce-ordering,
  body.post-type-archive-product .woocommerce-ordering {
    width: 100% !important;
    margin: 0 !important;
  }

  body.woocommerce-shop .woocommerce-ordering select,
  body.tax-product_cat .woocommerce-ordering select,
  body.post-type-archive-product .woocommerce-ordering select {
    width: 100% !important;
  }
}

/* ════════════════════════════════════════════════════════════
   2.4.3 — تنظيف حالة القائمة الرئيسية على الكمبيوتر والهاتف
   يمنع النقاط الافتراضية وخط الاختيار الرقيق، ويجعل العنصر الحالي كبطاقة ناعمة.
═══════════════════════════════════════════════════════════════ */
body .aw-subnav,
body .aw-subnav *{
  -webkit-tap-highlight-color: transparent;
}

body .aw-subnav__inner{
  display:flex !important;
  align-items:center !important;
  gap:4px !important;
  padding:6px 0 !important;
  margin:0 !important;
  list-style:none !important;
}

body .aw-subnav__inner ul,
body .aw-subnav__menu,
body .aw-subnav__inner .menu{
  display:flex !important;
  align-items:center !important;
  gap:4px !important;
  margin:0 !important;
  padding:0 !important;
  list-style:none !important;
  flex-wrap:nowrap !important;
}

body .aw-subnav__inner li,
body .aw-subnav__inner .menu-item{
  display:inline-flex !important;
  align-items:center !important;
  margin:0 !important;
  padding:0 !important;
  list-style:none !important;
  flex:0 0 auto !important;
}

body .aw-subnav__inner li::marker,
body .aw-subnav__inner .menu-item::marker{
  content:"" !important;
  font-size:0 !important;
}

body .aw-subnav__inner > a,
body .aw-subnav__inner .menu-item > a,
body .aw-subnav__link{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:36px !important;
  padding:7px 14px !important;
  border:0 !important;
  border-bottom:0 !important;
  border-radius:999px !important;
  text-decoration:none !important;
  outline:none !important;
  box-shadow:none !important;
  background:transparent !important;
  line-height:1.4 !important;
}

body .aw-subnav__inner > a:hover,
body .aw-subnav__inner > a:active,
body .aw-subnav__inner .menu-item > a:hover,
body .aw-subnav__inner .menu-item > a:active,
body .aw-subnav__inner .current-menu-item > a,
body .aw-subnav__inner .current_page_item > a,
body .aw-subnav__inner .current-menu-ancestor > a,
body .aw-subnav__inner .current_page_ancestor > a,
body .aw-subnav__link:hover,
body .aw-subnav__link:active{
  border:0 !important;
  border-bottom:0 !important;
  box-shadow:none !important;
  background:#F1E2C5 !important;
  color:var(--waad-hf-burgundy, #7B1E28) !important;
}

body .aw-subnav__inner a:focus,
body .aw-subnav__inner a:active{
  outline:none !important;
  border:0 !important;
  border-bottom:0 !important;
  box-shadow:none !important;
}

body .aw-subnav__inner a:focus-visible{
  outline:2px solid rgba(179,138,69,.55) !important;
  outline-offset:2px !important;
  box-shadow:none !important;
}

@media (max-width: 860px){
  body .aw-subnav{
    overflow:hidden !important;
  }
  body .aw-subnav__inner{
    overflow-x:auto !important;
    scrollbar-width:none !important;
    -webkit-overflow-scrolling:touch !important;
    padding:7px 0 !important;
  }
  body .aw-subnav__inner::-webkit-scrollbar{
    display:none !important;
  }
  body .aw-subnav__inner > a,
  body .aw-subnav__inner .menu-item > a,
  body .aw-subnav__link{
    min-height:38px !important;
    padding:8px 13px !important;
    font-size:13px !important;
    white-space:nowrap !important;
  }
}



/* v2.4.4 — Authors listing cleanup */
.aw-authors-stats{display:none!important;}
.aw-authors-page .aw-author-card{min-width:0;}
.aw-authors-page .aw-author-card__name{line-height:1.55;}
.aw-authors-page .aw-author-card__bio{overflow-wrap:anywhere;}
.aw-authors-page .aw-author-card__books-count{white-space:nowrap;}
@media (max-width:580px){
  .aw-authors-page{padding-top:18px;}
  .aw-author-card__meta{flex-wrap:wrap;justify-content:flex-start;}
}
