/* =========================================================
   DigBang Header
   Desktop + Mobile
   Version: 3.0
========================================================= */

:root {
    --db-header-bg: #2d1503;
    --db-header-text: #ffffff;
    --db-header-accent: #e64b00;
    --db-header-brown: #6a2700;

    --db-desktop-header-height: 68px;
    --db-mobile-header-height: 64px;

    --db-logo-height: 48px;
    --db-mobile-logo-width: 116px;

    --db-logo-menu-gap: 24px;
    --db-menu-item-gap: 32px;
    --db-actions-gap: 24px;

    --db-panel-width: 320px;
    --db-panel-bg: #ffffff;
    --db-panel-border: #e6e0dc;
}

/* =========================================================
   General
========================================================= */

#header.ct-header {
    font-family: "Vazirmatn", sans-serif;
}

#header.ct-header [data-device="desktop"] [data-row="middle"],
#header.ct-header [data-device="mobile"] [data-row="middle"] {
    background-color: var(--db-header-bg) !important;
}

#header.ct-header [data-row="middle"] .ct-container-fluid {
    align-items: center;
}

/* =========================================================
   Desktop Header
========================================================= */

#header [data-device="desktop"] [data-row="middle"] {
    min-height: var(--db-desktop-header-height) !important;
}

#header [data-device="desktop"] [data-row="middle"] .ct-container-fluid {
    min-height: var(--db-desktop-header-height);
}

#header [data-device="desktop"] [data-column="start"],
#header [data-device="desktop"] [data-column="end"] {
    display: flex;
    align-items: center;
}

#header [data-device="desktop"] [data-column="start"] {
    justify-content: flex-start;
}

#header [data-device="desktop"] [data-column="end"] {
    justify-content: flex-end;
}

#header [data-device="desktop"]
[data-column="start"]
> [data-items="primary"] {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0 !important;
}

#header [data-device="desktop"]
.site-branding
+ #header-menu-1 {
    margin-inline-start: var(--db-logo-menu-gap) !important;
    margin-inline-end: 0 !important;
}

#header [data-device="desktop"]
[data-column="end"]
> [data-items="primary"] {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: var(--db-actions-gap) !important;
}

#header [data-device="desktop"]
[data-column="end"]
> [data-items="primary"]
> * {
    margin: 0 !important;
}

/* =========================================================
   Desktop Logo
========================================================= */

#header .site-branding {
    flex: 0 0 auto;
    margin: 0 !important;
}

#header .site-logo-container {
    display: flex;
    align-items: center;
}

#header [data-device="desktop"] .site-branding img {
    display: block;
    width: auto;
    height: var(--db-logo-height);
    max-height: var(--db-logo-height);
}

/* =========================================================
   Desktop Menu
========================================================= */

#header-menu-1 {
    flex: 0 0 auto;
}

#header-menu-1 .menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: var(--db-menu-item-gap) !important;
    margin: 0 !important;
    padding: 0 !important;
}

#header-menu-1 .menu > li {
    margin: 0 !important;
    padding: 0 !important;
}

#header-menu-1 .menu > li > .ct-menu-link {
    display: flex;
    align-items: center;

    min-height: var(--db-desktop-header-height);
    padding: 0 !important;

    color: var(--db-header-text) !important;

    font-family: "Vazirmatn", sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;

    transition: color 0.2s ease;
}

#header-menu-1 .menu > li > .ct-menu-link:hover,
#header-menu-1 .menu > li.current-menu-item > .ct-menu-link,
#header-menu-1 .menu > li.current_page_item > .ct-menu-link {
    color: var(--db-header-accent) !important;
}

/* =========================================================
   Desktop Search
========================================================= */

#header [data-device="desktop"] .ct-header-search {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-width: auto;
    min-height: auto;
    margin: 0 !important;
    padding: 0 !important;

    color: var(--db-header-text) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;

    font-family: "Vazirmatn", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;

    cursor: pointer;
    transition: color 0.2s ease;
}

#header [data-device="desktop"] .ct-header-search::before {
    content: "جستجو";
    display: inline-block;
    color: currentColor;
    font: inherit;
    line-height: 1;
    white-space: nowrap;
}

