﻿/* استایل بخش هیرو */
.hero {
    background: linear-gradient(to left, var(--light-green), var(--white));
    padding: 0.25rem 0;
    margin: 2rem 0;
    border-radius: 10px;
    text-align: center;
}

    .hero h1 {
        color: var(--dark-text);
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }

    .hero p {
        color: var(--light-text);
        font-size: 1.1rem;
        max-width: 600px;
        margin: 0 auto 2rem;
    }

.cta-button {
    background-color: var(--primary-green);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

    .cta-button:hover {
        background-color: var(--dark-text);
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

/* استایل بخش محصولات */
.products-section {
    padding: 0.25rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark-text);
    position: relative;
    padding-bottom: 15px;
}

    .section-title:after {
        content: '';
        display: block;
        width: 80px;
        height: 3px;
        background-color: var(--primary-green);
        margin: 10px auto;
    }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}


.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card {
    background: white;
    border-radius: 16px;
    padding: 0px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e8f5e8;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

    .product-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 8px 30px rgba(46, 125, 50, 0.15);
        border-color: #2e7d32;
    }

.product-image {
  position: relative;
  aspect-ratio: 4 / 5;        /* نسبت ثابت کارت */
  overflow: hidden;
  border-radius: 12px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0);   /* جلوگیری از بلور روی هاور */
  will-change: transform;
}

/* اگر هاور می‌خواهی، تصویر بزرگ نشود؛ کانتینر سایه بگیرد */
.product-card:hover .product-image {
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}


.discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #d32f2f, #f44336);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
    z-index: 2;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    margin: 0 0 12px 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    height: 3.2em;
    overflow: hidden;
}

    .product-title a {
        color: #1b5e20;
        text-decoration: none;
        transition: color 0.3s ease;
    }

        .product-title a:hover {
            color: #2e7d32;
        }

.product-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.product-price {
    direction: rtl;
    margin: 16px 0;
}

.current-price, .original-price {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

    .current-price .price-amount {
        font-size: 1.5rem;
        font-weight: 800;
        color: #445645;
        text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }

    .current-price .currency {
        font-size: 0.95rem;
        color: #4caf50;
        align-self: flex-end;
        margin-bottom: 3px;
        font-weight: 600;
    }

.original-price {
    text-decoration: line-through;
    color: #999;
    margin-top: 6px;
}

    .original-price .price-amount {
        font-size: 1.1rem;
    }

    .original-price .currency {
        font-size: 0.85rem;
    }

.price-unit-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    padding: 10px 12px;
    margin: 12px 0;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #1976d2;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 40px;
    justify-content: center;
}

    .price-unit-info i {
        font-size: 0.9rem;
        margin-left: 0.5rem;
        flex-shrink: 0;
    }


