/* ===== RESET & BASE STYLES ===== */
* {
    /* box-sizing: border-box; */
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

:root {
    --primary-color: #ffb100;
    --secondary-color: #000000;
    --accent-color: #e63946;
    --light-gray: #f6f7f9;
    --dark-gray: #333333;
    --text-gray: #666666;
    --border-radius: 12px;
    --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

body {
    background: var(--light-gray);
    color: var(--dark-gray);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 20px;
    background: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.logo {
    /* width: 45px; */
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-title {
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.back-btn {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== CATEGORIES NAVIGATION ===== */
.categories-nav {
    background: white;
    padding: 15px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.categories {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.categories a {
    background: white;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-gray);
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    border: 2px solid transparent;
}

.categories a:hover,
.categories a.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 177, 0, 0.2);
}

/* ===== PRODUCTS GRID ===== */
.products-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 في الجوال افتراضيًا */
    gap: 20px;
    padding: 20px;
    flex: 1;
}


/* للحواسيب اللوحية الصغيرة */
@media (min-width: 480px) and (max-width: 767px) {
    .products-container {
        grid-template-columns: repeat(2, 1fr); /* يبقى 2 */
        gap: 25px;
    }
}

/* للحواسيب اللوحية الكبيرة */
@media (min-width: 768px) and (max-width: 1023px) {
    .products-container {
        grid-template-columns: repeat(3, 1fr); /* 3 في التابلت */
        gap: 25px;
    }
    
    .product-card {
        height: auto;
    }
}

/* للحواسيب المكتبية */
@media (min-width: 1024px) {
    .products-container {
        grid-template-columns: repeat(3, 1fr); /* 4 في المكتب */
        gap: 30px;
        padding: 30px;
    }
    
    .product-card {
        height: 100%;
    }
    
    .product-image {
        height: 220px; /* ارتفاع أكبر للمكتب */
    }
}

/* لشاشات كبيرة جداً */
@media (min-width: 1440px) {
    .products-container {
        grid-template-columns: repeat(3, 1fr); /* 5 في الشاشات الكبيرة */
    }
}

/* تعديلات كارد المنتج لتتلاءم مع العرض */
.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--accent-color), #ff6b6b);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(230, 57, 70, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Product Image */
.product-image {
    width: 100%;
    height: 180px; /* ارتفاع افتراضي للجوال */
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Product Info */
.product-info {
    padding: 20px;
    flex: 1;
    /* display: flex; */
    flex-direction: column;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-gray);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

/* Price Styling */
.price-container {
    margin: 10px 0 20px;
}

.original-price {
    font-size: 0.9rem;
    color: var(--text-gray);
    text-decoration: line-through;
    margin-right: 8px;
}


/* تحسين التباين  على الجوال */
@media (max-width: 767px) {
    .product-actions {
    width: 95px !important;
}
    .current-price {
        font-size: 1.2rem;
    }
    
    .original-price {
        font-size: 0.85rem;
    }
    
    .product-title {
        font-size: 1rem;
        height: 2.6em;
    }
    
    .details-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* تحسينات إضافية للتجاوب */
@media (max-width: 360px) {
    .products-container {
        grid-template-columns: 2fr; /* عمود واحد في الهواتف الصغيرة جداً */
        gap: 15px;
        padding: 15px;
    }
    
    .product-image {
        height: 160px;
    }
}
.discount-percent {
    background: #ffebee;
    color: var(--accent-color);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
}


.details-btn {
    flex: 1;
    display: inline-block;
    padding: 12px 20px;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.details-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wishlist-btn {
    width: 45px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-btn:hover {
    background: #ffebee;
    color: var(--accent-color);
}

/* ===== PRODUCT DETAILS PAGE ===== */
.product-detail {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
}

/* Product Gallery */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image-container {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    height: 400px;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.thumbnail {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Product Details */
.product-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-category {
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.product-detail-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--dark-gray);
    line-height: 1.3;
}

.product-description {
    color: var(--text-gray);
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Product Meta */
.product-meta {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.meta-label {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.meta-value {
    font-weight: 600;
    color: var(--dark-gray);
}

/* Product Actions Detail */
.product-actions-detail {
    /* display: flex; */
    gap: 15px;
    margin-top: 20px;
}
.product-actions{
    width: 100%;    
}

.buy-now-btn {
    flex: 2;
    padding: 16px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin: 5px;
}

.buy-now-btn:hover {
    background: #ffa000;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 177, 0, 0.3);
}

.whatsapp-btn {
    flex: 1;
    padding: 16px 20px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    text-decoration: none;
}

.whatsapp-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.3);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination a {
    padding: 10px 16px;
    background: white;
    color: var(--dark-gray);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid #eee;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination a.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section p {
    color: #ccc;
    line-height: 1.8;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 0.9rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .category-title {
        font-size: 1.4rem;
    }
    
    .products-container {
        /* grid-template-columns: repeat(auto-fill, minmax(200px, 2fr)); */
        gap: 20px;
        padding: 15px;
    }
    
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }
    
    .main-image-container {
        height: 300px;
    }
    
    .product-detail-title {
        font-size: 1.8rem;
    }
    
    .product-actions-detail {
        flex-direction: column;
    }
    
    .categories {
        gap: 10px;
    }
    
    .categories a {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .products-container {
        /* grid-template-columns: 2fr; */
    }
    
    .header {
        padding: 10px 15px;
    }
    
    .logo {
        /* width: 35px; */
        height: 35px;
    }
    
    .product-detail-container {
        padding: 15px;
    }
    
    .main-image-container {
        height: 250px;
    }
    
    .thumbnail-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}