#header [data-device="desktop"] .ct-header-search .ct-label {
    display: none !important;
}

#header [data-device="desktop"] .ct-header-search .ct-icon {
    display: block;
    width: 18px !important;
    height: 18px !important;
    color: currentColor !important;
    fill: currentColor !important;
    stroke: none !important;
}

#header [data-device="desktop"] .ct-header-search .ct-icon path {
    fill: currentColor !important;
    stroke: none !important;
}

#header [data-device="desktop"] .ct-header-search:hover,
#header [data-device="desktop"] .ct-header-search:focus-visible {
    color: var(--db-header-accent) !important;
}

/* =========================================================
   Desktop Cart
========================================================= */

#header [data-device="desktop"] .ct-header-cart {
    display: flex;
    align-items: center;
    margin: 0 !important;
}

#header [data-device="desktop"] .ct-cart-item {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;

    margin: 0 !important;
    padding: 0 !important;

    color: var(--db-header-text) !important;
    text-decoration: none !important;

    font-family: "Vazirmatn", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;

    transition: color 0.2s ease;
}

#header [data-device="desktop"] .ct-cart-item .ct-label {
    display: inline-flex !important;
    align-items: center;
    color: currentColor !important;
    font: inherit;
    white-space: nowrap;
}

#header [data-device="desktop"] .ct-cart-item .ct-amount {
    display: none !important;
}

#header [data-device="desktop"] .ct-cart-item .ct-icon-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: currentColor !important;
}

#header [data-device="desktop"] .ct-cart-item .ct-icon-container svg {
    display: block;
    width: 18px !important;
    height: 18px !important;
    color: currentColor !important;
    fill: currentColor !important;
    stroke: none !important;
}

#header [data-device="desktop"] .ct-cart-item .ct-icon-container svg path {
    fill: currentColor !important;
    stroke: none !important;
}

#header [data-device="desktop"] .ct-cart-item .ct-dynamic-count-cart {
    position: static !important;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    width: auto !important;
    height: auto !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    color: var(--db-header-accent) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;

    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

#header [data-device="desktop"] .ct-cart-item:hover,
#header [data-device="desktop"] .ct-cart-item:focus-visible {
    color: var(--db-header-accent) !important;
}

/* =========================================================
   Desktop Account Button
========================================================= */

#header .ct-header-text,
#header .ct-header-text .entry-content {
    margin: 0 !important;
    padding: 0 !important;
}

#header [data-device="desktop"] .db-account-btn {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 40px;
    margin: 0 !important;
    padding: 10px 18px;

    color: var(--db-header-text) !important;
    background-color: transparent !important;
    border: 1px solid var(--db-header-text) !important;
    border-radius: 8px;

    font-family: "Vazirmatn", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;

    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

#header [data-device="desktop"] .db-account-btn svg {
    display: block;
    width: 18px;
    height: 18px;
    color: currentColor;
    fill: none;
    stroke: currentColor;
}

#header [data-device="desktop"] .db-account-btn svg path {
    fill: none !important;
    stroke: currentColor !important;
}

#header [data-device="desktop"] .db-account-btn:hover,
#header [data-device="desktop"] .db-account-btn:focus-visible {
    color: var(--db-header-text) !important;
    background-color: var(--db-header-accent) !important;
    border-color: var(--db-header-accent) !important;
}

/* =========================================================
   Mobile Header
========================================================= */

