/* ==========================================================================
   Variables (Design Tokens)
   ========================================================================== */
:root {
    --color-primary: #2f5d50;
    --color-primary-dark: #23473d;
    --color-accent: #c8783f;
    --color-bg: #f4f3ef;
    --color-surface: #ffffff;
    --color-dark-bg: #1a1c1e;
    --color-dark-surface: #26292c;
    --color-text-dark: #222222;
    --color-text-muted: #666666;
    --color-border: #e8e5e1;
    --color-border-light: #f0ede8;

    --font-fa: "ray", sans-serif;
    --font-en: "Inter", sans-serif;

    --container-width: 1240px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Reset & Base Layout
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden; /* اینجا منتقل شد؛ چون body یکی از والدهای .sidebar هست، overflow روش باعث می‌شد position: sticky از کار بیفته. html خودش ریشه‌ی viewport هست، پس این مشکل رو نداره */
}

body {
    font-family: var(--font-fa);
    background-color: var(--color-bg);
    color: var(--color-text-dark);
    direction: rtl;
    text-align: right;
    line-height: 1.6;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

header,
footer.footer {
    width: 100%;
    flex-shrink: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-surface);
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
}

.btn--outline-light {
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--color-surface);
}

.btn--outline-light:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn--sm {
    padding: 6px 16px;
    font-size: 12px;
}

.btn--light {
    background-color: var(--color-surface);
    color: var(--color-text-dark);
}

/* ==========================================================================
   Header & Nav
   ========================================================================== */
.header {
    background-color: var(--color-dark-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 24px;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header__logo-img {
    height: 55px;
    width: auto;
    display: block;
    object-fit: contain;
}

.header__logo-symbol {
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 24px;
    color: #ffffff;
}

.header__logo-title {
    display: block;
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
    line-height: 1.1;
}

.header__logo-tagline {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.header__search {
    flex: 1;
    width: 520px;
    display: flex;
    align-items: center;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    padding: 4px 6px 4px 16px;
}

.header__search-select {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-left: 1px solid var(--color-border);
    font-size: 13px;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.header__search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    min-width: 60px;
}

.header__search-btn {
    display: flex;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.header__user-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header__action-btn {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
}

.logout-btn {
    color: white;
}

.header__icon-btn {
    display: flex;
    position: relative;
    padding: 4px;
    color: #ffffff;
    flex-shrink: 0;
}

.header__cart-badge {
    position: absolute;
    top: -2px;
    left: -4px;
    background-color: var(--color-accent);
    color: var(--color-surface);
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-en);
}

.nav {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav__list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 12px 0;
}

.nav__link {
    font-size: 14px;
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.nav__link--active,
.nav__link:hover {
    color: var(--color-accent);
}

.nav__link--active::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-accent);
    border-radius: var(--radius-full);
}

/* ==========================================================================
   Hamburger Button & Off-canvas Mobile Navigation
   ========================================================================== */
.header__hamburger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.header__hamburger:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.header__hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #ffffff;
    border-radius: var(--radius-full);
    transition:
        transform var(--transition-fast),
        opacity var(--transition-fast);
}

.header__hamburger--active .header__hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header__hamburger--active .header__hamburger-line:nth-child(2) {
    opacity: 0;
}

.header__hamburger--active .header__hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav__drawer-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border-light);
}

.nav__drawer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav__drawer-logo .header__logo-title {
    font-size: 15px;
}

.nav__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.nav__close:hover {
    background-color: var(--color-bg);
    color: var(--color-text-dark);
}

.nav__overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    transition:
        opacity var(--transition-fast),
        visibility var(--transition-fast);
}

.nav__overlay--active {
    opacity: 1;
    visibility: visible;
}

