/* =========================================================
   TNTKala Amazon Header v2.1
   ========================================================= */

#tnt-amz-header-v2,
#tnt-amz-header-v2 * { box-sizing: border-box; }

#tnt-amz-header-v2 {
    background: #131921;
    color: #ffffff;
    direction: rtl;
    width: 100%;
    position: relative;
    z-index: 9998;
    font-family: Vazirmatn, sans-serif;
}

#tnt-amz-header-v2 a { color: #ffffff; text-decoration: none; }
#tnt-amz-header-v2 .tnt-hd__top    { background: #131921; }
#tnt-amz-header-v2 .tnt-hd__bottom { background: #232f3e; }

#tnt-amz-header-v2 .tnt-hd__top-inner,
#tnt-amz-header-v2 .tnt-hd__nav-inner,
#tnt-amz-header-v2 .tnt-hd__mobile-nav-inner,
#tnt-amz-header-v2 .tnt-hd__drawer-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 14px;
}

#tnt-amz-header-v2 .tnt-hd__hover {
    border: 1px solid transparent;
    border-radius: 2px;
    transition: border-color 0.15s ease;
}
#tnt-amz-header-v2 .tnt-hd__hover:hover,
#tnt-amz-header-v2 .tnt-hd__hover:focus-visible { border-color: #ffffff; }

#tnt-amz-header-v2 .tnt-hd__sub {
    display: block; font-size: 12px; line-height: 1.1;
    color: #cccccc; white-space: nowrap;
}
#tnt-amz-header-v2 .tnt-hd__strong {
    display: block; font-size: 14px; line-height: 1.2;
    font-weight: 700; color: #ffffff; white-space: nowrap;
}

/* =========================  Desktop  ========================= */
#tnt-amz-header-v2 .tnt-hd__top-inner {
    display: flex; align-items: center; gap: 8px;
    min-height: 60px; padding-top: 6px; padding-bottom: 6px;
}

#tnt-amz-header-v2 .tnt-hd__burger { display: none; }

/* ── لوگو با نام لاتین + فارسی زیرش ── */
#tnt-amz-header-v2 .tnt-hd__logo-link {
    display: inline-flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 6px 8px; flex: 0 0 auto; line-height: 1;
}
#tnt-amz-header-v2 .tnt-hd__logo-text {
    font-family: 'Amazon Ember', 'Poppins', Vazirmatn, sans-serif;
    font-size: 28px; font-weight: 700; line-height: 1;
    letter-spacing: -0.5px; color: #FF9900;
}
#tnt-amz-header-v2 .tnt-hd__logo-fa {
    font-family: Vazirmatn, sans-serif;
    font-size: 10px; font-weight: 500; line-height: 1;
    color: #cccccc; margin-top: 3px; letter-spacing: 0.5px;
}

/* ── ارسال (دسکتاپ) ── */
#tnt-amz-header-v2 .tnt-hd__deliver {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 8px; flex: 0 0 auto;
}
#tnt-amz-header-v2 .tnt-hd__deliver svg {
    width: 18px; height: 18px; flex: 0 0 18px; margin-top: 8px;
}

/* ── جستجو ── */
#tnt-amz-header-v2 .tnt-hd__search-wrap.tnt-search {
    flex: 1 1 auto; margin: 0 6px; max-width: none;
}
#tnt-amz-header-v2 .tnt-hd__search-form.tnt-search-form {
    display: flex; align-items: stretch; width: 100%;
    height: 40px; background: #ffffff; border-radius: 8px;
    overflow: visible !important; position: relative;
}
#tnt-amz-header-v2 .tnt-hd__search-form.tnt-search-form:focus-within {
    box-shadow: 0 0 0 3px #ff9900;
}

/* ✅ dropdown دسته‌بندی - بزرگ‌تر، بولد، زمینه خاکستری متمایز */
#tnt-amz-header-v2 .tnt-hd__search-cat.tnt-search-cat {
    display: block;
    width: 130px; min-width: 130px; max-width: 130px;
    border: none; border-left: 1px solid #cdcdcd;
    border-radius: 8px 0 0 8px;
    background: #e7e9ec; /* خاکستری متمایز */
    color: #0F1111; font-size: 13px; font-weight: 700;
    padding: 0 10px 0 26px;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 8px center;
    background-size: 12px;
    cursor: pointer; outline: none;
    transition: background-color 0.15s;
}
#tnt-amz-header-v2 .tnt-hd__search-cat.tnt-search-cat:hover {
    background-color: #d5d9d9;
}

#tnt-amz-header-v2 .tnt-hd__search-input.tnt-search-input {
    flex: 1 1 auto; min-width: 0;
    border: none; background: #ffffff; color: #111111;
    font-size: 14px; padding: 0 12px; outline: none;
}
#tnt-amz-header-v2 .tnt-hd__search-input.tnt-search-input::placeholder { color: #777777; }

