/* assets/style.css */

/* --- General Reset & Variables --- */
:root {
    --color-red: #e53935;
    --color-dark-blue: #1a237e;
    --color-light-gray: #f5f5f5;
    --color-dark-gray: #37474f;
    --color-white: #ffffff;
    --color-text: #444;
    --border-color: #eeeeee;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Vazirmatn', sans-serif; color: var(--color-text); background-color: var(--color-white); text-align: right; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
a { text-decoration: none; color: var(--color-dark-blue); }
ul { list-style: none; }
.btn { display: inline-block; padding: 10px 25px; background-color: var(--color-red); color: var(--color-white); border-radius: 5px; font-weight: bold; border: none; cursor: pointer; transition: background-color 0.3s ease; }
.btn:hover { background-color: #c62828; }
main { min-height: 70vh; }

/* --- Header & Footer --- */
.top-bar { background-color: var(--color-dark-blue); color: var(--color-white); font-size: 0.8rem; text-align: center; padding: 8px 0; }
.main-header { background-color: var(--color-white); padding: 20px 0; border-bottom: 1px solid var(--border-color); }
.main-header .container, .header-actions { display: flex; align-items: center; }
.main-header .container { justify-content: space-between; }
.header-actions { gap: 20px; }
.logo { font-size: 22px; font-weight: bold; color: var(--color-dark-blue); }
.header-actions a { color: var(--color-text); font-weight: 700; }
.header-actions i { font-size: 1.2rem; cursor: pointer; }
.main-nav { background-color: var(--color-light-gray); padding: 15px 0; }
.main-nav .container { display: flex; justify-content: center; gap: 30px; }
.main-nav a { color: var(--color-text); font-weight: 700; }
.main-footer { background-color: var(--color-dark-blue); color: #ccc; padding: 60px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-bottom: 40px; }
.footer-col h4 { color: var(--color-white); margin-bottom: 20px; }
.footer-col a { color: #ccc; }
.footer-bottom { text-align: center; font-size: 0.8rem; padding-top: 20px; border-top: 1px solid #4a4a4a; }

/* --- Page Title Section --- */
.page-title-section { background-color: var(--color-dark-gray); color: var(--color-white); padding: 50px 0; text-align: center; }
.page-title-section h1 { font-size: 2.8rem; }

/* --- Shop Page Styles --- */
.shop-area { padding: 40px 0; }
.shop-area .container { display: flex; gap: 30px; }
.product-listing { flex: 3; }
.sidebar { flex: 1; }
.product-item { display: flex; gap: 20px; border: 1px solid var(--border-color); padding: 20px; border-radius: 5px; margin-bottom: 20px; background: #fff; }
.product-item .product-image { width: 150px; height: 150px; flex-shrink: 0; object-fit: cover; }
.product-item .product-details h3 { margin-bottom: 10px; font-size: 1.2rem; }
.product-item .product-details p { font-size: 0.9rem; color: #666; margin-bottom: 15px; }
.product-item .product-details .price { font-weight: bold; font-size: 1.1rem; color: var(--color-red); margin-bottom: 15px; display: block;}
.widget { border: 1px solid var(--border-color); border-radius: 5px; margin-bottom: 30px; background: #fff; }
.widget-title { background-color: var(--color-red); color: var(--color-white); padding: 12px 15px; font-weight: 700; }
.widget-content { padding: 15px; }
.widget ul li a { display: block; padding: 8px 0; border-bottom: 1px dashed var(--border-color); }

/* --- Login & Profile Page Styles --- */
.form-section, .profile-section { padding: 80px 0; }
.form-container, .profile-dashboard { max-width: 500px; margin: 0 auto; background-color: var(--color-white); padding: 40px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.form-container h2 { text-align: center; color: var(--color-dark-blue); margin-bottom: 20px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 700; }
.form-group input { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; }
.form-btn { width: 100%; padding: 12px; font-size: 1.1rem; }
.profile-dashboard { max-width: 900px; }
.profile-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; margin-bottom: 30px; }
.profile-header h2 { margin: 0; color: var(--color-dark-blue); }
.logout-btn { color: var(--color-red); font-weight: 700; }
.order-table { width: 100%; border-collapse: collapse; }
.order-table th, .order-table td { padding: 15px; border: 1px solid var(--border-color); }
.order-table thead { background-color: var(--color-light-gray); }
.status { display: inline-block; padding: 5px 10px; border-radius: 20px; font-size: 0.8rem; color: var(--color-white); }
.status-shipped { background-color: #4caf50; }
.status-processing { background-color: #ff9800; }
.status-cancelled { background-color: #757575; }

/* --- Responsive --- */
@media (max-width: 992px) {
    .shop-area .container { flex-direction: column; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .product-item { flex-direction: column; }
    .product-item .product-image { width: 100%; height: 200px; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* --- New Product Card Styles for Shop Page --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-card {
    background-color: var(--color-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-align: right;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.product-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.product-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows footer to stick to bottom */
}

.product-card-content h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    flex-grow: 1; /* Pushes price and button down */
}

.product-card-content .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-red);
    margin-bottom: 20px;
}
/* --- Responsive adjustments for the new grid --- */
@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================== */
/* --- FINAL HOMEPAGE & RESPONSIVE STYLES --- */
/* =============================================== */

/* --- Hero Section --- */
.hero {
    background: linear-gradient(45deg, var(--color-dark-blue), #3a6ea5);
    padding: 100px 0;
    border-bottom: 5px solid var(--color-red);
    color: var(--color-white);
    text-align: center;
}
.hero h1 {
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
    font-size: 2.8rem;
}
.hero .subtitle {
    font-size: 1.2rem;
    color: #a8dadc;
}

/* --- "How It Works" Section --- */
.how-it-works {
    background-color: var(--color-light-gray);
    padding: 80px 0;
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    text-align: center;
}
.step-card {
    background: var(--color-white);
    padding: 30px;
    border-radius: 8px;
    border-top: 4px solid var(--color-red);
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);د
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.step-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}
.step-icon {
    width: 70px;
    height: 70px;
    line-height: 70px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--color-red), #ff7b7b);
    color: white;
    margin: 0 auto 20px;
    font-size: 2rem;
    box-shadow: 0 5px 15px rgba(239, 71, 58, 0.4);
}

/* --- Homepage Category Section --- */
.homepage-category-section {
    padding: 60px 0;
    overflow: auto;
}
}
.homepage-category-section:nth-child(even) {
    background-color: var(--color-light-gray);
}
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}
.category-header h2 {
    margin: 0;
}

/* --- FINAL Product Card Styles (for equal height & hover) --- */
.product-card {
    background-color: var(--color-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-align: right;
    display: flex; /* Critical for equal height */
    flex-direction: column; /* Stacks items vertically */
    height: 100%; /* Ensures card takes full height of grid cell */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.product-card-image-wrapper {
    overflow: hidden;
    aspect-ratio: 4 / 3; /* Creates a responsive image container */
}
.product-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image covers the area without distortion */
    transition: transform 0.3s ease;
}
.product-card:hover .product-card-image {
    transform: scale(1.1); /* Zoom effect on hover */
}
.product-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* This makes the content area expand, pushing the button down */
}
.product-card-content h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    flex-grow: 1; /* This makes the title area expand, aligning the prices */
}
.product-card-content .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-red);
    margin-bottom: 20px;
}
.btn-add-to-cart {
    padding: 8px 15px;
    font-size: 0.9rem;
    width: 100%;
}

/* --- Carousel Styles --- */
.swiper-container {
    padding-bottom: 60px;
    /*display: none;*/
}
.swiper-slide {
    height: auto; /* Allows slides to have natural height */
}
.swiper-button-next, .swiper-button-prev {
    color: var(--color-dark-blue) !important;
}

/* --- Final CTA Section --- */
.final-cta {
    background: linear-gradient(45deg, #3a6ea5, var(--color-dark-blue));
    color: var(--color-white);
    text-align: center;
    padding: 60px 0;
}

/* =============================================== */
/* --- FINAL Mobile Responsive Styles --- */
/* =============================================== */
@media (max-width: 992px) { /* Tablet and below */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) { /* Mobile */
    .hero h1 {
        font-size: 2rem;
    }
    .steps-grid {
        grid-template-columns: 1fr; /* Stack cards vertically */
    }
    .category-header {
        flex-direction: column; /* Stack title and button */
        align-items: flex-start;
        gap: 15px;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for products */
        gap: 15px;
    }
    .footer-grid {
        grid-template-columns: 1fr; /* Stack footer columns */
        text-align: center;
    }
}

@media (max-width: 576px) { /* Small Mobile */
    .product-grid {
        grid-template-columns: 1fr; /* Single column for products */
    }
}
/* =============================================== */
/* --- FINAL Product Detail Page Styles --- */
/* =============================================== */

.breadcrumb {
    padding-bottom: 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.breadcrumb a { color: #555; }
.breadcrumb span { margin: 0 5px; }

.product-layout-grid {
    display: grid;
    grid-template-columns: 400px 1fr 300px; /* Image | Main Info | Buy Box */
    gap: 30px;
}

.product-image-container img {
    width: 100%;
    max-width: 400px;
    max-height: 250px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.product-info-main .title-en {
    font-size: 1rem;
    color: #888;
}
.product-info-main h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}
.product-info-main hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}
.features-list {
    padding-right: 20px;
    color: #444;
}
.features-list li {
    line-height: 2.2;
    list-style-type: disc;
}

.product-buy-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    height: fit-content; /* Box only takes height it needs */
}
.product-buy-box .price-wrapper {
    text-align: left;
    margin: 20px 0;
}
.product-buy-box .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
}
.product-buy-box .price span {
    font-size: 1rem;
    font-weight: normal;
}
.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.product-description-section {
    padding: 40px 0;
    background-color: var(--color-light-gray);
    margin-top: 40px;
}
.description-content {
    line-height: 2;
    text-align: justify;
    max-width: 800px;
    margin: 0 auto;
}

/* --- Responsive for New Product Page --- */
@media (max-width: 992px) {
    .product-layout-grid {
        grid-template-columns: 1fr 1fr; /* Image | Info + Buy Box */
    }
    .product-image-container {
        grid-row: 1;
        grid-column: 1 / 2;
    }
    .product-info-main {
        grid-row: 1;
        grid-column: 2 / 3;
    }
    .product-buy-box {
        grid-row: 2;
        grid-column: 1 / 3; /* Buy box takes full width below */
    }
}

@media (max-width: 768px) {
    .product-layout-grid {
        grid-template-columns: 1fr; /* Single column layout */
    }
    .product-image-container,
    .product-info-main,
    .product-buy-box {
        grid-column: 1 / 2; /* All items take full width */
        grid-row: auto;
    }
}