/* ==========================================================================
   responsive-fixes.css  (#1)
   Loaded last on the public site. Small, targeted fixes for image fitting
   and mobile layout so content images sit cleanly in their slots and no
   page scrolls sideways. Kept separate from style.css so the intent is
   obvious and easy to revert.
   ========================================================================== */

/* --- Global safety: media never forces the page wider than the screen ----- */
img,
video,
iframe,
table {
    max-width: 100%;
}

/* Rich-text / editor output (service, course, news, jurisprudence details)
   can contain raw <img> with hard-coded width/height. Keep them inside the
   column and preserve aspect ratio. */
.post-content img,
.products-post-content img,
.news-post img,
.courses-details img,
.about-content img,
.service-details img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* --- Partner logos: uniform box, logo contained (never cropped) ---------- */
.partners-figure {
    width: 100%;
    height: 120px;            /* fixed slot so every logo lines up */
    max-width: 164px;
    max-height: 164px;
}

.partners-img {
    width: 100%;
    height: 100%;
    object-fit: contain;      /* contain, not cover — logos must stay whole */
    padding: 12px;
}

/* ==========================================================================
   Dashboard-uploaded section images  (#8)
   Images set from Settings → "Home control" (company_intro_image, word_img,
   home_img, logo) come in at any size. A slot must never take its size from
   the uploaded file, or one large upload can break the whole page.
   ========================================================================== */

/* Safety net: a figure is never wider than its parent. On its own this does
   not fix a flex item that is sized by its content (see below), but it stops
   any figure from pushing the page sideways. */
figure {
    max-width: 100%;
}

/* --- Company intro ("من نحن", sections/company.blade.php) ------------------
   Root cause of the live bug: .company-intro-cont is a flex row and the
   figure had `flex-shrink: 0` with no width, so the figure took the size of
   its image. `.img-fluid { max-width: 100% }` on the image then resolved
   against that same figure, which constrains nothing. A 2362×1342 upload
   rendered at 2362px and the page scrolled to ~2658px wide.
   Fix: give the figure a fixed width (391px = the default design image),
   capped to 40% of the row, and fit the image inside it. `contain` is used
   because clients upload logos/calligraphy here, which must not be cropped. */
.company-intro-figrue {
    flex: 0 0 391px;
    width: 391px;
    max-width: 40%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-intro-figrue img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;         /* tall uploads do not stretch the section */
    object-fit: contain;
}

/* The text column takes the remaining space and may shrink, so long words
   never push the row wider than the container. */
.company-intro-content {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 991px) {
    /* The row becomes a column here: the image spans the column width. */
    .company-intro-figrue {
        flex-basis: auto;
        width: 100%;
        max-width: 100%;
    }

    .company-intro-figrue img {
        max-height: 320px;
    }
}

/* --- Chairman word (sections/about.blade.php, `word_img`) ------------------
   Fixed 194px circle. The image had no height, so a wide upload sat as a
   strip at the top of the circle. Fill the circle and keep it whole. */
.about-figrue img {
    height: 100%;
    object-fit: contain;
}

/* --- Home general content (parts/home-general-content.blade.php, `home_img`)
   Full-width banner image: keep its ratio but cap its height so a square or
   portrait upload does not fill several screens. */
.home-general-content figure img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 520px;
    margin-inline: auto;
    object-fit: contain;
}

/* 2026-10-21: the title/text reuse .main-title/.main-pargh, which are white
   (made for the slider overlay), so on this light section they were invisible. */
.home-general-content {
    padding: 40px 0 10px;
    text-align: center;
}

.home-general-content .main-title {
    color: var(--main-color);
    margin-top: 20px;
}

.home-general-content .main-pargh {
    color: var(--main-hover);
    margin-bottom: 0;
}

/* --- Logos (header + footer, `logo` setting) -------------------------------
   Width is already capped by style.css; also cap the height so a tall or
   square logo cannot push the navbar or the footer column open. */
.img-logo img,
.second-logo img {
    max-height: 74px;          /* = height of the default 250×154 logo at 120px wide */
    object-fit: contain;       /* keep the logo whole inside the capped box */
}

.footer-figure img {
    max-height: 140px;
    width: auto;
    object-fit: contain;
}