/* ✅ دکمه جستجو + ذره‌بین بزرگ‌تر */
#tnt-amz-header-v2 .tnt-hd__search-btn.tnt-search-btn {
    width: 55px; min-width: 55px;
    border: none; border-radius: 0 8px 8px 0;
    background: #febd69; color: #111111;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.15s ease;
}
#tnt-amz-header-v2 .tnt-hd__search-btn.tnt-search-btn:hover { background: #f3a847; }

#tnt-amz-header-v2 .tnt-hd__search-btn svg {
    width: 26px; height: 26px;
    stroke: #111111; stroke-width: 2.8;
}

/* ── حساب / سفارش‌ها ── */
#tnt-amz-header-v2 .tnt-hd__account,
#tnt-amz-header-v2 .tnt-hd__orders {
    display: inline-flex; flex-direction: column;
    justify-content: center;
    padding: 6px 8px; flex: 0 0 auto;
}

#tnt-amz-header-v2 .tnt-hd__signin { display: none; }

/* ── سبد خرید (دسکتاپ) ── */
#tnt-amz-header-v2 .tnt-hd__cart {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; flex: 0 0 auto;
}
#tnt-amz-header-v2 .tnt-hd__cart-wrap {
    position: relative; display: inline-flex;
    align-items: center; justify-content: center;
    width: 44px; height: 40px;
}
#tnt-amz-header-v2 .tnt-hd__cart-wrap svg {
    width: 44px; height: 40px;
}

/* ✅ عدد داخل سبد - وسط بدنه سبد */
#tnt-amz-header-v2 .tnt-hd__cart-count {
    position: absolute;
    top: 8px; left: 0; right: 0;
    text-align: center;
    color: #f08804;
    font-size: 14px; font-weight: 800;
    line-height: 1; pointer-events: none;
}

/* ✅ لیبل سبد دو خطی */
#tnt-amz-header-v2 .tnt-hd__cart-label {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    line-height: 1.15;
}
#tnt-amz-header-v2 .tnt-hd__cart-label-1 {
    font-size: 13px; font-weight: 700; color: #ffffff;
}
#tnt-amz-header-v2 .tnt-hd__cart-label-2 {
    font-size: 11px; font-weight: 500; color: #cccccc;
}

/* ── نوار دوم (دسکتاپ) ── */
#tnt-amz-header-v2 .tnt-hd__nav-inner {
    display: flex; align-items: center; gap: 4px;
    min-height: 40px; overflow-x: auto; scrollbar-width: none;
}
#tnt-amz-header-v2 .tnt-hd__nav-inner::-webkit-scrollbar { display: none; }
#tnt-amz-header-v2 .tnt-hd__nav-link {
    display: inline-flex; align-items: center;
    padding: 7px 9px; white-space: nowrap;
    font-size: 14px; line-height: 1.2;
}
#tnt-amz-header-v2 .tnt-hd__nav-link--sale { font-weight: 700; }

/* =========================  Mobile placeholders  ========================= */
#tnt-amz-header-v2 .tnt-hd__mobile-nav,
#tnt-amz-header-v2 .tnt-hd__drawer { display: none; }