.add-to-cart {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: white;
    border: none;
    padding: 14px 17px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
    position: relative;
    overflow: hidden;
}

    .add-to-cart:hover {
        background: linear-gradient(135deg, #1b5e20, #2e7d32);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
    }

    .add-to-cart:active {
        transform: translateY(0);
    }



.no-products {
    text-align: center;
    color: #666;
    font-size: 16px;
    padding: 40px;
}


/* طراحی ریسپانسیو */
@@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@@media (max-width: 768px) {
    .product-card {
        padding: 16px;
    }

    .product-image {
        height: 180px;
    }

    .current-price .price-amount {
        font-size: 1.3rem;
    }

    .add-to-cart {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

@@media (max-width: 480px) {
    .product-card {
        padding: 14px;
    }

    .product-image {
        height: 160px;
    }

    .product-title {
        font-size: 1.1rem;
    }
}

/* استایل‌های جدید برای هدر و دکمه‌ها */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.auth-section {
    display: flex;
    align-items: center;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.login-btn {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: white;
    box-shadow: 0 2px 10px rgba(46, 125, 50, 0.3);
}

.register-btn {
    background: transparent;
    color: #2e7d32;
    border-color: #2e7d32;
}

.profile-btn, .orders-btn, .logout-btn {
    width: 100%;
    text-align: right;
    justify-content: flex-start;
    border-radius: 8px;
    margin-bottom: 5px;
    background: transparent;
    color: #333;
    border: none;
    box-shadow: none;
}
    .profile-btn:hover, .orders-btn:hover {
        background: #f5f5f5;
        color: #2e7d32;
    }

    .logout-btn:hover {
        background: #ffebee;
        color: #d32f2f;
    }

.cart-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #FF9800, #FF5722);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 152, 0, 0.3);
    position: relative;
}

    .cart-icon:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
        background: linear-gradient(135deg, #F57C00, #E64A19);
    }

.cart-counter {
    background: #fff;
    color: #FF5722;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* استایل‌های جدید برای منوی کشویی کاربر */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2196F3, #21CBF3);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(33, 150, 243, 0.3);
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
}

    .user-toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
        background: linear-gradient(135deg, #1976D2, #1E88E5);
    }

.user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 10px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid #e0e0e0;
}

    .user-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .user-dropdown::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 20px;
        width: 16px;
        height: 16px;
        background: white;
        transform: rotate(45deg);
        border-top: 1px solid #e0e0e0;
        border-left: 1px solid #e0e0e0;
    }

.user-info {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
}

.user-name {
    font-weight: 700;
    color: #2e7d32;
    font-size: 0.95rem;
}

.user-email {
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

    .dropdown-item:hover {
        background: #f5f5f5;
        color: #2e7d32;
    }

.dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 8px 0;
}

/* افزایش عرض کلی صفحه */
.container {
    max-width: 1400px;
}

/* رسپانسیو برای هدر */
@media (max-width: 768px) {
    .header-actions {
        gap: 12px;
    }

    .auth-buttons {
        gap: 8px;
    }

    .auth-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .user-toggle span {
        display: none;
    }

    .user-toggle {
        padding: 10px;
    }

    .cart-icon span:not(.cart-counter) {
        display: none;
    }

    .cart-icon {
        padding: 10px;
    }

    .user-dropdown {
        width: 180px;
        left: -80px;
    }

        .user-dropdown::before {
            left: 90px;
        }
}


/* استایل بخش فوتر */
footer {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
    position: relative;
    min-height: 200px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

    .footer-section h3 {
        color: #fff;
        margin-bottom: 15px;
        font-size: 1.2rem;
        border-bottom: 2px solid #4caf50;
        padding-bottom: 8px;
        display: inline-block;
    }

    .footer-section p {
        line-height: 1.6;
        margin-bottom: 10px;
        color: #e0e0e0;
    }

.contact-info p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.contact-info i {
    color: #4caf50;
    width: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

    .social-links a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: white;
        text-decoration: none;
        transition: all 0.3s ease;
    }

        .social-links a:hover {
            background: #4caf50;
            transform: translateY(-3px);
        }

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdbdbd;
    font-size: 0.9rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.orders-btn {
    background: linear-gradient(135deg, #9C27B0, #E91E63);
    color: white;
    box-shadow: 0 2px 10px rgba(156, 39, 176, 0.3);
}

    .orders-btn:hover {
        background: linear-gradient(135deg, #7B1FA2, #C2185B);
    }

/* استایل لوگوی enamad در سمت چپ پایین */
.enamad-logo {
    position: absolute;
    left: 20px;
    z-index: 10;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid #4caf50;
}

    .enamad-logo img {
        width: 80px;
        height: auto;
        display: block;
        border-radius: 4px;
    }

    .enamad-logo:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }

/* رسپانسیو برای فوتر */
@media (max-width: 1024px) {
    .footer-content {
        flex-wrap: wrap;
    }

    .footer-section {
        min-width: 45%;
    }
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 25px;
        padding: 0 15px;
    }

    .footer-section {
        text-align: center;
        min-width: 100%;
    }

    .contact-info p {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

    .enamad-logo {
        position: relative;
        left: auto;
        bottom: auto;
        margin: 20px auto 0;
        width: fit-content;
    }

        .enamad-logo img {
            width: 70px;
        }
}

@media (max-width: 480px) {
    footer {
        padding: 30px 0 15px;
    }

    .enamad-logo {
        margin: 15px auto 0;
    }

        .enamad-logo img {
            width: 60px;
        }

    .footer-section h3 {
        font-size: 1.1rem;
    }
}