body.no-scroll {
    overflow: hidden;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer.footer {
    display: block !important;
    background-color: #1a1c1e !important;
    color: #ffffff !important;
    padding: 48px 0 0 0 !important;
    margin-top: 0 !important;
    width: 100% !important;
    direction: rtl !important;
    font-family: var(--font-fa) !important;
    flex-shrink: 0;
}

footer.footer .container {
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
    direction: rtl !important;
}

footer.footer .footer__main {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr 1.5fr !important;
    gap: 32px !important;
    padding-bottom: 40px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    direction: rtl !important;
    text-align: right !important;
}

footer.footer .footer__col {
    text-align: right !important;
    direction: rtl !important;
}

footer.footer .footer__col--brand {
    grid-column: auto !important;
}

footer.footer .footer__logo {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 1rem;
    gap: 10px !important;
    justify-content: flex-start !important;
    direction: rtl !important;
}

footer.footer .footer__logo-symbol {
    font-family: var(--font-en) !important;
    font-weight: 700 !important;
    font-size: 24px !important;
    color: #ffffff !important;
}

footer.footer .footer__logo-img {
    height: 50px !important;
    width: 70px !important;
    display: block !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}

footer.footer .footer__logo-title {
    display: block !important;
    font-family: var(--font-en) !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    color: #ffffff !important;
}

footer.footer .footer__logo-tagline {
    display: block !important;
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

footer.footer .footer__title {
    font-size: 14px !important;
    font-weight: 700 !important;
    margin-bottom: 12px !important;
    color: #ffffff !important;
    text-align: right !important;
}

footer.footer .footer__desc {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    margin-bottom: 8px !important;
    line-height: 1.8 !important;
    text-align: right !important;
}

footer.footer .footer__read-more {
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    display: inline-block !important;
}

footer.footer .footer__read-more:hover {
    color: #c8783f !important;
}

footer.footer .footer__links {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: right !important;
}

footer.footer .footer__links li {
    margin-bottom: 8px !important;
    text-align: right !important;
    list-style: none !important;
}

footer.footer .footer__links a {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}

footer.footer .footer__links a:hover {
    color: #c8783f !important;
}

footer.footer .footer__socials {
    display: flex !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
}

footer.footer .footer__socials a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: rgba(255, 255, 255, 0.7) !important;
    transition:
        opacity 0.2s,
        color 0.2s !important;
}

footer.footer .footer__socials a svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
}

footer.footer .footer__socials a:hover {
    opacity: 0.85 !important;
    color: #c8783f !important;
}

footer.footer .footer__subtitle {
    font-size: 12px !important;
    margin-bottom: 2px !important;
    color: #ffffff !important;
    text-align: right !important;
}

footer.footer .footer__subtext {
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    margin-bottom: 10px !important;
    text-align: right !important;
}

footer.footer .footer__newsletter-form {
    display: flex !important;
    background-color: #26292c !important;
    border-radius: 9999px !important;
    padding: 4px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    direction: rtl !important;
}

footer.footer .footer__newsletter-form input {
    flex: 1 !important;
    background: transparent !important;
    border: none !important;
    padding: 6px 12px !important;
    font-family: inherit !important;
    font-size: 12px !important;
    color: #ffffff !important;
    outline: none !important;
    min-width: 80px !important;
    text-align: right !important;
}

footer.footer .footer__newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

footer.footer .footer__newsletter-form button {
    width: 32px !important;
    height: 32px !important;
    background-color: #ffffff !important;
    color: #1a1c1e !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    border: none !important;
    transition: all 0.2s !important;
}

footer.footer .footer__newsletter-form button:hover {
    background-color: #c8783f !important;
    color: #ffffff !important;
}

footer.footer .footer__trust-bar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 24px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
}

footer.footer .trust-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

footer.footer .trust-item__icon {
    color: rgba(255, 255, 255, 0.8) !important;
    flex-shrink: 0 !important;
}

footer.footer .trust-item__text {
    display: flex !important;
    flex-direction: column !important;
    text-align: right !important;
}

footer.footer .trust-item__text strong {
    font-size: 12px !important;
    color: #ffffff !important;
}

footer.footer .trust-item__text span {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

footer.footer .footer__bottom {
    padding: 16px 0 !important;
    text-align: center !important;
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ==========================================================================
   Refund / Info Notice (generic reusable component)
   ========================================================================== */
.refund-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 16px 0;
    padding: 16px 18px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-right: 4px solid #f59e0b;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.12);
}

.refund-notice-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fef3c7;
    color: #b45309;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refund-notice-body {
    flex: 1;
    min-width: 0;
}

.refund-notice-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
}

.refund-notice-text {
    margin: 0;
    font-size: 12px;
    line-height: 2;
    color: #78350f;
    text-align: justify;
}

.refund-notice-text strong {
    font-weight: 700;
    color: #92400e;
}

@keyframes refund-notice-pulse {
    0%,
    100% {
        box-shadow: 0 1px 3px rgba(245, 158, 11, 0.12);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.18);
    }
}
