/**
 * PYRASTORE - Modern Professional Stylesheet
 * تصميم عصري احترافي لموقع الأفلييت
 */

/* ==================== CSS Variables ==================== */
:root {
    /* Colors */
    --primary: #FF6B35;
    --primary-dark: #E55527;
    --primary-light: #FF8C61;
    --secondary: #1A1A1A;
    --accent: #F7931E;
    --background: #F8F9FA;
    --surface: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    --gradient-dark: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
    --gradient-light: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-primary: 0 10px 30px rgba(255, 107, 53, 0.3);

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

/* ==================== Header ==================== */
.site-header {
    background: var(--gradient-dark);
    color: white;
    padding: 1.5rem 0 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(247, 147, 30, 0.15) 0%, transparent 50%);
    animation: headerGlow 10s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.site-logo h1 {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
    animation: slideDown 0.8s ease-out;
    text-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-tagline {
    font-size: 1rem;
    color: var(--primary);
    letter-spacing: 4px;
    font-weight: 700;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
    animation: fadeIn 1s ease-out 0.2s both;
    text-transform: uppercase;
}

.site-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
    animation: fadeIn 1s ease-out 0.4s both;
    max-width: 600px;
    margin: 0 auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Container ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ==================== Filters Section ==================== */
.filters-section {
    background: var(--surface);
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Search Bar */
.search-bar {
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease-out;
}

.search-input-wrapper {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1.25rem 4rem 1.25rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    transition: all var(--transition-base);
    background: white;
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1), var(--shadow-md);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: all var(--transition-base);
}

.search-input:focus + .search-icon {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

/* Category Filters */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.category-btn {
    padding: 1rem 1.75rem;
    border: 2px solid var(--border);
    background: white;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--gradient-primary);
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.category-btn:hover::before {
    width: 300px;
    height: 300px;
}

.category-btn:hover {
    border-color: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-primary);
}

.category-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.category-btn span {
    position: relative;
    z-index: 1;
}

.category-count {
    background: rgba(0, 0, 0, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
}

.category-btn:hover .category-count,
.category-btn.active .category-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Advanced Filters */
.advanced-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    align-items: center;
    animation: fadeIn 1s ease-out 0.4s both;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.filter-group:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.filter-label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.filter-input {
    padding: 0.65rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    width: 120px;
    font-size: 1rem;
    transition: all var(--transition-base);
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.discount-btn {
    padding: 0.65rem 1.25rem;
    border: 2px solid var(--border);
    background: white;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    transition: all var(--transition-base);
    cursor: pointer;
}

.discount-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.discount-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.sort-select {
    padding: 0.65rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-weight: 600;
    background: white;
    cursor: pointer;
    transition: all var(--transition-base);
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.reset-btn {
    padding: 0.75rem 2rem;
    background: var(--gradient-dark);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 700;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Results Counter */
.results-counter {
    text-align: center;
    margin: 2rem 0 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    animation: fadeIn 0.6s ease-out;
}

/* ==================== Products Grid ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.product-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    animation: scaleIn 0.5s ease-out both;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.product-image-wrapper {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-image {
    transform: scale(1.15) rotate(2deg);
}

.category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: var(--shadow-lg);
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.discount-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--gradient-primary);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 900;
    z-index: 2;
    box-shadow: var(--shadow-primary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-primary);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(255, 107, 53, 0.5);
    }
}

.product-content {
    padding: 1.75rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-base);
}

.product-card:hover .product-title {
    color: var(--primary);
}

.product-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-pricing {
    margin-bottom: 1.25rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border);
}

.product-price {
    font-size: 2rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.product-original-price {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-decoration: line-through;
    font-weight: 600;
}

.product-savings {
    color: var(--success);
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-savings::before {
    content: '💰';
}

.buy-btn {
    width: 100%;
    padding: 1.25rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 800;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.buy-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
}

.buy-btn:hover::before {
    width: 400px;
    height: 400px;
}

.buy-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-primary);
}

.buy-btn:active {
    transform: translateY(-1px);
}

/* ==================== Footer ==================== */
.site-footer {
    background: var(--gradient-dark);
    color: white;
    padding: 3rem 0;
    margin-top: 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    transition: all var(--transition-base);
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.copyright {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}

/* ==================== Loading & Empty States ==================== */
.loading {
    text-align: center;
    padding: 5rem 0;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    animation: fadeIn 0.6s ease-out;
}

.empty-state-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.empty-state-text {
    font-size: 1.3rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ==================== Skeleton Loader ==================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* تقليل الهيدر بشكل كبير على الموبايل */
    .site-header {
        padding: 0.75rem 0 0.75rem;
    }

    .site-logo h1 {
        font-size: 1.5rem;
        letter-spacing: 1px;
        margin-bottom: 0.1rem;
    }

    .site-tagline {
        font-size: 0.65rem;
        letter-spacing: 1.5px;
        margin-bottom: 0.1rem;
    }

    /* إخفاء الوصف على الموبايل لتوفير المساحة */
    .site-description {
        display: none;
    }

    /* تقليل مساحة الفلاتر بشكل كبير */
    .filters-section {
        padding: 0.5rem 0;
        margin-bottom: 0.75rem;
    }

    .search-bar {
        margin-bottom: 0.5rem;
    }

    .search-input {
        padding: 0.6rem 2.5rem 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .search-icon {
        font-size: 1.1rem;
        left: 0.75rem;
    }

    .category-filters {
        gap: 0.4rem;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.4rem;
        margin-bottom: 0.5rem;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .category-btn {
        padding: 0.4rem 0.85rem;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
        gap: 0.4rem;
    }

    .category-count {
        padding: 0.15rem 0.5rem;
        font-size: 0.7rem;
    }

    /* إخفاء الفلاتر المتقدمة على الموبايل */
    .advanced-filters {
        display: none;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .results-counter {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .container {
        padding: 0 0.75rem;
    }
}

@media (max-width: 640px) {
    /* تصميم أكثر ضغطاً للشاشات الصغيرة جداً */
    .site-header {
        padding: 0.5rem 0 0.5rem;
    }

    .site-logo h1 {
        font-size: 1.35rem;
        margin-bottom: 0.05rem;
    }

    .site-tagline {
        font-size: 0.6rem;
        letter-spacing: 1px;
    }

    .search-input {
        padding: 0.5rem 2.25rem 0.5rem 0.65rem;
        font-size: 0.8rem;
    }

    .search-icon {
        font-size: 1rem;
        left: 0.65rem;
    }

    .category-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.7rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .product-card {
        max-width: 500px;
        margin: 0 auto;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    .container {
        padding: 0 0.5rem;
    }
}

/* ==================== Print Styles ==================== */
@media print {
    .filters-section,
    .site-footer {
        display: none;
    }
}

/* ==================== iPhone & Small Mobile Optimization (430px - 480px) ==================== */
@media (max-width: 480px) {
    /* CRITICAL: Optimize product cards for iPhone - must fit without scrolling */
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.5rem 0;
    }

    .product-card {
        max-width: 100%;
        margin: 0;
        border-radius: 12px;
    }

    /* Reduce image height significantly - from square (100%) to 60% */
    .product-image-wrapper {
        padding-top: 60% !important; /* Was 100% - too tall */
    }

    /* Compact badges */
    .category-badge {
        top: 8px;
        right: 8px;
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        font-weight: 600;
    }

    .discount-badge {
        top: 8px;
        left: 8px;
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
        font-weight: 700;
    }

    /* Reduce content padding dramatically */
    .product-content {
        padding: 1rem !important; /* Was 1.75rem - too much */
    }

    /* Smaller title - max 2 lines */
    .product-title {
        font-size: 0.95rem !important; /* Was 1.2rem - too big */
        font-weight: 700;
        margin-bottom: 0.5rem;
        line-height: 1.3;
        -webkit-line-clamp: 2;
    }

    /* Hide description on small mobile - save vertical space */
    .product-description {
        display: none !important;
    }

    /* Compact pricing section */
    .product-pricing {
        margin-bottom: 0.75rem;
        padding-top: 0.6rem;
        border-top: 1px solid var(--border);
    }

    /* Smaller price */
    .product-price {
        font-size: 1.4rem !important; /* Was 2rem - too big */
        font-weight: 800;
        margin-bottom: 0.3rem;
        gap: 0.4rem;
    }

    .product-original-price {
        font-size: 0.9rem;
        font-weight: 500;
    }

    .product-savings {
        font-size: 0.8rem;
        gap: 0.3rem;
    }

    /* Compact buy button */
    .buy-btn {
        padding: 0.85rem !important; /* Was 1.25rem - too tall */
        font-size: 0.95rem !important; /* Was 1.1rem */
        font-weight: 700;
        border-radius: 8px;
    }

    .buy-btn i {
        font-size: 1rem;
    }

    /* Reduce hover effects on mobile */
    .product-card:hover {
        transform: none;
    }

    .product-card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }

    /* Optimize container padding */
    .container {
        padding: 0 0.65rem;
    }

    /* Make results counter smaller */
    .results-counter {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
        padding: 0.3rem 0;
    }

    /* Reduce overall spacing */
    .products-section {
        margin: 1rem 0;
    }
}

/* ==================== Extra Small Mobile (iPhone SE, etc - max 375px) ==================== */
@media (max-width: 375px) {
    /* Even more aggressive optimization for very small screens */
    
    .product-image-wrapper {
        padding-top: 55% !important;
    }

    .product-content {
        padding: 0.85rem !important;
    }

    .product-title {
        font-size: 0.9rem !important;
        margin-bottom: 0.4rem;
    }

    .product-price {
        font-size: 1.25rem !important;
    }

    .buy-btn {
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
    }

    .category-badge,
    .discount-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ==================== RTL/LTR Support ==================== */

/* LTR (English) specific styles */
[dir="ltr"] {
    text-align: left;
}

[dir="ltr"] .search-icon {
    left: 1.25rem;
    right: auto;
}

[dir="ltr"] .search-input {
    padding-left: 3.5rem;
    padding-right: 1rem;
}

[dir="ltr"] .category-count {
    margin-left: auto;
}

[dir="ltr"] .results-counter {
    text-align: left;
}

[dir="ltr"] .review-rating span {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* RTL (Arabic) specific styles */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .search-icon {
    right: 1.25rem;
    left: auto;
}

[dir="rtl"] .search-input {
    padding-right: 3.5rem;
    padding-left: 1rem;
}

[dir="rtl"] .category-count {
    margin-right: auto;
}

[dir="rtl"] .results-counter {
    text-align: right;
}

[dir="rtl"] .review-rating span {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Language switcher buttons */
.lang-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-base);
    background: white;
    color: var(--primary);
}

.lang-btn.active {
    background: var(--primary);
    color: white;
}

.lang-btn:hover:not(.active) {
    background: var(--primary-light);
    color: white;
}


/* ==================== Amazon Benefits Badges ==================== */
.amazon-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1rem;
}

.benefit-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.benefit-badge i {
    font-size: 11px;
}

.benefit-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Original Badge */
.benefit-original {
    background: #FFF7ED;
    color: #FF9900;
    border-color: #FF9900;
}

/* Protection Badge */
.benefit-protection {
    background: #EFF6FF;
    color: #3B82F6;
    border-color: #3B82F6;
}

/* Support Badge */
.benefit-support {
    background: #ECFDF5;
    color: #10B981;
    border-color: #10B981;
}

/* Returns Badge */
.benefit-returns {
    background: #F5F3FF;
    color: #8B5CF6;
    border-color: #8B5CF6;
}

/* Mobile: 2x2 grid */
@media (max-width: 768px) {
    .amazon-benefits {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .benefit-badge {
        font-size: 11px;
        padding: 5px 8px;
        justify-content: center;
    }
    
    .benefit-badge i {
        font-size: 10px;
    }
}

/* Desktop: horizontal row (single line) */
@media (min-width: 769px) {
  .amazon-benefits {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .benefit-badge {
    flex: 0 0 auto;
  }
}

/* ==================== Sticky CTA Bar (Mobile Only) ==================== */
.sticky-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-top: 2px solid #E5E7EB;
  padding: 12px 16px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: env(safe-area-inset-bottom, 12px);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.sticky-cta-bar.show {
  transform: translateY(0);
  opacity: 1;
}

.sticky-cta-price {
  flex: 0 0 30%;
}

.sticky-cta-price .price {
  font-size: 22px;
  font-weight: 800;
  color: #FF6B35;
}

.sticky-cta-price .original {
  font-size: 14px;
  color: #6B7280;
  text-decoration: line-through;
}

.sticky-cta-btn {
  flex: 1;
  height: 56px;
  background: #FF6B35;
  color: white;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.sticky-cta-btn:active {
  transform: scale(0.98);
  background: #E55A2B;
}

/* Body padding (mobile only) */
@media (max-width: 767px) {
  body.has-sticky-cta {
    padding-bottom: 80px;
  }
}

/* Hide on desktop */
@media (min-width: 768px) {
  .sticky-cta-bar {
    display: none !important;
  }
}
/* ==================== Floating Social Media Button (Mobile Only) ==================== */
.social-fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 1000;
  display: none;
}

/* Show only on mobile */
@media (max-width: 768px) {
  .social-fab {
    display: block;
  }
}

.social-fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #FF6B35;
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-fab-main:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.5);
}

.social-fab-main:active {
  transform: scale(0.95);
}

.social-fab.expanded .social-fab-main {
  transform: rotate(45deg);
}

.social-fab-menu {
  display: none;
  flex-direction: column;
  gap: 12px;
  position: absolute;
  bottom: 70px;
  right: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.social-fab-menu.visible {
  opacity: 1;
  transform: translateY(0);
}

.social-fab-item {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: slideInUp 0.3s ease forwards;
}

.social-fab-item:nth-child(1) {
  animation-delay: 0.05s;
}

.social-fab-item:nth-child(2) {
  animation-delay: 0.1s;
}

.social-fab-item:nth-child(3) {
  animation-delay: 0.15s;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.social-fab-item:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.social-fab-item:active {
  transform: scale(0.95);
}

.social-fab-item.facebook {
  background: #1877F2;
}

.social-fab-item.tiktok {
  background: #000000;
}

.social-fab-item.instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* Hide on desktop */
@media (min-width: 768px) {
  .social-fab {
    display: none !important;
  }
}

/* ==================== Sticky Header on Scroll ==================== */
.site-header {
  transition: all 0.3s ease-in-out;
}

.site-header.header-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(51, 51, 51, 0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  animation: slideDown 0.3s ease;
  padding: 0.5rem 0;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.header-sticky .site-logo h1 {
  font-size: 1.5rem;
  margin: 0;
}

.header-sticky .site-tagline,
.header-sticky .site-description {
  display: none;
}

.header-sticky .container {
  padding-top: 0;
  padding-bottom: 0;
}

/* Mobile sticky header adjustments */
@media (max-width: 768px) {
  .site-header.header-sticky {
    padding: 0.3rem 0;
  }

  .header-sticky .site-logo h1 {
    font-size: 1.2rem;
  }
}

/* Add padding to body when header is sticky to prevent content jump */
body.header-is-sticky {
  padding-top: 80px;
}

@media (max-width: 768px) {
  body.header-is-sticky {
    padding-top: 60px;
  }
}

/* ==================== Search Autocomplete Dropdown ==================== */
.search-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: -1px;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:last-child {
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: #f5f5f5;
}

.autocomplete-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.autocomplete-term {
  flex: 1;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-count {
  font-size: 12px;
  color: #999;
  flex-shrink: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .search-autocomplete-dropdown {
    max-height: 200px;
  }

  .autocomplete-item {
    padding: 10px 12px;
  }

  .autocomplete-term {
    font-size: 13px;
  }

  .autocomplete-count {
    font-size: 11px;
  }
}

/* Scrollbar styling */
.search-autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

.search-autocomplete-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 0 0 8px 0;
}

.search-autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.search-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ==================== Category Scroll Indicator ==================== */
.category-scroll-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.category-scroll-fade-left,
.category-scroll-fade-right {
  position: absolute;
  top: 0;
  bottom: 40px;
  width: 40px;
  z-index: 10;
  pointer-events: none;
}

.category-scroll-fade-left {
  left: 0;
  background: linear-gradient(to right, white, transparent);
}

.category-scroll-fade-right {
  right: 0;
  background: linear-gradient(to left, white, transparent);
}

.category-scroll-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.scroll-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  transition: background 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.scroll-dot.active {
  background: #FF6B35;
  transform: scale(1.3);
}

.scroll-dot:hover {
  background: #999;
}

/* Hide fade effects on large screens where scrolling isn't needed */
@media (min-width: 1200px) {
  .category-scroll-fade-left,
  .category-scroll-fade-right {
    display: none;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .category-scroll-fade-left,
  .category-scroll-fade-right {
    width: 30px;
  }

  .category-scroll-dots {
    gap: 6px;
  }

  .scroll-dot {
    width: 7px;
    height: 7px;
  }
}
