/* Main Styles for indexv2 */
:root {
    --primary-color: #333;
    --secondary-color: #666;
    --accent-color: #f8f9fa;
    --text-color: #333;
    --link-color: #007bff;
    --border-radius: 0.5rem;
}

/* General layout */
.section {
    padding: 4rem 0;
}

.full-width {
    width: 100%;
    padding: 0;
}

.full-width-section {
    width: 100%;
    padding: 4rem 1rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-color);
    margin-bottom: 2rem;
}

/* Section dividers */
.section-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
    margin: 2rem 0;
}

.section-divider-dots {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.section-divider-dots span {
    width: 5px;
    height: 5px;
    background-color: #ddd;
    border-radius: 50%;
    margin: 0 5px;
    position: relative;
}

.section-divider-dots span:before,
.section-divider-dots span:after {
    content: "";
    position: absolute;
    top: 0;
    width: 5px;
    height: 5px;
    background-color: #ddd;
    border-radius: 50%;
}

.section-divider-dots span:before {
    left: -15px;
}

.section-divider-dots span:after {
    right: -15px;
}

/* Category grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-decoration: none;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-card-image {
    height: 200px;
    overflow: hidden;
}

.category-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover .category-card-image img {
    transform: scale(1.05);
}

.category-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: #fff;
    text-align: center;
}

.category-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-card-button {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.category-card-button i {
    margin-left: 0.5rem;
}

.category-card:hover .category-card-button {
    opacity: 1;
}

/* Products grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #333;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Product details button */
.product-detail-btn {
    display: inline-block;
    background-color: #f5f5f5;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.product-detail-btn:hover {
    background-color: #333;
    color: #fff;
}

/* Product badges */
.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #dc3545;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Product buttons container */
.product-buttons-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

/* Hide and show secondary image on hover */
.product-image-container {
    position: relative;
    overflow: hidden;
}

.primary-image, .secondary-image {
    transition: opacity 0.3s ease;
}

.secondary-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.product-card:hover .primary-image {
    opacity: 0;
}

.product-card:hover .secondary-image {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .category-card-image {
        height: 180px;
    }
}

@media (max-width: 767px) {
    .section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .category-card-image {
        height: 150px;
    }
    
    .category-card-title {
        font-size: 1rem;
    }
} 



h3 {
    text-align: right;
    font-family: 'Tajawal', sans-serif;
}

.product-card h3 {
    margin-bottom: 8px;
    height: 48px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Reel Products Styling (9:16 aspect ratio) */
.products-reel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.reel-product-card {
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.reel-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.reel-product-image {
    display: block;
    position: relative;
    overflow: hidden;
}

.reel-aspect-ratio {
    position: relative;
    padding-bottom: 177.78%; /* 9:16 aspect ratio */
    height: 0;
    overflow: hidden;
    background-color: #f7f7f7;
}

.reel-aspect-ratio img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s;
}

.reel-aspect-ratio .secondary-image {
    opacity: 0;
}

.reel-product-image:hover .primary-image {
    opacity: 0;
}

.reel-product-image:hover .secondary-image {
    opacity: 1;
}

.reel-product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.reel-product-title {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    height: auto;
    max-height: 3.6rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: left;
}

.reel-product-buttons-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.reel-product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
}

.reel-product-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: <?php echo $primary_color; ?>;
    color: white;
    text-align: center;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: background-color 0.2s;
    font-size: 0.875rem;
}

.reel-product-btn:hover {
    background-color: #2d3748;
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(220, 38, 38, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 10;
}

/* Spinner animation */
.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border-radius: 50%;
    border: 3px solid #f3f3f3;
    border-top-color: <?php echo $primary_color; ?>;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .products-reel {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .reel-product-title {
        font-size: 0.875rem;
    }
    
    .reel-product-price {
        font-size: 1rem;
    }
    
    .reel-product-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
}
