:root {
    --primary-color: #C5A059; /* Elegant Gold */
    --primary-hover: #b38b47;
    --secondary-color: #1a1a1a; /* Dark Charcoal */
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #f9f9f9;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 30px;
}

.text-center {
    text-align: center;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(197, 160, 89, 0.3);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Header */
.header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    max-width: 1800px; /* Make the header specifically wider to push elements to edges */
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--secondary-color);
    letter-spacing: -0.5px;
}

.logo p {
    font-size: 0.8rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-light);
    position: relative;
    padding-bottom: 5px;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--secondary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.cart-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.cart-btn:hover {
    color: var(--primary-color);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(26, 26, 26, 0.8), rgba(26, 26, 26, 0.8)), url('https://images.unsplash.com/photo-1523170335258-f5ed11844a49?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero h2 {
    color: white;
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

/* Products Section */
.products-section {
    padding: 60px 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h3 {
    font-size: 2rem;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-header h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.category-nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.category-scroll-area {
    display: flex;
    justify-content: center;
    width: 100%;
}

.category-scroll-area .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
}

.scroll-btn {
    display: none; /* Hidden on desktop */
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 300px));
    justify-content: center;
    gap: 30px;
}

.product-card {
    background-color: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    height: 300px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-category {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.product-price {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 15px;
    margin-top: auto;
}

.add-to-cart-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.add-to-cart-btn:hover:not(:disabled) {
    background-color: var(--primary-color);
}

.add-to-cart-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.out-of-stock-btn {
    background-color: var(--danger-color);
}

.out-of-stock-btn:hover:not(:disabled) {
    background-color: #c0392b;
}


/* Spinner */
.spinner-container {
    text-align: center;
    padding: 50px 0;
    display: none; /* hidden by default */
}

.spinner {
    border: 4px solid rgba(0,0,0,0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-right-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

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

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-panel {
    position: absolute;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: var(--bg-white);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cart-overlay.active .cart-panel {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

.cart-items {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.empty-cart-msg {
    text-align: center;
    color: var(--text-light);
    margin-top: 50px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
}

.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.qty-btn {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: var(--bg-light);
    transition: var(--transition);
}

.qty-btn:hover {
    background-color: #e0e0e0;
}

.qty-input {
    width: 40px;
    height: 30px;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
    font-family: inherit;
    font-weight: 600;
}

.remove-item {
    color: var(--danger-color);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.remove-item:hover {
    text-decoration: underline;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-light);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-white);
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: var(--transition);
    max-height: 90vh;
    overflow-y: auto;
}

/* Massive Modal Overrides */
.modal-content.massive-modal {
    width: 95vw;
    max-width: none;
    height: 95vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding: 0;
}

.details-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(0,0,0,0.5);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.details-close-btn:hover {
    background: var(--danger-color);
    color: white !important;
}

.details-close-btn:hover i {
    color: white !important;
}

.product-details-container {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow-y: auto;
}

.product-details-gallery {
    flex: 1;
    background: #f8f9fa;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.carousel-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.carousel-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    transition: opacity 0.15s ease-in-out;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
}

.carousel-btn:hover {
    background: var(--primary-color);
}

.carousel-btn.prev-btn { right: 20px; }
.carousel-btn.next-btn { left: 20px; }

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(0,0,0,0.2);
    cursor: pointer;
    transition: var(--transition);
}

.indicator-dot.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.2);
}

.product-details-info {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.product-details-info h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-right: 40px; /* space for close btn */
}

.details-pricing {
    font-size: 1.8rem;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.details-description {
    flex-grow: 1;
    margin-bottom: 30px;
}

.details-description h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.details-description p {
    line-height: 1.8;
    color: var(--text-light);
    white-space: pre-line;
}

.details-actions {
    margin-top: auto;
}

.details-actions .add-to-cart-btn {
    padding: 15px;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .carousel-btn {
        display: none !important;
    }
    .product-details-container {
        flex-direction: column;
    }
    .product-details-gallery {
        height: 50vh;
        min-height: auto;
    }
    .product-details-info {
        height: auto;
        padding: 20px;
    }
    .product-details-info h2 {
        padding-right: 0;
        margin-top: 20px;
    }
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--bg-white);
    z-index: 10;
}

.modal-body {
    padding: 20px;
}

.cod-notice {
    background-color: #e8f5e9;
    color: var(--success-color);
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #c8e6c9;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    resize: vertical;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.2);
}

.error-msg {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.form-group.has-error input {
    border-color: var(--danger-color);
}

.form-group.has-error .error-msg {
    display: block;
}

/* Success Modal specific */
.success-icon {
    font-size: 5rem;
    color: var(--success-color);
    margin-bottom: 20px;
}

.order-id {
    font-size: 1.5rem;
    color: var(--primary-color);
    letter-spacing: 1px;
    background-color: var(--bg-light);
    padding: 10px;
    border-radius: 4px;
    display: inline-block;
    margin: 15px 0;
}

.success-desc {
    color: var(--text-light);
    margin-bottom: 30px;
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 60px 0 0 0;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-about h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.footer-about p {
    color: #cccccc;
    margin-bottom: 10px;
}

.footer-social {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.instagram-link {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.2rem;
    color: white;
    transition: var(--transition);
}

.instagram-link i {
    font-size: 2rem;
    color: var(--primary-color);
}

.instagram-link:hover {
    color: var(--primary-color);
}

.footer-bottom {
    background-color: #111111;
    padding: 20px 0;
    text-align: center;
    color: #888888;
    font-size: 0.9rem;
}


/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .header-container {
        flex-wrap: wrap;
    }
    
    .category-nav-wrapper {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 5px;
        width: 100%;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .scroll-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 50%;
        width: 35px;
        height: 35px;
        cursor: pointer;
        flex-shrink: 0;
        transition: var(--transition);
    }

    .scroll-btn:disabled {
        background: #bdc3c7;
        cursor: not-allowed;
        opacity: 0.5;
    }

    .category-scroll-area {
        overflow-x: auto;
        overflow-y: hidden;
        flex-grow: 1;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
        justify-content: flex-start;
    }

    .category-scroll-area::-webkit-scrollbar {
        display: none;
    }

    .category-scroll-area .nav-links {
        flex-wrap: nowrap !important;
        width: max-content;
        gap: 15px;
        margin: 0;
    }

    .category-scroll-area .nav-links li {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .category-scroll-area .nav-links a {
        white-space: nowrap;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    
    .nav-links {
        gap: 15px;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }

    .section-header h3 {
        font-size: 1.4rem;
    }

    .product-title {
        font-size: 0.95rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .product-image {
        height: 200px;
    }
}

/* Skeleton Loading Animation */
.skeleton {
    background: #eee;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    border-radius: 5px;
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
}

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

.skeleton-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.skeleton-img {
    height: 300px;
    width: 100%;
    border-radius: 0;
}

.skeleton-text {
    height: 20px;
    margin: 10px 20px;
}

.skeleton-text.short {
    width: 50%;
}

.skeleton-btn {
    height: 40px;
    margin: 10px 20px 20px 20px;
    border-radius: 4px;
}
