/* 
 * Homepage Styles - کارمونه
 * Version: 2.0.0 (Optimized)
 */

/* ==========================================================================
   رفع مشکلات اسکرول افقی
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    direction: rtl;
    text-align: right;
    font-size: 14px;
}

/* ==========================================================================
   استایل‌های عمومی
   ========================================================================== */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.3;
}

.section-title .highlight {
    color: #007bff;
    position: relative;
}

.section-title .highlight::after {
    content: '';
    position: absolute;
    bottom: -3px;
    right: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #007bff, transparent);
}

.section-subtitle {
    font-size: 0.95rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto 15px;
    line-height: 1.5;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.view-all-link:hover {
    color: #0056b3;
}

.view-all-link svg {
    transition: transform 0.3s ease;
}

.view-all-link:hover svg {
    transform: translateX(-4px);
}

/* ==========================================================================
   اسلایدر هیرو (کوچک‌تر شده)
   ========================================================================== */
.hero-slider-section {
    position: relative;
    padding: 40px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    overflow: hidden;
}

.hero-slider-wrapper {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.hero-slider {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 350px;
}

.slide {
    min-width: 100%;
    flex-shrink: 0;
    display: none;
}

.slide.active {
    display: block;
}

.slide-container {
    height: 100%;
    display: flex;
    align-items: center;
}

.slide-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: center;
    padding: 25px;
    height: 100%;
}

@media (max-width: 992px) {
    .slide-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
        padding: 20px;
    }
    
    .hero-slider {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .hero-slider-section {
        padding: 30px 0;
    }
    
    .hero-slider {
        min-height: 250px;
    }
    
    .slide-content {
        padding: 15px;
    }
}

.text-content {
    animation: fadeInRight 0.8s ease;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.2;
}

.slide-title .highlight {
    color: #007bff;
    display: inline-block;
    position: relative;
}

.slide-description {
    font-size: 1rem;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.5;
}

.cta-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 123, 255, 0.2);
}

.btn-outline {
    background: transparent;
    color: #007bff;
    border-color: #007bff;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1rem;
}

.image-content {
    animation: fadeInLeft 0.8s ease;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.image-placeholder,
.product-image-placeholder,
.category-image-placeholder {
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 280px;
    width: 100%;
}

.placeholder-text {
    color: #888;
    font-size: 1rem;
}

/* کنترل‌های اسلایدر */
.slider-controls {
    position: absolute;
    bottom: 20px;
    right: 50%;
    transform: translateX(50%);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.slider-prev,
.slider-next,
.carousel-nav {
    background: none;
    border: none;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.slider-prev:hover,
.slider-next:hover,
.carousel-nav:hover {
    background: #007bff;
    color: white;
    transform: scale(1.05);
}

.slider-prev:disabled,
.slider-next:disabled,
.carousel-nav.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.slider-dots {
    display: flex;
    gap: 8px;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.slider-dot.active {
    background: #007bff;
    transform: scale(1.1);
}

.slider-dot:hover {
    background: #007bff;
}

/* ==========================================================================
   کاروسل محصولات (کوچک‌تر شده)
   ========================================================================== */
.featured-products-section {
    padding: 50px 0;
    background: #fff;
}

.products-carousel {
    position: relative;
    overflow: hidden;
    padding: 0 35px;
}

@media (max-width: 768px) {
    .products-carousel {
        padding: 0;
    }
}

.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px;
}

@media (max-width: 768px) {
    .carousel-track {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 15px;
    }
    
    .carousel-track::-webkit-scrollbar {
        height: 6px;
    }
    
    .carousel-track::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .carousel-track::-webkit-scrollbar-thumb {
        background: #007bff;
        border-radius: 3px;
    }
}

.product-card {
    flex: 0 0 calc(25% - 20px);
    scroll-snap-align: start;
}

@media (max-width: 992px) {
    .product-card {
        flex: 0 0 calc(33.333% - 20px);
    }
}

@media (max-width: 768px) {
    .product-card {
        flex: 0 0 calc(50% - 15px);
    }
}

@media (max-width: 480px) {
    .product-card {
        flex: 0 0 85%;
    }
}

.product-card-inner {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-inner:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.product-image a {
    display: block;
    height: 100%;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card-inner:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4757;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #007bff;
}

.product-price {
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #007bff;
}

.product-price del {
    color: #999;
    font-size: 0.85rem;
    margin-left: 6px;
    font-weight: normal;
}

.product-actions {
    margin-top: auto;
}

.add-to-cart-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e9e8a 100%);
    transform: translateY(-2px);
}

.add-to-cart-btn.loading {
    opacity: 0.8;
    cursor: wait;
}

.add-to-cart-btn.success {
    background: #28a745;
}

.select-options-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.select-options-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d7a 100%);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.carousel-prev {
    right: 0;
}

.carousel-next {
    left: 0;
}

@media (max-width: 768px) {
    .carousel-nav {
        display: none;
    }
}

.no-products,
.no-categories,
.woocommerce-notice {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    grid-column: 1 / -1;
}

.no-products p,
.no-categories p,
.woocommerce-notice p {
    color: #666;
    margin-bottom: 15px;
    font-size: 1rem;
}

/* ==========================================================================
   دسته‌بندی‌ها (کوچک‌تر شده)
   ========================================================================== */
.categories-section {
    padding: 50px 0;
    background: #f8f9fa;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.category-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    background: white;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.category-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-image {
    height: 160px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.05);
}

