/**
 * ثيم Sport Energy - تصميم ديناميكي ونشط
 * ألوان قوية مع خطوط ديناميكية متحركة
 */

/* الألوان الرياضية القوية */
:root {
    --primary-color: #dc2626;
    --secondary-color: #f59e0b;
    --accent-color: #000000;
    --background-color: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
}

body {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 50%, #fff7ed 100%);
    background-attachment: fixed;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(220, 38, 38, 0.03) 10px,
            rgba(220, 38, 38, 0.03) 20px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 10px,
            rgba(245, 158, 11, 0.03) 10px,
            rgba(245, 158, 11, 0.03) 20px
        );
    z-index: -1;
    pointer-events: none;
    animation: speedLines 3s linear infinite;
}

@keyframes speedLines {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(20px) translateY(20px); }
}

/* الهيدر - ديناميكي */
.main-header {
    background: linear-gradient(135deg, #dc2626, #f59e0b);
    box-shadow: 0 4px 30px rgba(220, 38, 38, 0.4);
    position: relative;
    overflow: hidden;
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: headerShine 3s infinite;
}

@keyframes headerShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120'%3E%3Cpath fill='%23ffffff' d='M0,32L48,37.3C96,43,192,53,288,58.7C384,64,480,64,576,69.3C672,75,768,85,864,85.3C960,85,1056,75,1152,69.3C1248,64,1344,64,1392,64L1440,64L1440,120L1392,120C1344,120,1248,120,1152,120C1056,120,960,120,864,120C768,120,672,120,576,120C480,120,384,120,288,120C192,120,96,120,48,120L0,120Z'%3E%3C/path%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
}

/* البانر - ديناميكي مع خطوط */
.hero-section {
    padding: 2rem 0;
    margin-bottom: 3rem;
    background: transparent;
}

.banner-slider {
    position: relative;
    width: 100%;
    height: clamp(280px, 50vw, 450px);
    min-height: 280px;
    overflow: hidden;
    border-radius: clamp(1rem, 3vw, 1.5rem);
    box-shadow: 0 20px 60px rgba(220, 38, 38, 0.3);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(245, 158, 11, 0.1));
    backdrop-filter: blur(10px);
    border: 3px solid #dc2626;
}

.banner-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(220, 38, 38, 0.1) 2px,
            rgba(220, 38, 38, 0.1) 4px
        );
    z-index: 1;
    animation: speedLinesVertical 2s linear infinite;
}

@keyframes speedLinesVertical {
    0% { transform: translateY(0); }
    100% { transform: translateY(20px); }
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: scale(1.1) rotate(2deg);
}

.banner-slide.active {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.banner-image {
    position: relative;
    overflow: hidden;
}

.banner-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(245, 158, 11, 0.3));
    z-index: 1;
}

.banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    filter: contrast(1.1) saturate(1.2);
}

.banner-slide.active .banner-image img {
    transform: scale(1.1);
}

.banner-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(220, 38, 38, 0.4);
    border: 3px solid #dc2626;
}

.banner-content h2 {
    font-size: clamp(1.75rem, 6vw, 3rem);
    margin-bottom: clamp(0.5rem, 2vw, 1rem);
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(220, 38, 38, 0.8), 0 4px 10px rgba(0,0,0,0.5);
    line-height: 1.2;
    letter-spacing: clamp(1px, 0.3vw, 3px);
    text-transform: uppercase;
}

