/* ========== متغیرها ========== */
:root {
    --cream-bg: #F9F6F0;
    --white: #FFFFFF;
    --black: #1E1E1E;
    --gray-dark: #4A4A4A;
    --gray: #7D7D7D;
    --brown: #8B5A2B;
    --brown-light: #C19A6B;
    --soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    --radius: 16px;
}

/* ========== کلی ========== */
body {
    background-color: var(--cream-bg);
    color: var(--black);
    font-size: 16px;
    line-height: 1.8;
}

a {
    color: var(--brown);
    text-decoration: none;
    transition: 0.3s;
}

a:hover {
    color: var(--black);
}

/* ========== هدر ========== */
.main-header {
    background: var(--white);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
}

.logo span {
    font-size: 30px;
    font-weight: bold;
    color: var(--brown);
    letter-spacing: 1px;
}

.desktop-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 2.2rem;
    margin: 0;
}

.desktop-nav .nav-list li a {
    color: var(--black);
    font-weight: 600;
    padding: 10px 0;
    position: relative;
    transition: color 0.3s;
}

.desktop-nav .nav-list li a:hover {
    color: var(--brown);
}

.desktop-nav .nav-list li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brown);
    transition: width 0.3s;
}

.desktop-nav .nav-list li a:hover::after {
    width: 100%;
}

/* ========== منوی کشویی ========== */
.dropdown-menu {
    background-color: var(--white);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 0.5rem 0;
    min-width: 220px;
    z-index: 1020;
    margin-top: 0.5rem;
}

.dropdown-item {
    color: var(--black) !important;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    transition: all 0.2s;
    background-color: transparent;
    display: block;
    white-space: nowrap;
}

.dropdown-item:hover {
    background-color: #f5efe7;
    color: var(--brown) !important;
}

.dropdown-menu[data-bs-popper] {
    right: 0;
    left: auto;
    text-align: right;
}

/* ========== بخش سمت چپ هدر ========== */
.header-left {
    display: flex;
    align-items: center;
}

.timer-box {
    background: #f3efe7;
    border-radius: 30px;
    padding: 6px 18px;
    display: flex;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--brown);
}

.cart-icon {
    color: var(--black);
    font-size: 28px;
    position: relative;
    transition: transform 0.3s;
}

.cart-icon:hover {
    transform: scale(1.1);
    color: var(--brown);
}

.cart-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--brown);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 32px;
    color: var(--black);
    cursor: pointer;
}

/* ========== منوی موبایل ========== */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    transition: right 0.3s ease;
    padding: 80px 20px 20px;
}

.mobile-nav.active {
    right: 0;
}

.close-mobile {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 32px;
    background: none;
    border: none;
    color: var(--black);
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
}

.mobile-nav li a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
    color: var(--black);
    font-weight: 600;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    display: none;
}

.mobile-overlay.active {
    display: block;
}

/* ========== دکمه کلاسیک ========== */
.btn-classic {
    background: var(--brown);
    color: white;
    border: none;
    padding: 14px 34px;
    border-radius: 40px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(139, 90, 43, 0.25);
}

.btn-classic:hover {
    background: var(--black);
    color: white;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    transform: translateY(-3px);
}

/* ========== اسلایدر Swiper ========== */
.hero-slider .heroSwiper {
    height: 85vh;
    min-height: 500px;
}

.heroSwiper .swiper-slide {
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.heroSwiper .swiper-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.7));
}

.slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 650px;
    padding: 20px;
}

.slide-content h2 {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 4px 15px rgba(0, 0, 0, 0.5);
}

.slide-content p {
    font-size: 1.4rem;
    margin-bottom: 30px;
}

.swiper-button-next,
.swiper-button-prev {
    color: white;
    background: rgba(0, 0, 0, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.swiper-pagination-bullet {
    background: white;
    opacity: 0.7;
}

.swiper-pagination-bullet-active {
    background: var(--brown);
}

/* ========== جستجو ========== */
.search-section {
    padding: 30px 0;
    background: var(--white);
    border-bottom: 1px solid #f0ebe1;
}

.search-wrapper {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.search-wrapper .input-group {
    background: white;
    border-radius: 50px;
    border: 1px solid #e0d5c7;
}

.search-wrapper .input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(139, 90, 43, 0.1);
    border-color: var(--brown);
}

.search-wrapper .form-control,
.search-wrapper .form-select {
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 15px;
    height: 52px;
}

.search-wrapper .form-select {
    color: var(--gray-dark);
    cursor: pointer;
    border-right: 1px solid #e0d5c7;
    border-left: 1px solid #e0d5c7;
    max-width: 180px;
}

.btn-search {
    background: var(--brown);
    color: white;
    border: none;
    padding: 0 28px;
    border-radius: 0 50px 50px 0;
}

.search-results {
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--hover-shadow);
    max-height: 450px;
    overflow-y: auto;
    z-index: 500;
    display: none;
}

.search-results.active {
    display: block;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #fcf8f3;
    transition: background 0.2s;
}

.search-item:hover {
    background: #fdfaf3;
}

.search-item img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 10px;
    margin-left: 15px;
}

.search-item-info {
    flex: 1;
}

.search-item-name {
    font-weight: bold;
}