@media (max-width: 999.98px) {

    body.db-panel-open {
        overflow: hidden;
        touch-action: none;
    }

    #header [data-device="mobile"] [data-row="middle"] {
        min-height: var(--db-mobile-header-height) !important;
    }

    #header [data-device="mobile"] [data-row="middle"] .ct-container-fluid {
        position: relative;

        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;

        width: 100%;
        min-height: var(--db-mobile-header-height);
        padding-inline: 20px !important;
    }

    /* مخفی‌کردن ساختار پیش‌فرض موبایل Blocksy */
    #header [data-device="mobile"] [data-column="start"],
    #header [data-device="mobile"] [data-column="end"] {
        display: none !important;
    }

    .db-mobile-header {
        position: relative;
        z-index: 2;

        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;

        width: 100%;
        min-height: var(--db-mobile-header-height);
    }

    .db-mobile-header__right,
    .db-mobile-header__left {
        display: flex;
        align-items: center;
        gap: 18px;
    }

    .db-mobile-header__right {
        justify-self: start;
    }

    .db-mobile-header__left {
        justify-self: end;
    }

    .db-mobile-header__logo {
        display: flex;
        align-items: center;
        justify-content: center;

        width: var(--db-mobile-logo-width);
        max-width: 31vw;
        margin: 0;
        line-height: 0;
    }

    .db-mobile-header__logo img {
        display: block;
        width: 100%;
        height: auto;
        max-height: 44px;
        object-fit: contain;
    }

    .db-mobile-icon-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: 28px;
        height: 32px;
        margin: 0;
        padding: 0;

        color: #ffffff !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;

        cursor: pointer;
        text-decoration: none !important;

        transition:
            color 0.2s ease,
            opacity 0.2s ease;
    }

    .db-mobile-icon-button:hover,
    .db-mobile-icon-button:focus-visible {
        color: var(--db-header-accent) !important;
    }

    .db-mobile-icon-button svg {
        display: block;
        width: 26px;
        height: 26px;
        overflow: visible;
    }

    .db-mobile-icon-button--menu svg {
        width: 30px;
        height: 24px;
    }

    .db-mobile-icon-button--search svg {
        width: 28px;
        height: 28px;
    }

    .db-mobile-icon-button--cart svg {
        width: 25px;
        height: 27px;
    }

    .db-mobile-icon-button--account svg {
        width: 27px;
        height: 27px;
    }
}

/* =========================================================
   Shared Overlay
========================================================= */

.db-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;

    visibility: hidden;
    opacity: 0;

    background: rgba(20, 10, 4, 0.42);

    transition:
        opacity 0.28s ease,
        visibility 0.28s ease;
}

.db-mobile-overlay.is-active {
    visibility: visible;
    opacity: 1;
}

/* =========================================================
   Custom Mobile Panels
========================================================= */

.db-mobile-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 99999;

    display: flex;
    flex-direction: column;

    width: min(var(--db-panel-width), calc(100vw - 28px));
    max-width: 100%;
    height: 100dvh;

    background: var(--db-panel-bg);
    box-shadow: 0 0 30px rgba(31, 16, 7, 0.18);

    visibility: hidden;

    transition:
        transform 0.3s ease,
        visibility 0.3s ease;
}

.db-mobile-panel--menu {
    right: 0;
    transform: translateX(105%);
}

.db-mobile-panel--cart {
    left: 0;
    transform: translateX(-105%);
}

.db-mobile-panel.is-active {
    visibility: visible;
    transform: translateX(0);
}

.db-mobile-panel__inner {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 0 16px 12px;
}

.db-mobile-panel__header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;

    min-height: 66px;
    border-bottom: 1px solid var(--db-panel-border);
}

.db-mobile-panel__title {
    margin: 0;

    color: #16110e;

    font-family: "Vazirmatn", sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
}

.db-mobile-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;

    color: #ff3c00;
    background: transparent;
    border: 0;
    box-shadow: none;

    cursor: pointer;
}

.db-mobile-panel__close svg {
    display: block;
    width: 18px;
    height: 18px;
}

.db-mobile-panel__body {
    flex: 1;
    min-height: 0;
}

/* =========================================================
   Mobile Menu Panel
========================================================= */

.db-mobile-menu-panel .db-mobile-panel__header {
    direction: ltr;
}

.db-mobile-menu-panel__logo {
    display: flex;
    align-items: center;
    width: 76px;
    line-height: 0;
}

.db-mobile-menu-panel__logo img {
    display: block;
    width: 100%;
    height: auto;
}

.db-mobile-menu {
    margin: 0;
    padding: 28px 0 0;
    list-style: none;
}

.db-mobile-menu li {
    margin: 0;
    padding: 0;
}

.db-mobile-menu a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;

    min-height: 42px;
    padding: 4px 0;

    color: var(--db-header-brown) !important;

    font-family: "Vazirmatn", sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.6;
    text-decoration: none !important;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.db-mobile-menu a:hover,
