/* =================================================================
   ROOT VARIABLES & GENERAL STYLES
   ================================================================= */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color-dark: #212529;
    --text-color-light: #6c757d;
    --background-color: #f8f9fa;
    --white-color: #ffffff;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --danger-color: #dc3545;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color-dark);
    line-height: 1.7;
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =================================================================
   STORE HEADER & NAVIGATION
   ================================================================= */
.store-header {
    background: var(--white-color);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.5rem 0;
}

.store-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.store-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-color-dark);
}

.store-logo img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 8px;
}

.store-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 450px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box button {
    position: absolute;
    left: 8px; /* For RTL */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-color-light);
    cursor: pointer;
    font-size: 1.1rem;
}

.store-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-color-dark);
}

.btn-outline:hover {
    background-color: var(--light-gray);
    border-color: #ccc;
}

.cart-btn {
    position: relative;
    background: var(--primary-color);
    color: var(--white-color);
    border: none;
}

.cart-btn:hover {
    background: var(--secondary-color);
}

.cart-count {
    background: var(--danger-color);
    color: var(--white-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    position: absolute;
    top: -5px;
    right: -8px;
}

/* =================================================================
   HERO SECTION
   ================================================================= */
.hero-section {
    position: relative;
    color: var(--white-color);
    padding: 6rem 2rem;
    text-align: center;
    background-size: cover;
    background-position: center;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.6));
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* =================================================================
   PRODUCT GRID & CARDS
   ================================================================= */
main .container {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.product-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--white-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-name a {
    color: var(--text-color-dark);
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.add-to-cart {
    width: 100%;
    background: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin-top: auto; /* Pushes button to the bottom */
}

.add-to-cart:hover {
    background: var(--secondary-color);
}

/* =================================================================
   FOOTER
   ================================================================= */
.store-footer {
    background: #2c3e50;
    color: var(--white-color);
    padding-top: 4rem;
    text-align: center;
}

.footer-content {
    padding-bottom: 2rem;
}

.footer-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.footer-content p {
    opacity: 0.8;
    margin-bottom: 2rem;
}

.social-links a {
    color: var(--white-color);
    font-size: 1.5rem;
    margin: 0 0.75rem;
    opacity: 0.8;
}
.social-links a:hover {
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* =================================================================
   RESPONSIVE STYLES
   ================================================================= */
@media (max-width: 992px) {
    .store-nav {
        justify-content: space-between;
    }
    .search-box {
        order: 3; /* Moves search to the next line */
        width: 100%;
        max-width: 100%;
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .store-nav {
        flex-direction: column;
        align-items: center;
    }
    .cart-text {
        display: none;
    }
    .cart-btn {
        padding: 0.75rem;
        border-radius: 50%;
    }
}