.search-item-price {
    color: var(--brown);
    font-size: 14px;
}

.search-item-add {
    color: var(--brown);
    cursor: pointer;
    font-size: 20px;
}

.search-item-add:hover {
    color: var(--black);
}

/* ========== دسته‌بندی دایره‌ای ========== */
.section-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 40px;
    position: relative;
    color: var(--black);
    font-size: 2rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--brown);
    margin: 15px auto 0;
    border-radius: 2px;
}

.circle-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.circle-item {
    text-align: center;
    width: 110px;
    transition: transform 0.3s;
}

.circle-item:hover {
    transform: translateY(-5px);
}

.circle-img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    border: 3px solid transparent;
    margin: 0 auto 12px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.circle-item:hover .circle-img {
    border-color: var(--brown-light);
    box-shadow: 0 15px 25px rgba(139, 90, 43, 0.15);
}

.circle-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.circle-name {
    font-weight: 600;
    color: var(--black);
    font-size: 14px;
}

/* ========== کارت محصول ========== */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--soft-shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
}

.product-img {
    height: 240px;
    overflow: hidden;
    position: relative;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

.product-card:hover .product-img img {
    transform: scale(1.08);
}

.product-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--brown);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.product-body {
    padding: 20px;
    text-align: center;
    flex-grow: 1;
}

.product-body h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--black);
}

.price {
    color: var(--brown);
    font-weight: bold;
    margin-bottom: 15px;
}

.btn-view {
    background: var(--cream-bg);
    color: var(--brown);
    border: 1px solid var(--brown-light);
    border-radius: 30px;
    padding: 8px 25px;
    transition: 0.3s;
    font-weight: 600;
}

.btn-view:hover {
    background: var(--brown);
    color: white;
    border-color: var(--brown);
}

/* ========== فوتر ========== */
.main-footer {
    background: #1c1c1c;
    color: #cccccc;
    padding: 50px 0 20px;
}

.main-footer h5 {
    color: var(--brown-light);
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li a {
    color: #999;
}

.footer-links li a:hover {
    color: white;
}

.copyright {
    border-top: 1px solid #333;
    padding-top: 20px;
    color: #777;
}

/* ========== سبد خرید ========== */
.cart-table {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--soft-shadow);
}

.cart-table th {
    font-weight: 600;
    padding: 15px;
    background: #fcf8f3;
    border-bottom: 2px solid #e0d3c2;
    color: var(--black);
}

.cart-table td {
    padding: 15px;
    vertical-align: middle;
}

.qty-input {
    max-width: 50px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    font-weight: bold;
    color: #000;
    height: 38px;
    outline: none;
}

.qty-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.qty-btn:hover:not(:disabled) {
    background: #8B5A2B;
    color: white;
    border-color: #8B5A2B;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.remove-btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: 0.3s;
}

.remove-btn svg {
    width: 18px;
    height: 18px;
}

.remove-btn:hover {
    background: #dc3545;
    color: white;
}

.subtotal {
    font-weight: bold;
    color: var(--brown);
}

/* ========== انعطاف‌پذیری عمومی برای input های فقط خواندنی ========== */
input[readonly] {
    background-color: #fff !important;
    color: #000 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #000 !important;
    cursor: default;
}

/* ========== حالت موبایل ========== */
@media (max-width: 992px) {
    .desktop-nav {
        display: none;
    }

    .hamburger-btn {
        display: block;
    }

    .hero-slider .heroSwiper {
        height: 60vh;
    }

    .slide-content h2 {
        font-size: 2.2rem;
    }

    .circle-grid {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .cart-table {
        border: 1px solid #e0d3c2;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        background: white;
        font-size: 14px;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border-bottom: 1px solid #eee;
        padding: 10px 0;
        background: white;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .cart-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 15px;
        border: none;
        text-align: right;
        gap: 10px;
    }

    .cart-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--brown);
        min-width: 80px;
        text-align: right;
    }

    /* هماهنگ‌سازی اندازه‌های اینپوت و دکمه‌ها */
    .qty-input {
        width: 50px;
        height: 36px;
        font-size: 15px;
        font-weight: bold;
        text-align: center;
        border: 1px solid #aaa;
        border-radius: 6px;
        background: #fff !important;
        color: #000 !important;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    .qty-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
        line-height: 36px;
        /* عمودی وسط */
        border-radius: 50%;
        border: 1px solid #ccc;
        background: white;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    .cart-table .input-group {
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        /* عمودی وسط */
        gap: 4px;
    }

    .cart-table td img {
        width: 60px;
        height: 60px;
        object-fit: cover;
    }

    .remove-btn {
        width: 36px;
        height: 36px;
    }

    .subtotal {
        font-size: 15px;
    }
}

/* رفع مشکل دیده نشدن عدد داخل اینپوت تعداد در موبایل */
@media (max-width: 768px) {

    .qty-input,
    .qty-input[readonly] {
        background-color: #ffffff !important;
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
        opacity: 1 !important;
        border: 1px solid #666 !important;
        font-size: 16px !important;
        font-weight: bold !important;
        text-align: center !important;
        padding: 0 !important;
        width: 60px !important;
        height: 40px !important;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    }
}