/* ========== کلی و تم زرد ========== */
:root {
    --yellow: #FFC107;
    --yellow-dark: #FFA000;
    --yellow-light: #FFF8E1;
    --black: #212121;
    --white: #FFFFFF;
    --gray: #F5F5F5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gray);
    color: var(--black);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========== هدر ========== */
.header {
    background: var(--yellow);
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-right { flex: 1; text-align: right; }
.header-center { flex: 1; text-align: center; }
.header-left {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.shop-name-fa {
    font-size: 26px;
    color: var(--black);
    font-weight: 900;
}

.shop-name-en {
    font-size: 16px;
    color: #5D4037;
    font-weight: 400;
}

.logo {
    height: 55px;
    width: auto;
    cursor: pointer;
    transition: transform 0.3s;
}

.logo:hover { transform: scale(1.05); }

.cart-link-header {
    display: inline-block;
    background: var(--white);
    color: var(--black);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cart-link-header:hover {
    background: var(--black);
    color: var(--yellow);
    transform: scale(1.05);
}

/* ========== اسلایدر ========== */
.slider {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
}

.slides { position: relative; height: 100%; }

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.slide.active { opacity: 1; }

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-text {
    position: absolute;
    top: 50%;
    right: 10%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.7);
    padding: 30px 40px;
    border-radius: 15px;
    color: var(--white);
    text-align: center;
    border: 2px solid var(--yellow);
    backdrop-filter: blur(5px);
}

.slide-text h2 { font-size: 36px; margin-bottom: 10px; color: var(--yellow); }
.slide-text p { font-size: 18px; margin-bottom: 20px; }

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--yellow);
    color: var(--black);
    text-decoration: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--yellow-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,193,7,0.4);
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid var(--yellow);
}

.dot.active {
    background: var(--yellow);
    transform: scale(1.3);
}

/* ========== دسته‌بندی‌ها ========== */
.categories {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
    color: var(--black);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--yellow);
    margin: 15px auto 0;
    border-radius: 2px;
}

.cat-container {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.cat-box {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
    padding: 20px;
    width: 300px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.cat-box:hover {
    transform: translateY(-8px);
    border-color: var(--yellow);
    box-shadow: 0 8px 25px rgba(255,193,7,0.2);
}

.cat-box img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.cat-box h3 {
    margin-bottom: 12px;
    color: var(--black);
    font-size: 20px;
}

.cat-link {
    display: inline-block;
    padding: 10px 25px;
    background: var(--yellow);
    color: var(--black);
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s;
}

.cat-link:hover {
    background: var(--yellow-dark);
    transform: scale(1.05);
}

/* ========== محصولات ========== */
.products {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

@media (max-width: 992px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
    padding: 15px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--yellow);
    box-shadow: 0 8px 25px rgba(255,193,7,0.2);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: transform 0.3s;
}

.product-card:hover img { transform: scale(1.03); }

.product-card h3 {
    margin-bottom: 5px;
    font-size: 18px;
}

.product-card h3 a {
    color: var(--black);
    transition: color 0.3s;
}

.product-card h3 a:hover { color: var(--yellow-dark); }

.price {
    font-size: 22px;
    font-weight: bold;
    color: var(--yellow-dark);
    margin: 10px 0;
}

.color-options { margin: 10px 0; }

.color-dot {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin: 0 3px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.color-dot:hover {
    border-color: var(--yellow);
    transform: scale(1.2);
}

/* ========== گروه افزودن به سبد ========== */
.add-to-cart-group {
    margin-top: 10px;
}

.quantity-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 8px;
}

.quantity-inline button {
    width: 32px;
    height: 32px;
    background: var(--yellow);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
}

.quantity-inline button:hover {
    background: var(--yellow-dark);
}

.qty-input {
    width: 50px;
    height: 32px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
}

.qty-input:focus {
    border-color: var(--yellow);
    outline: none;
}

.stock-info {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.stock-info.out-of-stock {
    color: #f44336;
    font-weight: bold;
}

.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    background: var(--yellow);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    margin-top: 5px;
}

.add-to-cart-btn:hover {
    background: var(--yellow-dark);
    transform: scale(1.02);
}

/* ========== صفحه محصول تکی ========== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.back-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--white);
    color: var(--black);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #ddd;
    font-size: 16px;
}

.back-btn:hover {
    background: var(--yellow);
    border-color: var(--yellow);
}

.product-single {
    display: flex;
    gap: 40px;
    padding: 30px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
    .product-single { flex-direction: column; }
}

.product-single > img {
    width: 50%;
    border-radius: 15px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .product-single > img { width: 100%; }
}

.product-details {
    flex: 1;
    padding: 20px;
}

.product-details h1 {
    font-size: 32px;
    margin-bottom: 15px;
    color: var(--black);
}

.product-details .description {
    font-size: 17px;
    line-height: 2;
    color: #666;
    margin: 20px 0;
}

.product-details .price-large {
    font-size: 36px;
    color: var(--yellow-dark);
    font-weight: bold;
    margin: 20px 0;
}

.product-details .btn {
    font-size: 18px;
    padding: 15px 40px;
}

/* ========== سبد خرید (پنل کناری) ========== */
.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
}

.cart-overlay.active { display: block; }

.cart-panel {
    position: fixed;
    top: 0;
    left: -420px;
    width: 400px;
    height: 100%;
    background: var(--white);
    z-index: 2000;
    transition: left 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 25px rgba(0,0,0,0.2);
}

@media (max-width: 480px) {
    .cart-panel { width: 100%; left: -100%; }
}

.cart-panel.active { left: 0; }

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--yellow);
    color: var(--black);
}