.db-mobile-menu a:focus-visible,
.db-mobile-menu .current-menu-item > a {
    color: var(--db-header-accent) !important;
}

.db-mobile-menu__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.db-mobile-menu__arrow svg {
    width: 13px;
    height: 13px;
}

/* =========================================================
   Mobile Cart Panel
========================================================= */

.db-mobile-cart-panel .db-mobile-panel__body {
    display: flex;
    flex-direction: column;
}

.db-mobile-cart-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

/* =========================================================
   Empty Cart
========================================================= */

.db-mobile-cart-empty {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    padding-top: 24px;
}

.db-mobile-cart-empty__illustration {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 235px;
    margin: 0 -16px 28px;

    background:
        radial-gradient(
            circle at center,
            rgba(255, 198, 101, 0.7) 0,
            rgba(255, 220, 173, 0.58) 28%,
            rgba(255, 245, 232, 0.25) 58%,
            rgba(255, 255, 255, 0) 75%
        );
}

.db-mobile-cart-empty__illustration img {
    display: block;
    width: 220px;
    max-width: 78%;
    height: auto;
}

.db-mobile-cart-empty__title {
    margin: 0 0 8px;

    color: #4d443f;

    font-family: "Vazirmatn", sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.7;
    text-align: center;
}

.db-mobile-cart-empty__description {
    margin: 0 0 22px;

    color: #958983;

    font-family: "Vazirmatn", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.8;
    text-align: center;
}

.db-mobile-cart-empty__button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 36px;
    padding: 8px 16px;

    color: #ffffff !important;
    background: #db4a00;
    border: 0;
    border-radius: 5px;

    font-family: "Vazirmatn", sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none !important;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.db-mobile-cart-empty__button:hover,
.db-mobile-cart-empty__button:focus-visible {
    color: #ffffff !important;
    background: #c84300;
}

/* =========================================================
   Full Cart – WooCommerce Mini Cart
========================================================= */

/* =========================================================
   MOBILE CART — RESET BLOCKSY CART CONTENT
========================================================= */

.db-mobile-cart-content .ct-cart-content {
    position: static !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column !important;

    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: visible !important;

    background: transparent !important;
    box-shadow: none !important;

    visibility: visible !important;
    opacity: 1 !important;

    transform: none !important;

    pointer-events: auto !important;
}

.db-mobile-cart-content .ct-cart-content > .woocommerce-mini-cart {
    display: block !important;

    flex: 1 1 auto;

    width: 100% !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 20px 0 !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    visibility: visible !important;
    opacity: 1 !important;
}


.db-mobile-cart-content .ct-cart-content > .woocommerce-mini-cart__total,
.db-mobile-cart-content .ct-cart-content > .woocommerce-mini-cart__buttons {
    display: flex !important;

    width: 100% !important;

    visibility: visible !important;
    opacity: 1 !important;
}

.db-mobile-cart-content .ct-cart-content > * {
    flex-shrink: 0;
}

.db-mobile-cart-content .woocommerce-mini-cart {
    display: block !important;

    flex: 1 1 auto;
    min-height: 0;

    margin: 0 !important;
    padding: 24px 0 18px !important;

    overflow-y: auto;
    overflow-x: hidden;

    list-style: none;
}

/* =========================================================
   MINI CART — PRODUCT ITEM
========================================================= */

.db-mobile-cart-content .woocommerce-mini-cart-item {
    position: relative;

    display: grid !important;

    grid-template-columns: 72px minmax(0, 1fr) 24px;
    grid-template-areas: "image data remove";

    align-items: center;

    column-gap: 12px;

    width: 100%;
    min-height: 100px;

    margin: 0 0 16px !important;
    padding: 0 0 16px !important;

    border-bottom: 1px solid #F6EDDE !important;
}


/* =========================================================
   PRODUCT IMAGE
========================================================= */

.db-mobile-cart-content
.woocommerce-mini-cart-item
.ct-media-container {
    grid-area: image;

    display: block !important;

    width: 72px;
    height: 72px;

    margin: 0 !important;
    padding: 0 !important;
}


