/* Critical CSS for Above-the-Fold Content */
/* This file contains only essential styles for initial render */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #F8F6F0;
    color: #3F3E2C;
    line-height: 1.6;
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 40px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #E8E6DC;
    border-top: 4px solid #8B7355;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Header Essentials */
.header {
    padding: 15px 0;
    text-align: center;
    position: relative;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 28px;
    font-weight: 500;
    color: #556B2F;
    text-decoration: none;
    font-family: 'Noto Nastaliq Urdu', serif;
}

/* Product Layout Essentials */
.product-detail {
    padding: 40px 20px;
    min-height: 60vh;
}

.product-layout {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

@media (max-width: 968px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Image Gallery Essentials */
.image-gallery {
    position: sticky;
    top: 20px;
}

.main-image {
    width: 100%;
    aspect-ratio: 1;
    background: #F8F6F0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.main-image img.loaded {
    opacity: 1;
}

/* Product Info Essentials */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-name {
    font-size: 28px;
    font-weight: 700;
    color: #3F3E2C;
    margin-bottom: 10px;
    line-height: 1.3;
}

/* Announcements Banner Essentials */
#announcements-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 45px;
}

.instagram-announcement {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.instagram-link {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s;
}

.instagram-link svg {
    width: 100%;
    height: 100%;
    fill: #E4405F;
}

.instagram-announcement.has-announcements .instagram-link svg {
    fill: white;
}

.instagram-link:hover svg {
    fill: #E4405F;
}

.announcement-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.announcement-slide.active {
    opacity: 1;
}

/* Hide non-critical elements initially */
.cart-sidebar,
.cart-overlay {
    display: none;
}