.cart-header h3 { font-size: 22px; }

.close-cart {
    font-size: 28px;
    cursor: pointer;
    color: var(--black);
    transition: transform 0.3s;
}

.close-cart:hover { transform: rotate(90deg); }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart {
    text-align: center;
    color: #999;
    margin-top: 80px;
    font-size: 18px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
}

.cart-item-details { flex: 1; }

.cart-item-details h4 { margin-bottom: 5px; font-size: 16px; }

.cart-item-details .price { font-size: 18px; }

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    background: var(--yellow);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
}

.quantity-control button:hover {
    background: var(--yellow-dark);
    transform: scale(1.1);
}

.quantity-control span { font-size: 18px; font-weight: bold; }

.remove-item {
    background: #ff4444;
    color: var(--white);
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 8px;
    font-size: 13px;
    transition: all 0.3s;
}

.remove-item:hover { background: #cc0000; }

.cart-footer {
    padding: 20px;
    background: var(--gray);
    border-top: 2px solid var(--yellow);
    text-align: center;
}

.cart-total {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--black);
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
}

.cancel-all-btn {
    background: #f44336 !important;
    color: white !important;
    margin-top: 10px;
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.cancel-all-btn:hover {
    background: #d32f2f !important;
    transform: scale(1.02);
}

/* ========== فوتر ========== */
.footer {
    background: var(--black);
    color: var(--white);
    padding: 50px 0 0;
    margin-top: 80px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    padding: 0 20px 30px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--yellow);
}

.footer-section p {
    margin-bottom: 10px;
    color: #ccc;
    line-height: 2;
}

.footer-section a {
    display: block;
    color: #ccc;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.footer-section a:hover { color: var(--yellow); }

.footer-bottom {
    background: #111;
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.footer-bottom p { color: #888; font-size: 14px; }

.yellow-text { color: var(--yellow); font-weight: bold; }

/* ========== مودال فرم سفارش ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2500;
    justify-content: center;
    align-items: center;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    border: 3px solid var(--yellow);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #888;
    transition: color 0.3s;
}

.close:hover { color: var(--yellow-dark); }

.modal-content h2 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--yellow-dark);
    font-size: 24px;
}

#orderSummary {
    background: var(--yellow-light);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 2;
}

#orderForm input,
#orderForm textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

#orderForm input:focus,
#orderForm textarea:focus {
    border-color: var(--yellow);
    outline: none;
}

#orderForm textarea {
    height: 100px;
    resize: vertical;
}

#orderForm button {
    width: 100%;
    padding: 14px;
    background: var(--yellow);
    color: var(--black);
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

#orderForm button:hover {
    background: var(--yellow-dark);
    transform: scale(1.02);
}

/* ========== دکمه‌های زیرمجموعه ========== */
.subcategory-buttons {
    text-align: center;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.subcat-btn {
    padding: 8px 20px;
    background: var(--white);
    border: 2px solid #ddd;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
    color: var(--black);
}

.subcat-btn:hover {
    border-color: var(--yellow);
    background: var(--yellow-light);
}

.subcat-btn.active {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--black);
}