.db-mobile-cart-content
.woocommerce-mini-cart-item
.ct-media-container img {
    display: block;

    width: 72px !important;
    height: 72px !important;

    margin: 0 !important;

    object-fit: cover;

    border-radius: 8px;
}


/* =========================================================
   PRODUCT DATA
========================================================= */

.db-mobile-cart-content
.woocommerce-mini-cart-item
.product-data {
    grid-area: data;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;

    margin: 0;
    padding: 0;

    gap: 6px;

    direction: rtl;

    text-align: right;
}


.db-mobile-cart-content
.woocommerce-mini-cart-item
.product-title {
    display: block;

    width: 100%;

    margin: 0;
    padding: 0;

    color: #3D3631 !important;

    font-family: "Vazirmatn", sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;

    text-align: right;
    text-decoration: none !important;

    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
}


/* =========================================================
   QUANTITY / PRICE
========================================================= */

.db-mobile-cart-content
.woocommerce-mini-cart-item
.quantity {
    display: block;

    width: 100%;

    margin: 0;

    color: #8E7D71;

    font-family: "Vazirmatn", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.7;

    text-align: right;
}


/* =========================================================
   REMOVE BUTTON
========================================================= */

.db-mobile-cart-content
.woocommerce-mini-cart-item
.remove {
    grid-area: remove;

    align-self: center;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    width: 24px !important;
    height: 24px !important;

    margin: 0 !important;
    padding: 0 !important;

    color: #B8A292 !important;
    background: transparent !important;

    border: 0 !important;
    border-radius: 0 !important;

    box-shadow: none !important;

    text-decoration: none !important;
}


.db-mobile-cart-content
.woocommerce-mini-cart-item
.remove svg {
    display: block;

    width: 14px;
    height: 14px;

    fill: currentColor;
}


.db-mobile-cart-content
.woocommerce-mini-cart-item
.remove:hover {
    color: var(--db-header-accent) !important;
}
.db-mobile-cart-content .woocommerce-mini-cart__total {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin: 0 !important;
    padding: 18px 0 !important;

    border-top: 0 !important;
    border-bottom: 1px solid var(--db-panel-border);

    color: #514943;

    font-family: "Vazirmatn", sans-serif;
    font-size: 17px;
    font-weight: 700;
}

.db-mobile-cart-content .woocommerce-mini-cart__total strong {
    font-weight: 700;
}

.db-mobile-cart-content .woocommerce-mini-cart__total .amount {
    color: #514943;
    font-size: 17px;
    font-weight: 700;
}

.db-mobile-cart-content
.woocommerce-Price-amount {
    direction: rtl;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.db-mobile-cart-content .woocommerce-mini-cart__buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;

    margin: 0 !important;
    padding: 22px 0 0 !important;
}

.db-mobile-cart-content .woocommerce-mini-cart__buttons .button {
    display: flex !important;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 36px;
    margin: 0 !important;
    padding: 8px 16px !important;

    border: 0 !important;
    border-radius: 5px !important;
    box-shadow: none !important;

    font-family: "Vazirmatn", sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none !important;
}

.db-mobile-cart-content
.woocommerce-mini-cart__buttons
.button:not(.checkout) {
    color: #d84a00 !important;
    background: #f5f4f8 !important;
}

.db-mobile-cart-content
.woocommerce-mini-cart__buttons
.button.checkout {
    color: #ffffff !important;
    background: #db4a00 !important;
}

.db-mobile-cart-content
.woocommerce-mini-cart__buttons
.button.checkout:hover {
    background: #c84300 !important;
}

/* Blocksy empty-cart elements must not interfere */
.db-mobile-cart-content .wc-empty-cart-message,
.db-mobile-cart-content > .return-to-shop {
    display: none !important;
}

/* =========================================================
   Responsive Fine-tuning
========================================================= */

@media (max-width: 390px) {

    #header [data-device="mobile"] [data-row="middle"] .ct-container-fluid {
        padding-inline: 16px !important;
    }

    .db-mobile-header__right,
    .db-mobile-header__left {
        gap: 15px;
    }

    .db-mobile-header__logo {
        width: 108px;
    }

    .db-mobile-icon-button {
        width: 26px;
    }
}