/* --- Mobile hardening ----------------------------------------------------- */
@media (max-width: 767.98px) {
    /* Never allow a stray wide element to create a horizontal scrollbar.
       C-02: this used to be "html, body { overflow-x: hidden }". Hidden on BOTH
       elements turns <body> into its own scroll container, so select2 (which
       appends its list to <body> and pins the scroll position while open)
       made the page jump and the list close on phones. "clip" on body only
       clips the same overflow without creating a scroll container (the value
       propagates to the viewport, which stays the one and only scroller). */
    body {
        overflow-x: clip;
        max-width: 100%;
    }

    /* The hero is 100vh on desktop; cap it on phones so the caption and the
       call-to-action are reachable without the slide eating the whole screen. */
    .main {
        height: auto;
        min-height: 72vh;
    }

    /* Keep the hero media filling the (now shorter) slide. */
    .main .pro-img {
        min-height: 72vh;
    }

    /* Client notes 2026-11-17: the slide is taller than wide on a phone, so "cover" cut the
       sides off a landscape video. Show the whole video (like the images), centred on black. */
    .main .pro-img video.hero-video {
        object-fit: contain !important;
        background: #000;
    }

    /* #8: portrait home banners stay within roughly half a phone screen. */
    .home-general-content figure img {
        max-height: 360px;
    }

    /* Partner logos a touch smaller on phones. */
    .partners-figure {
        height: 96px;
    }
}

/* ------------------------------------------------------------------
   Acceptance notes (2026-10-16)
   ------------------------------------------------------------------ */
