/* ==========================================================================
   BARGCHI FOOTER MOBILE/TABLET — V6 CLEAN
   REPLACE THE ENTIRE OLD bargchi-footer-mobile.css WITH THIS FILE.
   ========================================================================== */


/* ==========================================================================
   MOBILE + TABLET
   ========================================================================== */

@media (max-width: 1024px) {

    /* ----------------------------------------------------------------------
       Accordion
       ---------------------------------------------------------------------- */

    .bargchi-footer-accordion {
        position: static !important;

        width: 100% !important;

        margin: 0 !important;
        padding: 0 !important;

        border-top: 1px solid #e6ebf1 !important;

        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .bargchi-footer-accordion:last-of-type {
        border-bottom: 1px solid #e6ebf1 !important;
    }

    .bargchi-footer-accordion__head {
        position: static !important;

        margin: 0 !important;
        padding: 0 !important;

        min-height: 0 !important;

        transform: none !important;
    }

    .bargchi-footer-accordion__trigger {
        position: relative !important;

        display: flex !important;
        align-items: center !important;

        width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;

        margin: 0 !important;
        padding: 0 23px 0 2px !important;

        color: #102f59 !important;

        font-size: 12.5px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;

        cursor: pointer !important;

        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;

        transform: none !important;
    }

    .bargchi-footer-accordion__trigger::before,
    .bargchi-footer-accordion__trigger::after {
        content: "" !important;

        position: absolute !important;
        top: 50% !important;

        width: 5px !important;
        height: 1.2px !important;

        background: #8b9aac !important;

        border-radius: 999px !important;

        transition: transform .18s ease !important;
    }

    .bargchi-footer-accordion__trigger::before {
        right: 5px !important;

        transform:
            translateY(-50%)
            rotate(45deg) !important;
    }

    .bargchi-footer-accordion__trigger::after {
        right: 8px !important;

        transform:
            translateY(-50%)
            rotate(-45deg) !important;
    }

    .bargchi-footer-accordion.is-open
    .bargchi-footer-accordion__trigger::before {
        transform:
            translateY(-50%)
            rotate(-45deg) !important;
    }

    .bargchi-footer-accordion.is-open
    .bargchi-footer-accordion__trigger::after {
        transform:
            translateY(-50%)
            rotate(45deg) !important;
    }

    .bargchi-footer-accordion__body {
        position: static !important;

        overflow: hidden !important;

        max-height: 0;
        opacity: 0;

        width: 100% !important;

        margin: 0 !important;
        padding: 0 2px !important;

        background: transparent !important;

        transform: none !important;

        transition:
            max-height .22s cubic-bezier(.2,.7,.2,1),
            opacity .14s ease !important;
    }

    .bargchi-footer-accordion.is-open
    .bargchi-footer-accordion__body {
        opacity: 1;

        padding-bottom: 8px !important;
    }

    .bargchi-footer-accordion__body a,
    .bargchi-footer-accordion__body p,
    .bargchi-footer-accordion__body li {
        font-size: 12px !important;
        line-height: 1.8 !important;
    }


    /* ----------------------------------------------------------------------
       Hide ONLY the four original service cards
       ---------------------------------------------------------------------- */

    .bargchi-footer-original-feature-hidden {
        display: none !important;
    }


    /* ----------------------------------------------------------------------
       Independent 2×2 grid
       ---------------------------------------------------------------------- */

    .bargchi-footer-service-grid[data-bargchi-v6="1"] {
        position: static !important;

        display: grid !important;

        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        grid-template-rows:
            60px 60px !important;

        grid-auto-flow: row !important;

        width: 100% !important;
        max-width: 100% !important;

        height: auto !important;
        min-height: 120px !important;

        margin: 6px 0 8px !important;
        padding: 0 !important;

        gap: 0 !important;

        clear: both !important;

        direction: rtl !important;

        overflow: hidden !important;

        background: transparent !important;

        border: 0 !important;
        border-radius: 0 !important;

        box-shadow: none !important;

        float: none !important;
        transform: none !important;
    }

    .bargchi-footer-service-card {
        position: static !important;

        display: flex !important;

        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;

        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;

        height: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;

        margin: 0 !important;
        padding: 7px 8px !important;

        gap: 7px !important;

        overflow: hidden !important;

        background: transparent !important;

        border: 0 !important;
        border-radius: 0 !important;

        box-shadow: none !important;

        float: none !important;
        transform: none !important;

        box-sizing: border-box !important;
    }

    .bargchi-footer-service-card:nth-child(1) {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .bargchi-footer-service-card:nth-child(2) {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .bargchi-footer-service-card:nth-child(3) {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    .bargchi-footer-service-card:nth-child(4) {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }

    /* INTERNAL separators only */
    .bargchi-footer-service-card:nth-child(1),
    .bargchi-footer-service-card:nth-child(3) {
        border-left:
            1px solid #e4eaf0 !important;
    }

    .bargchi-footer-service-card:nth-child(1),
    .bargchi-footer-service-card:nth-child(2) {
        border-bottom:
            1px solid #e4eaf0 !important;
    }

    .bargchi-footer-service-card__icon {
        position: static !important;

        display: flex !important;

        align-items: center !important;
        justify-content: center !important;

        width: 27px !important;
        min-width: 27px !important;
        max-width: 27px !important;

        height: 27px !important;
        min-height: 27px !important;
        max-height: 27px !important;

        flex:
            0 0 27px !important;

        color: #082f63 !important;

        transform: none !important;
    }

    .bargchi-footer-service-card__icon svg {
        display: block !important;

        width: 27px !important;
        height: 27px !important;

        max-width: 27px !important;
        max-height: 27px !important;

        margin: 0 !important;

        transform: none !important;
    }

    .bargchi-footer-service-card__copy {
        position: static !important;

        display: flex !important;

        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: center !important;

        min-width: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow: hidden !important;

        transform: none !important;
    }

    .bargchi-footer-service-card__title {
        display: block !important;

        width: 100% !important;

        margin: 0 !important;
        padding: 0 !important;

        color: #102f59 !important;

        font-size: 11.5px !important;
        font-weight: 700 !important;
        line-height: 1.35 !important;

        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .bargchi-footer-service-card__subtitle {
        display: block !important;

        width: 100% !important;

        margin: 2px 0 0 !important;
        padding: 0 !important;

        color: #7b899c !important;

        font-size: 9px !important;
        font-weight: 400 !important;
        line-height: 1.4 !important;

        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 767px) {

    .bargchi-footer-accordion__trigger {
        height: 34px !important;
        min-height: 34px !important;

        font-size: 11.5px !important;
    }

    .bargchi-footer-service-grid[data-bargchi-v6="1"] {
        grid-template-rows:
            46px 46px !important;

        min-height: 92px !important;

        margin: 5px 0 6px !important;
    }

    .bargchi-footer-service-card {
        height: 46px !important;
        min-height: 46px !important;
        max-height: 46px !important;

        padding: 5px 6px !important;

        gap: 5px !important;
    }

    /*
     * Mobile requirement:
     * title + icon only.
     */
    .bargchi-footer-service-card__subtitle {
        display: none !important;
    }

    .bargchi-footer-service-card__icon {
        width: 23px !important;
        min-width: 23px !important;
        max-width: 23px !important;

        height: 23px !important;
        min-height: 23px !important;
        max-height: 23px !important;

        flex-basis: 23px !important;
    }

    .bargchi-footer-service-card__icon svg {
        width: 23px !important;
        height: 23px !important;

        max-width: 23px !important;
        max-height: 23px !important;
    }

    .bargchi-footer-service-card__title {
        font-size: 10px !important;
        line-height: 1.25 !important;
    }
}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .bargchi-footer-accordion__body,
    .bargchi-footer-accordion__trigger::before,
    .bargchi-footer-accordion__trigger::after {
        transition: none !important;
    }
}


/* =========================================================
   PATCH V7 — فقط برای زیباتر شدن کارت‌های 4گانه فوتر
   این کد را در انتهای bargchi-footer-mobile.css قرار بده
   ========================================================= */

@media (max-width: 1024px) {

    .bargchi-footer-service-grid[data-bargchi-v6="1"] {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
        grid-auto-rows: minmax(62px, auto) !important;
        gap: 8px !important;

        margin: 8px 0 10px !important;
        padding: 0 2px !important;

        min-height: 0 !important;
        height: auto !important;

        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .bargchi-footer-service-card,
    .bargchi-footer-service-card:nth-child(1),
    .bargchi-footer-service-card:nth-child(2),
    .bargchi-footer-service-card:nth-child(3),
    .bargchi-footer-service-card:nth-child(4) {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;

        height: 62px !important;
        min-height: 62px !important;
        max-height: 62px !important;

        padding: 8px 10px !important;
        gap: 8px !important;

        background: #ffffff !important;
        border: 1px solid #e7edf5 !important;
        border-left: 1px solid #e7edf5 !important;
        border-bottom: 1px solid #e7edf5 !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(16, 47, 89, 0.05) !important;

        overflow: hidden !important;
    }

    .bargchi-footer-service-card__icon {
        width: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        flex: 0 0 28px !important;
        color: #0d3566 !important;
    }

    .bargchi-footer-service-card__icon svg {
        width: 28px !important;
        height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
    }

    .bargchi-footer-service-card__copy {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: flex-start !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .bargchi-footer-service-card__title {
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;

        margin: 0 !important;
        color: #102f59 !important;
        font-size: 11.5px !important;
        font-weight: 700 !important;
        line-height: 1.35 !important;
    }

    .bargchi-footer-service-card__subtitle {
        margin: 2px 0 0 !important;
        color: #7d8ca0 !important;
        font-size: 9px !important;
        line-height: 1.35 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

@media (max-width: 767px) {

    .bargchi-footer-service-grid[data-bargchi-v6="1"] {
        gap: 6px !important;
        margin: 6px 0 8px !important;
        padding: 0 1px !important;
        grid-auto-rows: minmax(52px, auto) !important;
    }

    .bargchi-footer-service-card,
    .bargchi-footer-service-card:nth-child(1),
    .bargchi-footer-service-card:nth-child(2),
    .bargchi-footer-service-card:nth-child(3),
    .bargchi-footer-service-card:nth-child(4) {
        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;

        padding: 6px 8px !important;
        gap: 6px !important;

        border-radius: 10px !important;
        box-shadow: 0 1px 6px rgba(16, 47, 89, 0.04) !important;
    }

    .bargchi-footer-service-card__subtitle {
        display: none !important;
    }

    .bargchi-footer-service-card__icon {
        width: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        height: 22px !important;
        min-height: 22px !important;
        max-height: 22px !important;
        flex-basis: 22px !important;
    }

    .bargchi-footer-service-card__icon svg {
        width: 22px !important;
        height: 22px !important;
        max-width: 22px !important;
        max-height: 22px !important;
    }

    .bargchi-footer-service-card__title {
        font-size: 10px !important;
        line-height: 1.28 !important;
    }
}


/* =========================================================
   BARGCHI FOOTER — PATCH V8
   1) کاهش ارتفاع سه ردیف آکاردئون
   2) وسط‌چین دقیق عنوان کارت‌های چهارگانه
   این کد را در انتهای bargchi-footer-mobile.css قرار بده
   ========================================================= */

/* ---------- Tablet + Mobile ---------- */
@media (max-width: 1024px) {

    /* سه ردیف: دسترسی سریع / خدمات مشتریان / خرید مطمئن */
    .bargchi-footer-accordion {
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .bargchi-footer-accordion__head {
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .bargchi-footer-accordion__trigger {
        display: flex !important;
        align-items: center !important;

        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;

        margin: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;

        line-height: 34px !important;
    }

    /* حذف فاصله‌های اضافی احتمالی قالب والد */
    .bargchi-footer-accordion__head > *,
    .bargchi-footer-accordion__trigger > * {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }


    /* ---------- کارت‌های چهارگانه ---------- */

    .bargchi-footer-service-card {
        position: relative !important;

        justify-content: center !important;

        padding-right: 36px !important;
        padding-left: 36px !important;
    }

    .bargchi-footer-service-card__icon {
        position: absolute !important;
        right: 8px !important;
        top: 50% !important;

        transform: translateY(-50%) !important;

        margin: 0 !important;
    }

    .bargchi-footer-service-card__copy {
        width: 100% !important;
        min-width: 0 !important;

        align-items: center !important;
        justify-content: center !important;

        text-align: center !important;
    }

    .bargchi-footer-service-card__title {
        width: 100% !important;

        text-align: center !important;

        margin: 0 !important;
    }

    .bargchi-footer-service-card__subtitle {
        width: 100% !important;

        text-align: center !important;
    }
}


/* ---------- Mobile ---------- */
@media (max-width: 767px) {

    .bargchi-footer-accordion__trigger {
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;

        line-height: 30px !important;

        font-size: 11px !important;
    }

    .bargchi-footer-service-card {
        padding-right: 31px !important;
        padding-left: 31px !important;
    }

    .bargchi-footer-service-card__icon {
        right: 7px !important;
    }

    .bargchi-footer-service-card__title {
        font-size: 10px !important;
        line-height: 1.25 !important;

        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}


/* V9 — hide the complete original WoodMart benefits wrapper when detected */
@media (max-width: 1024px) {
    .bargchi-footer-original-feature-group-hidden {
        display: none !important;
    }
}


/* ==========================================================================
   V10 — DIGIKALA-LIKE COMPACT ACCORDIONS + CENTERED CARD ICONS
   ========================================================================== */

/* Tablet + Mobile */
@media (max-width: 1024px) {

    /* ----------------------------------------------------------
       Accordion rows — Digikala-like
       ---------------------------------------------------------- */

    .bargchi-footer-accordion {
        border-top: 0 !important;
        border-bottom: 1px solid #e8edf3 !important;
        background: transparent !important;
    }

    .bargchi-footer-accordion:last-of-type {
        border-bottom: 1px solid #e8edf3 !important;
    }

    .bargchi-footer-accordion__head {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .bargchi-footer-accordion__trigger {
        position: relative !important;

        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;

        width: 100% !important;

        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;

        margin: 0 !important;

        /* RTL title on right, chevron on left */
        padding: 0 2px 0 28px !important;

        color: #182f4f !important;

        font-size: 12.5px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;

        text-align: right !important;

        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    /* remove old right-side chevron placement */
    .bargchi-footer-accordion__trigger::before,
    .bargchi-footer-accordion__trigger::after {
        top: 50% !important;
        right: auto !important;

        width: 6px !important;
        height: 1.4px !important;

        background: #627187 !important;

        border-radius: 999px !important;
    }

    .bargchi-footer-accordion__trigger::before {
        left: 8px !important;

        transform:
            translateY(-50%)
            rotate(45deg) !important;
    }

    .bargchi-footer-accordion__trigger::after {
        left: 12px !important;

        transform:
            translateY(-50%)
            rotate(-45deg) !important;
    }

    .bargchi-footer-accordion.is-open
    .bargchi-footer-accordion__trigger::before {
        transform:
            translateY(-50%)
            rotate(-45deg) !important;
    }

    .bargchi-footer-accordion.is-open
    .bargchi-footer-accordion__trigger::after {
        transform:
            translateY(-50%)
            rotate(45deg) !important;
    }

    .bargchi-footer-accordion__body {
        padding-right: 2px !important;
        padding-left: 2px !important;
    }


    /* ----------------------------------------------------------
       Four service cards — icon + title both truly centered
       ---------------------------------------------------------- */

    .bargchi-footer-service-card,
    .bargchi-footer-service-card:nth-child(1),
    .bargchi-footer-service-card:nth-child(2),
    .bargchi-footer-service-card:nth-child(3),
    .bargchi-footer-service-card:nth-child(4) {
        display: flex !important;

        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;

        padding: 6px 8px !important;
        gap: 3px !important;

        text-align: center !important;
    }

    .bargchi-footer-service-card__icon {
        position: static !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        margin: 0 auto !important;

        transform: none !important;
    }

    .bargchi-footer-service-card__copy {
        display: flex !important;

        flex: 0 1 auto !important;

        width: 100% !important;

        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;

        margin: 0 !important;

        text-align: center !important;
    }

    .bargchi-footer-service-card__title,
    .bargchi-footer-service-card__subtitle {
        width: 100% !important;

        margin-right: 0 !important;
        margin-left: 0 !important;

        text-align: center !important;
    }
}


/* Mobile */
@media (max-width: 767px) {

    /* Digikala-like mobile row */
    .bargchi-footer-accordion__trigger {
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;

        padding: 0 1px 0 27px !important;

        font-size: 11.5px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
    }

    /* Keep cards compact despite vertical icon/title alignment */
    .bargchi-footer-service-grid[data-bargchi-v6="1"] {
        grid-auto-rows: 56px !important;
        gap: 6px !important;

        margin-top: 7px !important;
    }

    .bargchi-footer-service-card,
    .bargchi-footer-service-card:nth-child(1),
    .bargchi-footer-service-card:nth-child(2),
    .bargchi-footer-service-card:nth-child(3),
    .bargchi-footer-service-card:nth-child(4) {
        height: 56px !important;
        min-height: 56px !important;
        max-height: 56px !important;

        padding: 5px 6px !important;
        gap: 2px !important;
    }

    .bargchi-footer-service-card__icon {
        width: 21px !important;
        min-width: 21px !important;
        max-width: 21px !important;

        height: 21px !important;
        min-height: 21px !important;
        max-height: 21px !important;

        flex: 0 0 21px !important;
    }

    .bargchi-footer-service-card__icon svg {
        width: 21px !important;
        height: 21px !important;

        max-width: 21px !important;
        max-height: 21px !important;
    }

    .bargchi-footer-service-card__title {
        font-size: 9.8px !important;
        font-weight: 650 !important;
        line-height: 1.2 !important;

        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .bargchi-footer-service-card__subtitle {
        display: none !important;
    }
}