@media (max-width: 350px) {

    #header [data-device="mobile"] [data-row="middle"] .ct-container-fluid {
        padding-inline: 12px !important;
    }

    .db-mobile-header__right,
    .db-mobile-header__left {
        gap: 11px;
    }

    .db-mobile-header__logo {
        width: 96px;
    }

    .db-mobile-icon-button--menu svg {
        width: 27px;
    }

    .db-mobile-icon-button--search svg,
    .db-mobile-icon-button--account svg {
        width: 24px;
        height: 24px;
    }

    .db-mobile-icon-button--cart svg {
        width: 23px;
        height: 24px;
    }
}

/* =========================================================
   Tablet / Smaller Desktop
========================================================= */

@media (max-width: 1200px) and (min-width: 1000px) {

    :root {
        --db-logo-menu-gap: 18px;
        --db-menu-item-gap: 22px;
        --db-actions-gap: 16px;
    }

    #header-menu-1 .menu > li > .ct-menu-link {
        font-size: 16px;
    }

    #header [data-device="desktop"] .ct-header-search,
    #header [data-device="desktop"] .ct-cart-item,
    #header [data-device="desktop"] .db-account-btn {
        font-size: 15px;
    }

    #header [data-device="desktop"] .db-account-btn {
        padding-inline: 14px;
    }
}

/* پنل‌های سفارشی فقط روی موبایل */
@media (min-width: 1000px) {

    .db-mobile-header,
    .db-mobile-overlay,
    .db-mobile-panel {
        display: none !important;
    }
}
/* =========================================================
   REMOVE EMPTY BLOCKSY HEADER ROWS
========================================================= */

/* حذف ردیف سفید بالای هدر */
#header.ct-header [data-row="top"] {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* حذف ردیف سفید زیر هدر */
#header.ct-header [data-row="bottom"] {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* جلوگیری از فاصله اضافی خود هدر */
#header.ct-header,
#header.ct-header > div,
#header.ct-header [data-device] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* محتوای صفحه بلافاصله بعد از هدر شروع شود */
#main-container,
.site-main,
#primary {
    margin-top: 0;
}


/* =========================================================
   MOBILE CART COUNT
========================================================= */

@media (max-width: 999.98px) {

    .db-mobile-icon-button--cart {
        width: auto;
        gap: 5px;
    }

    .db-mobile-cart-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        min-width: 14px;
        height: 18px;

        padding: 0;

        color: #FF6600;
        background: transparent;

        font-family: "Vazirmatn", sans-serif;
        font-size: 14px;
        font-weight: 600;
        line-height: 1;

        white-space: nowrap;
    }

    .db-mobile-cart-count.is-hidden {
        display: none;
    }

}

/* =========================================================
   DIGBANG — BLOCKSY SEARCH MODAL
========================================================= */

#search-modal {
    --theme-form-field-border-width: 0px;

    background: rgba(15, 15, 15, 0.88) !important;
}


/* محتوای مودال */

#search-modal .ct-panel-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    height: 100% !important;

    padding: 24px !important;
}


/* خود فرم */

#search-modal .ct-search-form {
    width: 676px !important;
    max-width: calc(100% - 32px) !important;

    margin: 0 !important;
}


/* باکس اصلی */

#search-modal .ct-search-form-inner.ct-pseudo-input {
    position: relative !important;

    display: flex !important;
    align-items: center !important;

    width: 100% !important;
    height: 72px !important;

    margin: 0 !important;
    padding: 0 12px !important;

    background: #FFFFFF !important;

    border: 2px solid #FF6600 !important;
    border-radius: 24px !important;

    box-shadow: none !important;
    outline: none !important;

    overflow: hidden !important;

    direction: rtl !important;
}


/* حذف استایل pseudo خود Blocksy */

#search-modal .ct-search-form-inner::before,
#search-modal .ct-search-form-inner::after {
    display: none !important;
    content: none !important;
}


/* =========================================================
   INPUT
========================================================= */