/* =========================  Mobile  ========================= */
@media (max-width: 768px) {
    #tnt-amz-header-v2 .tnt-hd__top-inner {
        display: grid;
        grid-template-columns: auto auto 1fr auto auto;
        grid-template-areas:
            "burger logo deliver signin cart"
            "search search search search search";
        align-items: center;
        gap: 8px 8px;
        padding-top: 8px; padding-bottom: 8px;
        min-height: auto;
    }

    /* همبرگر */
    #tnt-amz-header-v2 .tnt-hd__burger {
        grid-area: burger;
        display: inline-flex; align-items: center; justify-content: center;
        width: 38px; height: 38px; padding: 0;
        background: transparent; color: #ffffff;
        border: 1px solid transparent; border-radius: 2px;
        cursor: pointer;
    }
    #tnt-amz-header-v2 .tnt-hd__burger svg {
        width: 24px; height: 24px;
    }

    /* لوگو موبایل */
    #tnt-amz-header-v2 .tnt-hd__logo-link {
        grid-area: logo;
        padding: 4px 4px 4px 0;
        justify-self: start;
    }
    #tnt-amz-header-v2 .tnt-hd__logo-text { font-size: 20px; }
    #tnt-amz-header-v2 .tnt-hd__logo-fa { font-size: 8.5px; margin-top: 2px; }

    /* ✅ ارسال در ردیف بالا - فقط آیکون + متن ریز */
    #tnt-amz-header-v2 .tnt-hd__deliver {
        grid-area: deliver;
        display: inline-flex; align-items: center; gap: 4px;
        padding: 4px 4px; justify-self: end;
        max-width: 100%; overflow: hidden;
    }
    #tnt-amz-header-v2 .tnt-hd__deliver svg {
        width: 14px; height: 14px; flex: 0 0 14px;
        margin-top: 0;
    }
    #tnt-amz-header-v2 .tnt-hd__deliver .tnt-hd__sub    { font-size: 9px;  }
    #tnt-amz-header-v2 .tnt-hd__deliver .tnt-hd__strong { font-size: 11px; }

    /* حساب دسکتاپ مخفی */
    #tnt-amz-header-v2 .tnt-hd__account,
    #tnt-amz-header-v2 .tnt-hd__orders { display: none; }

    /* ✅ ورود موبایل - آدمک کمی بولدتر */
    #tnt-amz-header-v2 .tnt-hd__signin {
        grid-area: signin;
        display: inline-flex; align-items: center; gap: 4px;
        padding: 6px 4px; white-space: nowrap;
        font-size: 13px; font-weight: 500;
    }
    #tnt-amz-header-v2 .tnt-hd__signin svg {
        width: 22px; height: 22px; stroke-width: 2.6;
    }

    /* سبد موبایل */
    #tnt-amz-header-v2 .tnt-hd__cart {
        grid-area: cart; justify-self: end;
        padding: 4px 2px;
    }
    #tnt-amz-header-v2 .tnt-hd__cart-wrap {
        width: 34px; height: 30px;
    }
    #tnt-amz-header-v2 .tnt-hd__cart-wrap svg {
        width: 34px; height: 30px;
    }
    #tnt-amz-header-v2 .tnt-hd__cart-count {
        top: 6px; font-size: 12px;
    }
    #tnt-amz-header-v2 .tnt-hd__cart-label { display: none; }

    /* جستجو ردیف دوم */
    #tnt-amz-header-v2 .tnt-hd__search-wrap.tnt-search {
        grid-area: search; margin: 0; width: 100%;
    }
    #tnt-amz-header-v2 .tnt-hd__search-form.tnt-search-form {
        height: 44px; border-radius: 8px;
    }
    #tnt-amz-header-v2 .tnt-hd__search-cat.tnt-search-cat { display: none; }
    #tnt-amz-header-v2 .tnt-hd__search-input.tnt-search-input { font-size: 15px; }
    #tnt-amz-header-v2 .tnt-hd__search-btn.tnt-search-btn { width: 52px; min-width: 52px; }
    #tnt-amz-header-v2 .tnt-hd__search-btn svg { width: 24px; height: 24px; }

    /* نوار دسکتاپ مخفی */
    #tnt-amz-header-v2 .tnt-hd__nav-inner { display: none; }

    /* نوار افقی موبایل */
    #tnt-amz-header-v2 .tnt-hd__mobile-nav {
        display: block; background: #232f3e;
    }
    #tnt-amz-header-v2 .tnt-hd__mobile-nav-inner {
        display: flex; align-items: center; gap: 14px;
        overflow-x: auto; white-space: nowrap;
        scrollbar-width: none;
        min-height: 40px; padding-top: 8px; padding-bottom: 8px;
    }
    #tnt-amz-header-v2 .tnt-hd__mobile-nav-inner::-webkit-scrollbar { display: none; }
    #tnt-amz-header-v2 .tnt-hd__mobile-nav-link {
        display: inline-flex; align-items: center;
        white-space: nowrap; font-size: 14px;
        line-height: 1.2; color: #ffffff;
    }

    /* drawer */
    #tnt-amz-header-v2 .tnt-hd__drawer {
        display: none; background: #ffffff; color: #111111;
        border-top: 1px solid #d5d9d9;
        box-shadow: 0 6px 18px rgba(0,0,0,0.14);
    }
    #tnt-amz-header-v2 .tnt-hd__drawer.is-open { display: block; }
    #tnt-amz-header-v2 .tnt-hd__drawer-inner { padding-top: 12px; padding-bottom: 14px; }
    #tnt-amz-header-v2 .tnt-hd__drawer-title {
        color: #111111; font-size: 16px; font-weight: 700; margin: 0 0 10px;
    }
    #tnt-amz-header-v2 .tnt-hd__drawer-list { list-style: none; margin: 0; padding: 0; }
    #tnt-amz-header-v2 .tnt-hd__drawer-list li + li { border-top: 1px solid #eaeded; }
    #tnt-amz-header-v2 .tnt-hd__drawer-list a {
        display: block; color: #111111;
        padding: 12px 0; font-size: 14px; line-height: 1.4;
    }
}