@media (max-width: 991px) {
    /* TC-UI-03: on phones the account tables (orders, points, wallet) are 890px
       wide, and their flex/block parents (.form-cont, .table-cont, .credit-box)
       stretched with them, so the WHOLE page scrolled sideways (910px vs 341px).
       Parents now stay at the screen width and only the table scrolls inside
       its own box. */
    .account-cont,
    .account-cont > *,
    .form-cont,
    .table-cont {
        min-width: 0;
        max-width: 100%;
    }

    .table-cont,
    .table-groub {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .credit-box {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 767px) {
    /* TC-UI-05: the floating chat (tawk.to) and WhatsApp buttons sit at the
       bottom corner and covered the last submit button of long forms
       (e.g. «إرسال الطلب» on the booking page). Leave room under the page. */
    body {
        padding-bottom: 110px;
    }
}

/* ==========================================================================
   Account Tables Details & Action Buttons (Consultations, Reservations, Orders)
   ========================================================================== */
.table-groub thead th.text-center,
.table-groub tbody td.text-center {
    text-align: center !important;
    vertical-align: middle !important;
}

.table-groub thead th.table-actions-col,
.table-groub tbody td.table-actions-col {
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    width: 90px;
    min-width: 90px;
}

.table-actions-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    vertical-align: middle;
    margin: 0 auto;
}

.table-groub tbody .table-actions-wrapper .table-show-link,
.table-groub tbody .table-actions-wrapper .table-cancel-link,
.table-groub tbody .table-actions-wrapper .table-pay-link,
.table-actions-wrapper .btn-table-pay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
    padding: 0;
    border-radius: 50%;
    margin: 0 !important;
    font-size: 16px;
    line-height: 1;
    border: none;
    outline: none !important;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Show details link (Golden / Bronze) */
.table-groub tbody .table-actions-wrapper .table-show-link {
    background-color: var(--main-hover, #c39a67);
    color: #fff !important;
}

.table-groub tbody .table-actions-wrapper .table-show-link:hover {
    background-color: var(--main-color, #1f2b38);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Complete payment button (Emerald Green) */
.table-groub tbody .table-actions-wrapper .table-pay-link,
.table-actions-wrapper .btn-table-pay {
    background-color: #28a745;
    color: #fff !important;
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.25);
}

.table-groub tbody .table-actions-wrapper .table-pay-link:hover,
.table-actions-wrapper .btn-table-pay:hover {
    background-color: #218838;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.35);
}

/* Cancel reservation button (Danger Red) */
.table-groub tbody .table-actions-wrapper .table-cancel-link {
    background-color: #e3342f;
    color: #fff !important;
    box-shadow: 0 2px 5px rgba(227, 52, 47, 0.25);
}

.table-groub tbody .table-actions-wrapper .table-cancel-link:hover {
    background-color: #c82333;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(227, 52, 47, 0.35);
}

.table-actions-wrapper .table-show-link i,
.table-actions-wrapper .table-cancel-link i,
.table-actions-wrapper .table-pay-link i,
.table-actions-wrapper .btn-table-pay i {
    font-size: 16px;
    line-height: 1;
}

/* ==========================================================================
   Floating contact & back-to-top buttons: prevent overlap with Tawk.to
   ========================================================================== */
.fixed-what {
    position: fixed !important;
    left: 25px !important;
    right: auto !important;
    bottom: 25px !important;
    z-index: 9999 !important;
}

.arrow-top {
    position: fixed !important;
    left: 25px !important;
    right: auto !important;
    bottom: 95px !important;
    z-index: 9998 !important;
}

@media (max-width: 767px) {
    .fixed-what {
        left: 15px !important;
        right: auto !important;
        bottom: 15px !important;
    }
    .arrow-top {
        left: 15px !important;
        right: auto !important;
        bottom: 75px !important;
    }
}

/* Retest 2026-10-20 (item 12): on phones the floating WhatsApp / back-to-top / chat
   bubbles covered the validation message under the last field of a form (the phone
   error of the booking modal). While a modal is open, or while the visitor is typing
   in a field, the bubbles are hidden (the tawk.to widget is hidden by the matching
   code in forms-global.js), and forms keep room at the bottom so the last error can
   always be scrolled above the bubbles. */
@media (max-width: 767px) {
    body.modal-open .fixed-what,
    body.modal-open .arrow-top,
    body.form-field-focused .fixed-what,
    body.form-field-focused .arrow-top {
        display: none !important;
    }
    .modal .modal-body,
    form[data-validate="true"] {
        padding-bottom: 90px;
    }
}

/* ==========================================================================
   Prevent long unbroken strings from overflowing containers (Word-Break)
   ========================================================================== */
.account-details-item {
    max-width: 100% !important;
    min-width: 0 !important;
}

.account-details-value {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

.products-post-head,
.products-post-pargh,
.post-content,
.post-head,
.contact-item,
.about-pargh,
.table-groub td,
.table-groub th {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    min-width: 0;
}

/* ==========================================================================
   Account Tables: full width on desktop/laptop & no clipped headers
   ========================================================================== */
.table-groub table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
}

.table-groub th {
    white-space: nowrap !important;
}

@media (min-width: 992px) {
    .table-cont,
    .table-groub {
        overflow-x: visible !important;
    }
    .table-groub table {
        width: 100% !important;
        min-width: 0 !important;
    }
}

@media (max-width: 991px) {
    .table-cont,
    .table-groub {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .table-groub table {
        width: 100% !important;
        min-width: 650px !important;
    }
}

/* ==========================================================================
   Article / Blog Post Hero Image Height Cap
   ========================================================================== */
.single-page .post-img,
.post-slider .post-img {
    padding-top: 0 !important;
    height: 400px !important;
    max-height: 400px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 25px;
}

.single-page .post-img img,
.post-slider .post-img img {
    position: static !important;
    max-height: 100% !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
}

@media (max-width: 767px) {
    .single-page .post-img,
    .post-slider .post-img {
        height: 250px !important;
        max-height: 250px !important;
    }
}


/* ==========================================================================
   Client notes 2026-10-20 (item 2): available-quantity pill on book cards
   (site/parts/product-stock-badge.blade.php). Same look as the app's book card:
   bottom-START corner of the image, semi-transparent dark pill, white text.
   inset-inline-start puts it on the right in Arabic and the left in English.
   ========================================================================== */
.has-stock-badge {
    position: relative;
    display: block;
}

.product-stock-badge {
    position: absolute;
    bottom: 8px;
    inset-inline-start: 8px;
    z-index: 2;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    white-space: nowrap;
    pointer-events: none;
}

/* ==========================================================================
   Client notes 2026-10-20 (item 3): «تفاصيل الإجمالي» on the customer order
   pages (site/pages/auth/account/_order-totals.blade.php). Same rows as the
   app; the label column is wide enough for «قيمة رصيد المحفظة المستخدمة» so
   every amount starts on the same line (they were misaligned), and an amount
   never wraps between the number and «ر.س» (overrides the generic word-break
   rule above). The «الإجمالي المستحق» row is separated and bold.
   ========================================================================== */
.order-totals-block .account-details-item {
    align-items: baseline;
}

.order-totals-block .account-details-name {
    min-width: 260px;
}

.order-totals-block .account-details-value {
    flex: 0 0 auto !important;
    white-space: nowrap;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

.order-totals-block .order-totals-due {
    border-top: 1px solid #e6e6e6;
    padding-top: 12px;
}

.order-totals-block .order-totals-due .account-details-value {
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .order-totals-block .account-details-name {
        min-width: 0;
        flex: 1 1 auto;
    }
}

/* ------------------------------------------------------------------
   Polish 2026-10-20 (item 5): cart table on phones
   ------------------------------------------------------------------ */
@media (max-width: 991px) {
    /* The global "table { max-width: 100% }" above squeezed the fixed-layout
       cart table (style.css asks for 890px) into 375px, and its nowrap headers
       ran into each other («السعرالكمية»). The table keeps a readable width and
       scrolls inside .cart-table only, like the account tables (TC-UI-03), so the
       page itself still never scrolls sideways. */
    .cart-table {
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cart-table .table-group {
        width: 720px;
        min-width: 720px;
        max-width: none;
    }

    .cart-table .table-group th,
    .cart-table .table-group tbody td {
        padding: 12px 10px;
    }
}


/* ==========================================================================
   2026-10-22 (books-ui 7): book / magazine cards (site/parts/book-card.blade.php)
   on the books grid, the home «المنتجات» tab and «يمكنك أيضاً شراء».
   Every card of a row has the same height: the card is a flex column, the
   title is clamped to 2 lines and the description to 1 line with FIXED
   heights, and the price + buttons (.book-card-footer) are pushed to the
   bottom with margin-top: auto.
   ========================================================================== */
.grid-cont {
    align-items: stretch;
}

.book-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-card .courses-img-cont {
    flex: 0 0 auto;
}

/* 2026-11-01 (item 1): the image box has the size of the services card image (same
   ratio as .services-figure); a book cover is taller, so it is shown whole inside the
   box instead of being cropped. */
.book-card .courses-figure {
    padding-top: 62.22222222222222%;
}

.book-card .courses-img {
    object-fit: contain;
}

.book-card .book-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

/* The category pill row keeps its height even when the item has no category,
   so the titles of a row start on the same line. */
.book-card .book-card-tags {
    min-height: 30px;
}

.book-card .book-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    height: 48px;
    line-height: 24px;
    margin-bottom: 6px;
    word-break: break-word;
}

.book-card .book-card-desc {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 22px;
    line-height: 22px;
    margin: 0 0 12px;
    color: #808080;
    font-size: 14px;
}

.book-card .book-card-footer {
    margin-top: auto;
}

.book-card .book-card-footer .price-box {
    min-height: 26px;
    margin-bottom: 12px;
}

.book-card .book-card-footer .product-btn {
    text-decoration: none;
}

/* Swiper slides (home tab, similar products) stretch to the tallest card. */
.products-slider .swiper-wrapper,
.slider-section .courses-slider .swiper-wrapper {
    align-items: stretch;
}

.products-slider .swiper-slide,
.slider-section .courses-slider .swiper-slide {
    height: auto;
    display: flex;
}

.products-slider .swiper-slide > .book-card,
.slider-section .courses-slider .swiper-slide > .book-card {
    width: 100%;
}

.books-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #808080;
    padding: 30px 0;
}

/* ==========================================================================
   2026-10-22 (books-ui 4): books page filter bar (site/pages/_partials/_products).
   One tidy row - «الترتيب حسب», «النوع», «نوع النسخة», «التصنيف» - each a label
   ABOVE its field, all fields the same height and the same select2 look (the
   category multi-select included). 4 columns on desktop, 2 on tablets, 1 on
   phones (wraps instead of stacking label-beside-field like before).
   ========================================================================== */
.books-page-header {
    display: block;
    margin-bottom: 30px;
}

.books-page-header .section-head {
    margin-bottom: 20px;
}

.books-filter-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 20px;
    align-items: end;
}

.books-filter-bar .books-filter-item {
    margin: 0;
    min-width: 0;
}

.books-filter-bar .form-label {
    display: block;
    color: var(--main-color);
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 8px;
    -webkit-margin-start: 12px;
    margin-inline-start: 12px;
}

.books-filter-bar .form-input-relative {
    position: relative;
    width: 100%;
}

/* Same 50px pill for the single selects and the category multi-select. */
.books-filter-bar .select2-container--default .select2-selection--single,
.books-filter-bar .select2-container--default .select2-selection--multiple {
    background-color: var(--white-color);
    border: 2px solid #ededed;
    border-radius: 25px;
    min-height: 50px;
    height: auto;
}

.books-filter-bar .select2-container--default.select2-container--focus .select2-selection--multiple,
.books-filter-bar .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--main-hover);
}

.books-filter-bar .select2-container--default .select2-selection--multiple {
    display: flex;
    align-items: center;
    padding: 4px 16px 4px 36px;
    cursor: pointer;
}

[dir="ltr"] .books-filter-bar .select2-container--default .select2-selection--multiple {
    padding: 4px 36px 4px 16px;
}

.books-filter-bar .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.books-filter-bar .select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin: 0;
    border: none;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--main-color);
    font-size: 12px;
    padding: 2px 10px;
}