.banner-content p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: #f59e0b;
    line-height: 1.8;
    font-weight: 600;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.banner-nav {
    background: rgba(220, 38, 38, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    border: 2px solid #f59e0b;
}

.banner-nav:hover {
    background: #f59e0b;
    border-color: #dc2626;
    transform: translateY(-50%) scale(1.2);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.banner-indicator {
    background: rgba(255,255,255,0.3);
    width: clamp(0.375rem, 1vw, 0.5rem);
    height: clamp(0.375rem, 1vw, 0.5rem);
    min-width: clamp(0.375rem, 1vw, 0.5rem);
    min-height: clamp(0.375rem, 1vw, 0.5rem);
    border: clamp(2px, 0.3vw, 3px) solid #dc2626;
    border-radius: 0;
    transform: rotate(45deg);
}

.banner-indicator.active {
    background: #dc2626;
    border-color: #f59e0b;
    transform: rotate(45deg) scale(1.5);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.8);
    width: clamp(0.5rem, 1.2vw, 0.625rem);
    height: clamp(0.5rem, 1.2vw, 0.625rem);
}

/* الكاردات - حواف حادة مع تأثيرات قوية */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
    gap: clamp(0.75rem, 3vw, 2rem);
    padding: clamp(1rem, 3vw, 2rem) 0;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.2);
    border: 3px solid #dc2626;
    position: relative;
    z-index: 1;
}

.product-card::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, #dc2626, #f59e0b);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    border-radius: 8px;
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:hover {
    transform: translateY(-15px) scale(1.05) rotate(1deg);
    box-shadow: 0 25px 70px rgba(220, 38, 38, 0.4);
    border-color: #f59e0b;
}