.category-image-placeholder {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
}

.category-info {
    padding: 15px;
}

.category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.category-description {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.category-count {
    display: inline-block;
    padding: 4px 10px;
    background: #e9ecef;
    color: #666;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ==========================================================================
   اسپانسرها (کوچک‌تر شده)
   ========================================================================== */
.sponsors-section {
    padding: 50px 0;
    background: white;
}

.sponsors-carousel {
    position: relative;
    overflow: hidden;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .sponsors-carousel {
        padding: 0;
    }
}

.sponsors-track {
    display: flex;
    gap: 30px;
    padding: 15px 0;
}

.sponsor-item {
    flex: 0 0 calc(25% - 25px);
}

@media (max-width: 992px) {
    .sponsor-item {
        flex: 0 0 calc(33.333% - 25px);
    }
}

@media (max-width: 768px) {
    .sponsor-item {
        flex: 0 0 calc(50% - 15px);
    }
}

@media (max-width: 480px) {
    .sponsor-item {
        flex: 0 0 85%;
    }
}

.sponsor-link {
    display: block;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.sponsor-link:hover {
    transform: translateY(-3px);
}

.sponsor-logo {
    margin-bottom: 10px;
}

.logo-placeholder {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.sponsor-link:hover .logo-placeholder {
    transform: scale(1.05);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.golbahar-logo {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
}

.azin-logo {
    background: linear-gradient(135deg, #2196F3 0%, #0D47A1 100%);
    color: white;
}

.backlight-logo {
    background: linear-gradient(135deg, #FF9800 0%, #EF6C00 100%);
    color: white;
}

.collaboration-logo {
    background: linear-gradient(135deg, #9C27B0 0%, #6A1B9A 100%);
    color: white;
}

.sponsor-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    margin-top: 8px;
}

/* ==========================================================================
   بخش CTA (کوچک‌تر شده)
   ========================================================================== */
.cta-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') bottom/cover no-repeat;
}

.cta-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.5;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-section .btn-outline {
    background: transparent;
    color: white;
    border-color: white;
}

.cta-section .btn-outline:hover {
    background: white;
    color: #667eea;
}

/* ==========================================================================
   محتوای صفحه
   ========================================================================== */
.page-content-section {
    padding: 50px 0;
    background: #fff;
}

.page-content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.entry-content {
    line-height: 1.7;
    font-size: 1rem;
    color: #444;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    color: #333;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

.entry-content p {
    margin-bottom: 1.2em;
}

.entry-content a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.entry-content a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* ==========================================================================
   انیمیشن‌ها
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

/* ==========================================================================
   پشتیبانی از تاچ
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
    .product-card-inner:hover,
    .category-card:hover {
        transform: none;
    }
    
    .slider-prev:hover,
    .slider-next:hover,
    .carousel-nav:hover {
        transform: none;
        background: white;
        color: #333;
    }
}

/* ==========================================================================
   دسترسی‌پذیری
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ==========================================================================
   اصلاحات RTL
   ========================================================================== */
[dir="rtl"] .carousel-prev svg,
[dir="rtl"] .slider-prev svg {
    transform: rotate(180deg);
}

[dir="rtl"] .carousel-next svg,
[dir="rtl"] .slider-next svg {
    transform: rotate(180deg);
}

/* ==========================================================================
   لودینگ
   ========================================================================== */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   پیام‌ها
   ========================================================================== */
.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   فاصله‌های کلی کاهش یافته
   ========================================================================== */
@media (max-width: 768px) {
    .hero-slider-section,
    .featured-products-section,
    .categories-section,
    .sponsors-section,
    .page-content-section,
    .cta-section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .slide-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .hero-slider-section,
    .featured-products-section,
    .categories-section,
    .sponsors-section,
    .page-content-section,
    .cta-section {
        padding: 30px 0;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .slide-title {
        font-size: 1.6rem;
    }
    
    .slide-image,
    .image-placeholder {
        height: 200px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .category-image {
        height: 140px;
    }
}