:root {
    /* Palette */
    --primary-color: #111111;
    --secondary-color: #b39169;
    --secondary-dark: #a98860;
    --accent-bg: #fdfdfd;
    --surface-color: #ffffff;
    --text-main: #2b2b2b;
    --text-light: #6c757d;
    --border-color: #f0f0f0;

    /* Radii & Shadows */
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.06);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 2.5px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-dark);
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--accent-bg);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 1. Force the body to have NO padding when modal is open */
body.modal-open,
html.modal-open {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-inline-start: 0 !important;
    padding-inline-end: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden !important;
}

/* 2. Force the navbar and sticky elements to stay put */
body.modal-open .navbar,
body.modal-open .sticky-top,
body.modal-open .fixed-top,
body.modal-open .sticky-gallery {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-inline-start: 0 !important;
    padding-inline-end: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* --- Layout & Typography --- */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.main-title {
    font-weight: 900;
    font-size: 1.75rem;
    line-height: 1.2;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-subtitle {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.lead-text {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* --- Gallery (Updated for Pro Layout) --- */
.gallery-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: #f1f1f1;

}

.gallery-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gallery-container::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex: 0 0 100%;
    scroll-snap-align: center;
    height: 500px;
    /* Default height */
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    opacity: 0;
    transform: scale(0.95);
    filter: blur(8px);
    transition: opacity 0.8s ease-out,
        transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1),
        filter 0.5s ease-out;
    will-change: opacity, transform, filter;
}

.gallery-item img.loaded {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* Scroll Dots */
.scroll-indication {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

.scroll-dot {
    width: 8px;
    height: 8px;
    background: #d4d4d4;
    border-radius: 50%;
    transition: 0.3s;
}

.scroll-dot.active {
    background: var(--secondary-color);
    transform: scale(1.4);
}

/* Sticky Sidebar on Desktop */
@media (min-width: 992px) {
    .sticky-gallery {
        position: sticky;
        top: 100px;
        z-index: 10;
    }

    .gallery-item {
        height: 600px;
    }

    /* Taller on desktop */
    .main-title {
        font-size: 2.4rem;
    }
}

@media (max-width: 768px) {
    .gallery-item {
        height: 400px;
    }

    /* Optmized for Mobile */
    .main-wrapper {
        padding-top: 1rem;
    }
}

/* --- Navbar --- */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
    padding: 0.8rem 0;
}

.navbar-brand {
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.navbar-brand span {
    color: var(--secondary-color);
}

/* Pro Continuous Animation */
@keyframes gradient-move {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.nav-btn {
    /* Rich Gradient: Deep Black -> Elegant Gold -> Deep Black */
    background: linear-gradient(270deg, var(--secondary-color), #1a1a1a, var(--secondary-color));
    background-size: 200% 200%;
    animation: gradient-move 4s ease infinite;

    color: #fff;
    border-radius: 50px;
    padding: 0.6rem 1.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;

    /* Ensure text readability over any background color */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);

    /* Subtle depth */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);

    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(179, 145, 105, 0.5);
    /* On hover, maybe freeze the gold or make it brighter? */
    /* Let's keep the animation running but intensify the glow */
    border-color: rgba(255, 255, 255, 0.4);
}

.nav-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.btn-back {
    background: rgba(117, 114, 114, 0.05);
    color: var(--primary-color);
    border: 1px solid rgba(17, 17, 17, 0.1);
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    font-weight: 700;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-back:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

@media (max-width: 576px) {
    .btn-back {
        padding: 0.5rem;
        width: 40px;
        height: 40px;
        justify-content: center;
        border-radius: 50%;
    }

    .btn-back i {
        font-size: 1.1rem;
    }
}

/* --- Pricing Card (Pro Style) --- */
.pricing-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 3rem;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
    overflow: hidden;
}

.pricing-card.active {
    border: 2px solid var(--secondary-color);
    background: linear-gradient(160deg, #fffcf9 0%, #fff 100%);
    box-shadow: 0 5px 15px rgba(179, 145, 105, 0.08);
}

.price-tag {
    font-family: 'Tajawal';
    font-weight: 800;
    font-size: 2.5rem;
    color: var(--primary-color);
    line-height: 1;
}

.price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 1.1rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
}

.feature-item i {
    color: var(--secondary-color);
}

/* --- Form Elements --- */
.form-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.form-control,
.form-select {
    background: #fcfcfc;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-family: 'Tajawal';
    font-weight: 500;
    height: auto;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(179, 145, 105, 0.1);
}

/* Delivery Cards */
.delivery-card {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    transition: 0.2s;
}

.delivery-card:hover {
    background: #f9f9f9;
}

.delivery-card.selected {
    background: #fffbf5;
    border-color: var(--secondary-color);
}

.delivery-price {
    font-family: 'Tajawal';
    font-weight: 800;
    color: #27ae60;
}

/* Submit Button */
.btn-submit {
    /* Gradient: Gold -> Soft Black -> Gold */
    background: linear-gradient(270deg, var(--secondary-color), #2b2b2b, var(--secondary-color));
    background-size: 200% 200%;
    animation: gradient-move 4s ease infinite;

    color: white;
    width: 100%;
    padding: 1rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1rem;
    border: none;
    box-shadow: 0 8px 25px rgba(179, 145, 105, 0.3);
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 30px rgba(179, 145, 105, 0.4);
}

/* --- Footer --- */
.footer {
    background: #111;
    color: #aaa;
    padding: 1.75rem 0;
    margin-top: 2rem;
}

.social-link {
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1.2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.social-link:hover {
    background: var(--secondary-color);
    color: #000;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(197, 164, 126, 0.2);
}

/* Animation */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Shimmer Loading Effect --- */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* The loading skeleton state */
.gallery-item.loading {
    /* Gray background with a moving lighter gray gradient */
    background: #f0f0f0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

/* Initial state of image: hidden */
.gallery-item img {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

/* Final state of image: visible (applied via JS) */
.gallery-item img.loaded {
    opacity: 1;
}

/* --- Dark Glass Modal Support --- */
.modal-backdrop.show {
    opacity: 1;
    background-color: rgba(33, 33, 33, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* --- Modal Transition --- */
#imageModal .modal-dialog {
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease-out;
}

#imageModal.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

#imageModal .modal-content {
    background-color: transparent;
    box-shadow: none;
}

#modalImage {
    transition: opacity 0.3s ease, transform 0.4s ease-out;
    cursor: grab;
    touch-action: none;
}

#modalImage:active {
    cursor: grabbing;
}

#modalImage.img-loading {
    opacity: 0.5;
}

.swal {
    border-radius: 20px;
}

.swal-confirm,
.swal-cancel {
    padding: 12px 28px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px;
}

.swal-confirm {
    margin-left: 24px !important;
}

/* --- Professional Loading Overlay --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(223, 223, 223, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-in-out;
}

/* Class to show the overlay */
.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background: white;
    padding: 2.5rem 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.loading-overlay.active .loading-content {
    transform: scale(1);
}

/* Custom Spinner Color */
.loading-content .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 4px;
    color: #b39169;
    border-right-color: transparent;
}

/* --- Mobile Responsiveness Enhancements --- */
@media (max-width: 768px) {

    /* Typography */
    html {
        font-size: 15px;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .product-subtitle {
        font-size: 0.95rem;
    }

    .lead-text {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    /* Navbar */
    .navbar-brand {
        font-size: 1.25rem;
    }

    .nav-btn {
        padding: 0.4rem 1.1rem;
        font-size: 1rem;
    }

    .btn-back {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .btn-back i {
        font-size: 1rem;
    }

    /* Gallery */
    .gallery-item {
        height: 380px;
    }

    /* Pricing Card */
    .pricing-card {
        padding: 1.2rem;
        margin-bottom: 2rem;
    }

    .price-tag {
        font-size: 2rem !important;
    }

    .price-old {
        font-size: 1rem !important;
    }

    .feature-grid {
        gap: 8px;
        margin-top: 1rem;
    }

    .feature-item {
        font-size: 0.85rem;
    }

    /* Form & Inputs */
    .form-label {
        font-size: 0.85rem;
    }

    .form-control,
    .form-select {
        font-size: 0.95rem;
        /* Keep readable */
        padding: 0.7rem;
    }

    .delivery-card label {
        font-size: 0.8rem;
    }

    .delivery-price {
        font-size: 0.9rem;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 0;
    }

    .footer h2 {
        font-size: 1.4rem !important;
    }

    .footer p {
        font-size: 0.85rem;
    }

    .social-link a {
        width: 55px;
        height: 55px;
        font-size: 1rem;
    }
}