.books-filter-bar .select2-container--default .select2-search--inline .select2-search__field {
    margin: 0;
    height: 24px;
    font-size: 12px;
    font-weight: 500;
    color: #808080;
    font-family: inherit;
}

.books-filter-bar .select2-container--default .select2-search--inline .select2-search__field::placeholder {
    color: #808080;
}

@media (max-width: 991px) {
    .books-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .books-filter-bar {
        grid-template-columns: 1fr;
    }
}

/* 2026-10-23 (1): contact page cards. The office «الاتجاهات» link inherited the
   80px round `.contact-box i` style, so the two office cards were taller and broke
   the row. It is now a small inline link under the city, and every card in the
   grid has the same height with its content aligned from the top. */
.contact-info {
    grid-auto-rows: 1fr;
    align-items: stretch;
}

.contact-info .contact-box {
    height: 100%;
    justify-content: flex-start;
}

.contact-box .hq-directions-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: var(--main-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.contact-box .hq-directions-link:hover,
.contact-box .hq-directions-link:focus {
    color: var(--main-hover);
    text-decoration: underline;
}

/* Reset the big round card icon for the small link icon. */
.contact-box .hq-directions-link .hq-directions-icon,
.contact-box:hover .hq-directions-link .hq-directions-icon {
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 0;
    background: none;
    color: inherit;
    font-size: 18px;
    display: inline-block;
}

/* 2026-10-23 (2): a digital copy in the cart has no +/- (always quantity 1). */
.cart-digital-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #f2f2f2;
    color: var(--main-color);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.cart-digital-copy i {
    font-size: 18px;
}

/* 2026-11-01 (item 5): a wide table from the dashboard editor scrolls inside the page. */
@media (max-width: 767px) {
    .post-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }
}