#search-modal input.modal-field {
    position: static !important;

    flex: 1 1 auto !important;

    width: auto !important;
    min-width: 0 !important;
    height: 68px !important;

    margin: 0 !important;
    padding: 0 20px !important;

    color: #3D3631 !important;
    background: transparent !important;

    border: 0 !important;
    border-radius: 0 !important;

    outline: none !important;
    box-shadow: none !important;

    font-family: "Vazirmatn", sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;

    text-align: right !important;
    direction: rtl !important;

    appearance: none !important;
}


#search-modal input.modal-field::placeholder {
    color: #8E7D71 !important;
    opacity: 1 !important;
}


/* =========================================================
   SEARCH BUTTON
========================================================= */

#search-modal .ct-search-form-inner > button.wp-element-button {
    position: static !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    flex: 0 0 48px !important;

    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;

    margin: 0 !important;
    padding: 0 !important;

    color: #FFFFFF !important;
    background: #FF6600 !important;

    border: 0 !important;
    border-radius: 12px !important;

    box-shadow: none !important;
    outline: none !important;
}


#search-modal
.ct-search-form-inner
> button.wp-element-button
> .ct-search-button-content {
    display: block !important;

    width: 22px !important;
    height: 22px !important;

    fill: currentColor !important;
}


/* =========================================================
   CLOSE BUTTON
========================================================= */

#search-modal .ct-panel-actions {
    position: absolute !important;

    top: 28px !important;
    left: 28px !important;
    right: auto !important;

    z-index: 20 !important;
}


#search-modal .ct-toggle-close {
    color: #FFFFFF !important;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    #search-modal .ct-panel-content {
        padding: 16px !important;
    }


    #search-modal .ct-search-form {
        width: 100% !important;
        max-width: 100% !important;
    }


    #search-modal .ct-search-form-inner.ct-pseudo-input {
        height: 56px !important;

        padding: 0 8px !important;

        border-radius: 16px !important;
    }


    #search-modal input.modal-field {
        height: 52px !important;

        padding: 0 12px !important;

        font-size: 14px !important;
    }


    #search-modal .ct-search-form-inner > button.wp-element-button {
        flex-basis: 40px !important;

        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;

        border-radius: 10px !important;
    }


    #search-modal
    .ct-search-form-inner
    > button.wp-element-button
    > .ct-search-button-content {
        width: 18px !important;
        height: 18px !important;
    }


    #search-modal .ct-panel-actions {
        top: 18px !important;
        left: 18px !important;
    }

}

/* =========================================================
   DIGBANG — DESKTOP MINI CART
========================================================= */