.product-image-container {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fef2f2, #fff7ed);
    width: 100%;
    height: clamp(180px, 40vw, 220px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.4s ease;
    background: transparent;
    display: block;
    filter: contrast(1.1);
}

.product-card:hover .product-image {
    transform: scale(1.1) rotate(-1deg);
}

.product-info {
    padding: 1.5rem;
    background: white;
    position: relative;
    z-index: 1;
}

.product-name {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    font-weight: 900;
    margin-bottom: clamp(0.375rem, 1vw, 0.5rem);
    color: var(--text-color);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-description {
    color: #6b7280;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 900;
    color: #dc2626;
    margin-bottom: 1rem;
    display: block;
    text-shadow: 0 2px 5px rgba(220, 38, 38, 0.2);
}

.add-to-cart-btn {
    width: 100%;
    padding: clamp(0.75rem, 1.5vw, 0.875rem) clamp(0.875rem, 2vw, 1rem);
    background: linear-gradient(135deg, #dc2626, #f59e0b);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 900;
    font-size: clamp(0.875rem, 2vw, 0.95rem);
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    position: relative;
    overflow: hidden;
    z-index: 1;
    min-height: var(--touch-target-min);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.add-to-cart-btn:hover::before {
    left: 100%;
}

.add-to-cart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.5);
}

.stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.95);
    color: #dc2626;
    padding: 0.5rem 1rem;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 900;
    backdrop-filter: blur(10px);
    z-index: 10;
    border: 2px solid #dc2626;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* النافذة المنبثقة - ديناميكية */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.product-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.9), rgba(245, 158, 11, 0.9));
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

.modal-content {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
    background: white;
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(220, 38, 38, 0.4);
    width: min(90vw, 100%);
    max-width: min(90vw, 100%);
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: none;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    isolation: isolate;
    box-sizing: border-box;
    contain: layout style paint;
    padding-top: max(env(safe-area-inset-top), 12px);
    border-top: 5px solid #dc2626;
}

.product-modal.active .modal-content {
    transform: translateX(-50%) scale(1);
}

.modal-header-actions {
    position: absolute;
    top: max(env(safe-area-inset-top), 12px);
    right: max(env(safe-area-inset-right), 12px);
    display: flex;
    gap: 0.5rem;
    z-index: 100;
    padding: 0;
}

.modal-share-btn {
    background: rgba(220, 38, 38, 0.95);
    color: white;
    border: 3px solid #f59e0b;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 0;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.modal-share-btn:hover {
    background: #f59e0b;
    border-color: #dc2626;
    transform: translateY(-2px) rotate(5deg);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.modal-share-btn .share-text {
    display: none;
}

.modal-close {
    background: rgba(220, 38, 38, 0.95);
    color: white;
    border: 3px solid #f59e0b;
    width: 40px;
    height: 40px;
    border-radius: 0;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #000000;
    border-color: #dc2626;
    transform: scale(1.2) rotate(90deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.modal-body {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - max(env(safe-area-inset-top), 12px) - 60px);
    height: calc(100vh - max(env(safe-area-inset-top), 12px) - 60px);
    gap: 0;
    overflow-y: auto;
    padding-bottom: 0;
}

.product-media-section {
    flex: 1;
    background: linear-gradient(135deg, #fef2f2, #fff7ed);
    border-radius: 0;
    padding: 2rem;
    border: 3px solid #dc2626;
    box-shadow: inset 0 4px 15px rgba(220, 38, 38, 0.1);
}

.product-details-section {
    padding: 1.75rem;
    padding-bottom: 0;
    overflow-y: visible;
    overflow-x: hidden;
    max-height: none;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f1f1;
    background: white;
    order: 2;
    flex: 1;
    box-sizing: border-box;
    margin-bottom: 0;
}

.product-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 900;
    color: #dc2626;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 5px rgba(220, 38, 38, 0.2);
}

.product-info-grid .info-item {
    background: linear-gradient(135deg, #ffffff, #fef2f2);
    border: 3px solid #dc2626;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.product-info-grid .info-item:hover {
    border-color: #f59e0b;
    transform: translateX(-5px) rotate(-1deg);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.2);
}

.product-price-section {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(245, 158, 11, 0.1));
    border: 3px solid #dc2626;
    border-radius: 8px;
    box-shadow: 0 6px 25px rgba(220, 38, 38, 0.2);
}

.product-description-full {
    margin-bottom: 0;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fef2f2, #fff7ed);
    border-radius: 8px;
    border: 3px solid #dc2626;
    border-right: 5px solid var(--primary-color);
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f1f1;
}

.product-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: clamp(0.75rem, 2vw, 1rem);
    padding-bottom: max(clamp(0.75rem, 2vw, 1rem), env(safe-area-inset-bottom, clamp(0.75rem, 2vw, 1rem)));
    background: linear-gradient(135deg, #fef2f2, #fff7ed);
    border-radius: 0;
    border: none;
    border-top: 5px solid #dc2626;
    margin-top: auto;
    margin-bottom: 0;
    position: relative;
    z-index: 100;
    box-shadow: 0 -6px 20px rgba(220, 38, 38, 0.2);
    flex-shrink: 0;
}

.add-to-cart-modal-btn {
    background: linear-gradient(135deg, #dc2626, #f59e0b);
    color: white;
    border: none;
    padding: clamp(0.75rem, 1.5vw, 0.875rem) clamp(1rem, 2vw, 1.5rem);
    border-radius: 8px;
    font-weight: 900;
    font-size: clamp(0.875rem, 2vw, 1rem);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    min-height: var(--touch-target-min);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.add-to-cart-modal-btn:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.5);
}

/* الفلاتر */
.filters-section {
    background: white;
    border: 3px solid #dc2626;
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.2);
    border-radius: 8px;
}

.search-box input {
    background: #fef2f2;
    border: 3px solid #dc2626;
    color: var(--text-color);
    border-radius: 8px;
}

.search-box input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
}

.category-btn {
    background: #fef2f2;
    border: 3px solid #dc2626;
    color: var(--text-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 700;
}

.category-btn:hover,
.category-btn.active {
    background: linear-gradient(135deg, #dc2626, #f59e0b);
    border-color: transparent;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

/* Mobile-First Media Queries */
@media (min-width: 320px) and (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(0.5rem, 2vw, 0.75rem);
    }
    
    .banner-slider {
        height: clamp(280px, 50vw, 320px);
    }
    
    .modal-body {
        flex-direction: column;
        padding: clamp(1rem, 3vw, 1.5rem);
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .banner-slider {
        height: clamp(320px, 48vw, 350px);
    }
    
    .banner-content {
        padding: clamp(1.5rem, 3vw, 2rem);
    }
    
    .banner-content h2 {
        font-size: clamp(2rem, 5vw, 2.5rem);
    }
    
    .banner-content p {
        font-size: clamp(1rem, 2.5vw, 1.2rem);
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: clamp(0.75rem, 2vw, 1rem);
    }
}

@media (min-width: 769px) {
    .modal-body {
        flex-direction: row;
    }
}