/* 2026-11-05 (site 10): the customer's first name next to the header user icon - menu-item
   size (the icon button is 24px), one line, cut with an ellipsis when long. */
.header-icons .user-cont {
    gap: 6px;
}

.header-icons .header-user-inline {
    display: inline-block;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    vertical-align: middle;
}

@media (max-width: 575px) {
    .header-icons .header-user-inline {
        max-width: 70px;
        font-size: 13px;
    }
}

/* 2026-11-05 (site 22): service details - the price / earned points line wraps and keeps
   a clear space above the «طلب الخدمة» button. */
.service-details-price-box {
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 28px;
}

.service-details-price-box .service-earned-points {
    margin-top: 0 !important;
}

/* 2026-11-05 (site 31): account tabs («مواعيدي» ...) had a fixed 114px width, so the longer
   English labels overflowed; they now grow with their text. */
.custom-tabs.nav-tabs {
    flex-wrap: wrap;
}

.custom-tabs.nav-tabs .nav-link {
    width: auto;
    min-width: 114px;
    padding: 0 18px;
    white-space: nowrap;
}

/* 2026-11-05 (site 31): the cancel button of a table row always gets a valid red
   (the old rule used the invalid `var(red)`). */
.table-groub tbody .table-cancel-link {
    background-color: #e3342f;
    color: #fff;
}

.table-groub tbody .table-cancel-link:hover,
.table-groub tbody .table-cancel-link:focus {
    background-color: #c82333;
    color: #fff;
}

/* 2026-11-05 (site 32): English page - detail labels sit on the left and every value
   (dir="auto" for mixed Arabic / English text) starts at the same left edge. */
html[dir="ltr"] .account-details-item {
    text-align: left;
}

html[dir="ltr"] .account-details-name {
    text-align: left;
    flex: 0 0 auto;
}