@media (min-width: 1000px) {

    #header [data-device="desktop"] .ct-header-cart {
        position: relative;
    }


    #header [data-device="desktop"] .ct-cart-content {
        width: 360px !important;

        padding: 20px !important;

        background: #FFFFFF !important;

        border: 1px solid #F6EDDE !important;
        border-radius: 16px !important;

        box-shadow:
            0 8px 24px rgba(61, 54, 49, 0.10) !important;

        direction: rtl !important;
    }


    /* =====================================================
       PRODUCT LIST
    ===================================================== */

    #header [data-device="desktop"]
    .ct-cart-content
    .woocommerce-mini-cart {
        margin: 0 !important;
        padding: 0 !important;

        list-style: none !important;
    }


    #header [data-device="desktop"]
    .ct-cart-content
    .woocommerce-mini-cart-item {
        position: relative;

        display: grid !important;

        grid-template-columns: 64px minmax(0, 1fr) 24px;
        grid-template-areas: "image data remove";

        align-items: center;

        gap: 12px;

        min-height: 88px;

        margin: 0 !important;
        padding: 12px 0 !important;

        border-bottom: 1px solid #F6EDDE !important;
    }


    /* =====================================================
       IMAGE
    ===================================================== */

    #header [data-device="desktop"]
    .ct-cart-content
    .ct-media-container {
        grid-area: image;

        display: block !important;

        width: 64px !important;
        height: 64px !important;

        margin: 0 !important;
        padding: 0 !important;
    }


    #header [data-device="desktop"]
    .ct-cart-content
    .ct-media-container img {
        width: 64px !important;
        height: 64px !important;

        object-fit: cover !important;

        border-radius: 8px !important;
    }


    /* =====================================================
       PRODUCT DATA
    ===================================================== */

    #header [data-device="desktop"]
    .ct-cart-content
    .product-data {
        grid-area: data;

        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;

        gap: 4px;

        min-width: 0;

        direction: rtl;
        text-align: right;
    }


    #header [data-device="desktop"]
    .ct-cart-content
    .product-title {
        margin: 0 !important;

        color: #3D3631 !important;

        font-family: "Vazirmatn", sans-serif !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        line-height: 1.6 !important;

        text-decoration: none !important;
    }


    #header [data-device="desktop"]
    .ct-cart-content
    .quantity {
        color: #8E7D71 !important;

        font-family: "Vazirmatn", sans-serif !important;
        font-size: 12px !important;
        font-weight: 400 !important;
        line-height: 1.6 !important;
    }


    /* =====================================================
       REMOVE BUTTON
    ===================================================== */

    #header [data-device="desktop"]
    .ct-cart-content
    .remove {
        grid-area: remove;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        width: 24px !important;
        height: 24px !important;

        margin: 0 !important;
        padding: 0 !important;

        color: #B8A292 !important;
        background: transparent !important;

        border: 0 !important;
        box-shadow: none !important;
    }


    #header [data-device="desktop"]
    .ct-cart-content
    .remove:hover {
        color: #FF6600 !important;
    }


    /* =====================================================
       TOTAL
    ===================================================== */

    #header [data-device="desktop"]
    .ct-cart-content
    .woocommerce-mini-cart__total {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;

        margin: 16px 0 0 !important;
        padding: 16px 0 0 !important;

        border-top: 0 !important;

        color: #3D3631 !important;

        font-family: "Vazirmatn", sans-serif !important;
        font-size: 16px !important;
        font-weight: 700 !important;
    }


    #header [data-device="desktop"]
    .ct-cart-content
    .woocommerce-mini-cart__total
    .amount {
        color: #3D3631 !important;

        font-size: 16px !important;
        font-weight: 700 !important;
    }


    /* =====================================================
       BUTTONS
    ===================================================== */

    #header [data-device="desktop"]
    .ct-cart-content
    .woocommerce-mini-cart__buttons {
        display: grid !important;

        grid-template-columns: 1fr 1fr;

        gap: 12px;

        margin: 20px 0 0 !important;
        padding: 0 !important;
    }


    #header [data-device="desktop"]
    .ct-cart-content
    .woocommerce-mini-cart__buttons
    .button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        min-height: 42px !important;

        margin: 0 !important;
        padding: 8px 12px !important;

        border-radius: 6px !important;

        font-family: "Vazirmatn", sans-serif !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        line-height: 1.4 !important;

        text-decoration: none !important;
    }


    /* مشاهده سبد */

    #header [data-device="desktop"]
    .ct-cart-content
    .woocommerce-mini-cart__buttons
    .button:not(.checkout) {
        color: #CC5200 !important;
        background: #FDF6F6 !important;

        border: 1px solid #FFE0CC !important;
    }


    /* تسویه حساب */

    #header [data-device="desktop"]
    .ct-cart-content
    .woocommerce-mini-cart__buttons
    .button.checkout {
        color: #FFFFFF !important;
        background: #FF6600 !important;

        border: 1px solid #FF6600 !important;
    }


    #header [data-device="desktop"]
    .ct-cart-content
    .woocommerce-mini-cart__buttons
    .button.checkout:hover {
        background: #CC5200 !important;
        border-color: #CC5200 !important;
    }

}

/* =========================================================
   MINI CART — REMOVE HORIZONTAL SCROLL
========================================================= */

@media (min-width: 1000px) {

    #header [data-device="desktop"] .ct-cart-content {
        overflow-x: hidden !important;
    }

    #header [data-device="desktop"]
    .ct-cart-content
    .woocommerce-mini-cart {
        width: 100% !important;
        max-width: 100% !important;

        overflow-x: hidden !important;
    }

    #header [data-device="desktop"]
    .ct-cart-content
    .woocommerce-mini-cart-item {
        width: 100% !important;
        max-width: 100% !important;

        box-sizing: border-box !important;
    }

}