/* ===== المتغيرات العامة ===== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-light: #667eea20;
    --primary-dark: #764ba2;
    --text-dark: #333;
    --text-light: #666;
    --white: #ffffff;
    --whatsapp: #25D366;
    --whatsapp-dark: #128C7E;
    --shadow-sm: 0 4px 15px rgba(0,0,0,0.2);
    --shadow-md: 0 20px 40px rgba(0,0,0,0.3);
    --shadow-lg: 0 30px 60px rgba(0,0,0,0.4);
    --transition-fast: 0.3s;
    --transition-normal: 0.5s;
    --transition-slow: 0.8s;
}

/* ===== الإعدادات الأساسية ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    overflow-x: hidden;
}

/* ===== خلفية متحركة بالفقاعات ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* فقاعات متحركة */
.bubble {
    position: fixed;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    animation: float 20s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(20px) rotate(240deg); }
}

/* ===== زر الإدارة المخفي ===== */
.admin-bar {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.admin-btn {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 24px;
    box-shadow: var(--shadow-sm);
    opacity: 0.2;
    transition: all var(--transition-normal) cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: adminPulse 2s infinite;
}

@keyframes adminPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6); }
}

.admin-btn:hover {
    opacity: 1;
    transform: scale(1.2) rotate(180deg);
    animation: none;
}

/* ===== الهيدر الرئيسي ===== */
.hero {
    background: var(--primary-gradient);
    color: white;
    padding: 5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: headerGlow 3s infinite;
}

@keyframes headerGlow {
    0%, 100% { box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3); }
    50% { box-shadow: 0 20px 60px rgba(118, 75, 162, 0.5); }
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(255,255,255,0.05) 20px,
        rgba(255,255,255,0.05) 40px
    );
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(20px, 20px) rotate(5deg); }
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    background: linear-gradient(to right, #fff, #ffd700, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: shine 3s linear infinite, titleFloat 3s ease-in-out infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

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

.hero p {
    font-size: 1.3rem;
    opacity: 0.95;
    position: relative;
    animation: textGlow 2s infinite;
}

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(255,255,255,0.5); }
    50% { text-shadow: 0 0 20px rgba(255,255,255,0.8); }
}

/* ===== الصورة الرئيسية ===== */
.main-image-container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
    animation: fadeInScale 1s;
}

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

.main-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 30px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal) cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: imageFloat 4s ease-in-out infinite;
}

@keyframes imageFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.02); }
}

.main-image:hover {
    transform: scale(1.03) translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.main-image-placeholder {
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    animation: pulse 2s infinite;
}

/* ===== قسم التعريف بالمصنع ===== */
.about-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.about-container {
    background: white;
    border-radius: 30px;
    padding: 3rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.about-container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: var(--primary-gradient);
    opacity: 0.1;
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.about-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200px;
    height: 200px;
    background: var(--primary-gradient);
    opacity: 0.1;
    border-radius: 50%;
    transform: translate(-50%, 50%);
}

.about-title {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.about-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.about-content {
    position: relative;
    z-index: 1;
}

.about-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
}

/* ===== قسم المنتجات ===== */
.products-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.section-title h2 {
    font-size: 3rem;
    color: var(--text-dark);
    display: inline-block;
    padding-bottom: 1rem;
    position: relative;
    animation: titleAppear 1s;
}

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

.section-title h2::before,
.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 30px;
    height: 4px;
    background: var(--primary-gradient);
    animation: lineMove 2s infinite;
}

.section-title h2::before {
    left: 30%;
}

.section-title h2::after {
    right: 30%;
}

@keyframes lineMove {
    0%, 100% { width: 30px; opacity: 0.5; }
    50% { width: 60px; opacity: 1; }
}

/* ===== شبكة المنتجات ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.product-card {
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: all var(--transition-normal) cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    animation: cardAppear 0.6s backwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }
.product-card:nth-child(9) { animation-delay: 0.9s; }
.product-card:nth-child(10) { animation-delay: 1s; }

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(50px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

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

.product-card:hover {
    transform: translateY(-20px) scale(1.03);
    box-shadow: var(--shadow-lg);
}

/* صورة المنتج */
.product-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.3));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.product-card:hover .product-image::after {
    opacity: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover .product-image img {
    transform: scale(1.15);
}

/* معلومات المنتج */
.product-info {
    padding: 1.2rem;
    position: relative;
    background: white;
}

.product-info h3 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    transition: color var(--transition-fast), transform var(--transition-fast);
    position: relative;
    display: inline-block;
}

.product-card:hover .product-info h3 {
    color: #667eea;
    transform: translateX(5px);
}

.product-info h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width var(--transition-fast);
}

.product-card:hover .product-info h3::after {
    width: 100%;
}

.product-info p {
    color: var(--text-light);
    line-height: 1.5;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.product-card:hover .product-info p {
    color: #444;
}

/* ===== قسم التواصل ===== */
.contact-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.contact-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.contact-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.contact-item {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(37, 211, 102, 0.1);
}

.contact-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--whatsapp), var(--whatsapp-dark));
}

.contact-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.whatsapp-icon {
    font-size: 3rem;
    color: var(--whatsapp);
    margin-bottom: 1rem;
}

.contact-item span {
    display: block;
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-weight: bold;
    direction: ltr;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    background: var(--whatsapp);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
    background: var(--whatsapp-dark);
    transform: scale(1.05);
}

.whatsapp-btn i {
    font-size: 1.2rem;
}

/* ===== الفوتر ===== */
.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    margin-top: 5rem;
    position: relative;
    overflow: hidden;
    animation: footerGlow 3s infinite;
}

@keyframes footerGlow {
    0%, 100% { box-shadow: 0 -10px 30px rgba(102, 126, 234, 0.2); }
    50% { box-shadow: 0 -20px 50px rgba(118, 75, 162, 0.3); }
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #667eea, #764ba2, transparent);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.footer h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    animation: floatText 3s ease-in-out infinite;
}

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

/* ===== تحميل البيانات ===== */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* ===== تجاوب مع الموبايل ===== */
@media (max-width: 768px) {
    .hero h1 { 
        font-size: 2.2rem; 
    }
    
    .hero p { 
        font-size: 1rem; 
    }
    
    .main-image, 
    .main-image-placeholder { 
        height: 300px; 
    }
    
    .about-title {
        font-size: 2rem;
    }
    
    .about-text {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .contact-title {
        font-size: 2rem;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    .contact-item span {
        font-size: 1.1rem;
    }
    
    .products-grid { 
        grid-template-columns: 1fr; 
    }
    
    .product-image {
        height: 160px;
    }
    
    .section-title h2 { 
        font-size: 2rem; 
    }
    
    .footer h3 { 
        font-size: 1.8rem; 
    }
}

@media (max-width: 480px) {
    .hero h1 { 
        font-size: 1.8rem; 
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-card {
        margin: 0 1rem;
    }
    
    .whatsapp-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}