html[dir="ltr"] .account-details-value[dir="auto"] {
    text-align: left;
}

/* 2026-11-08: the Arabic page - a value made only of digits / Latin text (order
   number, phone) turned LTR through dir="auto" and moved to the far left, away
   from the other values. Every value starts at the same right edge. */
html[dir="rtl"] .account-details-value[dir="auto"] {
    text-align: right;
}

/* 2026-11-05 (site 23): the service description is rich HTML from the dashboard
   editor. Bullets / numbers and their indent come back (theme resets removed them),
   on the start side in Arabic and English, and paragraphs keep a modest gap. */
.post-content .rich-content {
    margin-bottom: 25px;
    color: #4d4d4d;
    line-height: 28px;
    overflow-wrap: anywhere;
}

/* Client notes 2026-12-03 (item 8): the text is shown as typed. Each Enter in the
   editor is a <p>, so paragraphs get no gap of their own; a blank line the user typed
   (an empty <p>) is the only space between paragraphs. */
.post-content .rich-content p {
    margin: 0;
}

.post-content .rich-content ul,
.post-content .rich-content ol {
    margin: 0;
    padding: 0;
    padding-inline-start: 28px;
}

.post-content .rich-content ul {
    list-style: disc outside;
}

.post-content .rich-content ol {
    list-style: decimal outside;
}

.post-content .rich-content ul ul {
    list-style-type: circle;
}

.post-content .rich-content li {
    display: list-item;
    margin-bottom: 0;
}

/* 2026-11-05 (dashboard 8): «زيارة الرابط» under an ad (the admin's external link). */
.ads-external-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

/* 2026-11-09 (item 3): popup texts (SweetAlert «تم بنجاح» / confirmations and the site
   modals) are split into balanced lines, so a short last word (e.g. «السعر.») no longer
   sits alone on its own line. Same font size; browsers without text-wrap keep the
   normal wrapping. */
.swal2-popup .swal2-title,
.swal2-popup .swal2-html-container,
.modal .modal-title,
.modal .modal-body p {
    text-wrap: balance;
}

/* 2026-11-09 (item 2): the site's bootstrap.min.css is an Arabic build that sets
   `body { text-align: right }` for every language, so on the English pages every block
   without its own alignment (timeline, section titles, alerts, buttons, price-offer log,
   replies, ...) sat on the right. English pages start on the left; blocks that set their
   own alignment (centred titles, buttons) keep it. */
html[dir="ltr"] body {
    text-align: left;
}

/* QA-W22 (2026-11-21): expired course - muted note in place of «اشترك الآن»
   (cards: site/parts/course-card-cta, course page: _cources-details). */
.courses-closed {
    display: inline-flex;
    align-items: center;
    min-height: 41px;
    padding-inline: 18px;
    border-radius: 22px;
    background-color: var(--sec-color);
    color: var(--main-color);
    font-weight: 700;
    font-size: 14px;
}

.courses-closed--details {
    margin-block: 16px;
}

/* Client notes 2026-11-25: one button look for every card listing - the look the
   services cards got on 2026-11-17 («عرض الخدمة»): centred in the card, brand colour
   (--main-color), 41px high, 22px radius, darker on hover.
   Used by: services cards (_partials/services_list), course cards (parts/course-card-cta:
   courses page + home slider), book / magazine / digital-book cards (parts/book-card and
   parts/free-book-buttons: books page, AJAX filter, home «المنتجات» tab, similar products).
   Loaded after style.css, so it wins over .courses-link / .product-btn. */
.card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: fit-content;
    min-width: 120px;
    max-width: 100%;
    height: 41px;
    padding: 0 18px;
    margin-inline: auto;
    border: none;
    border-radius: 22px;
    background-color: var(--main-color);
    color: var(--white-color);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.card-cta:hover,
.card-cta:focus-visible {
    background-color: #2c5051;
    color: var(--white-color);
    text-decoration: none;
}

.card-cta i {
    font-size: 20px;
}

/* «قراءة» + «تحميل» side by side, centred as a pair. */
.book-card .free-book-actions {
    justify-content: center;
}

.book-card .free-book-actions .card-cta {
    margin-inline: 0;
}

/* Expired course on a card: the muted note sits centred where the button would be. */
.courses-closed--card {
    display: flex;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    text-align: center;
}
