:root {
    --gold: #D4AF37;
    --black: #0A0A0A;
    --white: #F5F5F7;
    --grey: #86868b;
    --glass-bg: rgba(20, 20, 20, 0.4);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    scroll-padding-top: 100px; /* Adjust if header height changes */
}

/* Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-stopping {
    overflow: hidden !important;
}

body {
    background-color: var(--black);
    color: var(--white);
    font-family: var(--font-sans);
    overflow-x: hidden;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--black);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid var(--grey);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 5%;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.main-header.scrolled .header-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 1rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 500;
}

.logo img {
    height: 30px;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-link {
    color: var(--grey);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--gold);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.nav-link:hover {
    color: var(--white);
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
    background: rgba(40, 40, 40, 0.5);
    padding: 0.25rem;
    border-radius: 0.75rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.control-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.control-btn img {
    width: 20px;
    height: 20px;
}

.lang-btn {
    font-family: var(--font-sans);
    border: none;
    background: transparent;
    color: var(--grey);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.lang-btn.active {
    background: var(--white);
    color: var(--black);
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100svh; /* Changed from vh to svh for mobile compatibility */
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.background-texture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}

.card-curtain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
}

.card {
    width: 50vw;
    height: 100vh;
    object-fit: cover;
    object-position: center;
}
.card-left { object-position: right center; }
.card-right { object-position: left center; }

.hero-content {
    position: relative;
    z-index: 5;
    color: var(--white);
    max-width: 800px;
    padding: 1rem;
}

.hero-logo {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 2.5rem;
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--grey);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-button {
    background: var(--gold);
    color: var(--black);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    display: inline-block;
    min-height: 44px; /* For touch targets */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cta-button:hover {
    transform: scale(1.05);
    background-color: #e4c55d;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.btn-primary {
    background: linear-gradient(45deg, #ffd700, #D4AF37);
    color: var(--black);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.2);
    color: var(--white);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
}

.arrow {
    width: 24px;
    height: 24px;
    border: 2px solid var(--white);
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) rotate(45deg);
    }
    40% {
        transform: translateY(15px) rotate(45deg);
    }
    60% {
        transform: translateY(7px) rotate(45deg);
    }
}

/* Content Section */
.content-section, .pricing-section, .premium-cards-section, .theme-gallery-section, .contact-section {
    padding: 100px 5%;
    background-color: var(--black);
    position: relative;
    z-index: 20;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.content-wrapper h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    padding: 2.5rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    text-align: left;
    will-change: transform, opacity;
}

.feature-card[dir="rtl"] {
    text-align: right;
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--grey);
    line-height: 1.7;
}

/* Theme Gallery Section */
.theme-gallery-section {
    padding: 100px 5%;
    background-color: var(--black);
    position: relative;
    z-index: 20;
}

.section-subtitle {
    max-width: 600px;
    margin: 1rem auto 4rem;
    color: var(--grey);
    line-height: 1.7;
}

.theme-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* OROVIA Builder panel styles */
.orovia-builder-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
    align-items: center;
}
.builder-hero {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
}
.builder-hero h3 {
    color: var(--gold);
    margin-bottom: 0;
}
.builder-cta-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.builder-embed-wrapper {
    width: 100%;
    max-width: 1200px;
    height: 680px;
    background: rgba(0,0,0,0.35);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    display: none; /* toggled via JS */
    flex-direction: column;
}
.builder-embed-wrapper .embed-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(12,12,12,0.6);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.builder-embed-wrapper .embed-label {
    color: var(--grey);
    font-weight: 500;
}
#orovia-builder-iframe {
    width: 100%;
    height: calc(100% - 48px);
    border: none;
    display: block;
}

/* Make builder responsive: show inline embed on desktop, but allow controlled mobile inline open */
@media (min-width: 900px) {
    .builder-embed-wrapper { display: flex; }
    .builder-embed-wrapper[aria-hidden="true"] { display: none; }
}
@media (max-width: 900px) {
    /* On smaller screens, hide iframe by default but allow it to be shown when aria-hidden="false"
       (this enables the inline builder to open on mobile when toggled via JS). */
    .builder-embed-wrapper {
        display: none;
        height: 0;
    }
    .builder-embed-wrapper[aria-hidden="false"] {
        display: flex;
        height: auto;
    }
    .builder-hero { padding: 0.75rem; }
    .builder-cta-row .btn-secondary { display: inline-block; }
}

.theme-display-card {
    border-radius: 1.5rem;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    text-align: center;
    cursor: pointer;
    position: relative;
    display: flex; /* Use flexbox to ensure content is handled well */
    flex-direction: column;
}

.theme-display-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1.5rem;
    border: 2px solid var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.7);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.theme-display-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.theme-display-card:hover::after {
    opacity: 1;
}

.theme-display-card img {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
}

.theme-display-card h3 {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: auto; /* Push title to the bottom if card stretches */
}

.custom-request-card {
    cursor: pointer;
}

.custom-request-card .custom-theme-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    background: var(--black);
    border: 2px dashed var(--grey);
    border-radius: 1.5rem;
    transition: all 0.3s ease;
    aspect-ratio: 9 / 16;
}
.custom-request-card:hover .custom-theme-box {
    border-color: var(--gold);
    color: var(--gold);
}
.custom-theme-box .plus-icon {
    width: 30px;
    height: 30px;
    stroke: var(--grey);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}
.custom-request-card:hover .custom-theme-box .plus-icon {
    stroke: var(--gold);
    transform: scale(1.2);
}

/* Premium Physical Cards Section */
.premium-cards-section {
    padding: 100px 5%;
    background-color: var(--black);
    position: relative;
    z-index: 20;
}

.card-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.physical-card-display {
    border-radius: 1rem;
    overflow: hidden;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    text-align: center;
    position: relative;
}

.physical-card-display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1rem;
    border: 2px solid var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.physical-card-display:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.physical-card-display:hover::after {
    opacity: 1;
}

.physical-card-display img {
    width: 100%;
    aspect-ratio: 1.77; /* 16:9 */
    object-fit: cover;
    display: block;
}

.physical-card-display h3 {
    padding: 1.5rem 1rem;
    font-size: 1.25rem;
    font-weight: 500;
}

/* Pricing Section */
.pricing-section {
    padding: 100px 5%;
    position: relative;
    z-index: 20;
    overflow: hidden;
}

.pricing-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(115deg, var(--black) 30%, rgba(212, 175, 55, 0.08) 50%, var(--black) 70%);
    animation: flow-background 15s linear infinite;
}

@keyframes flow-background {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.pricing-card {
    padding: 2.5rem 2rem;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    text-align: left;
    will-change: transform, opacity;
    position: relative;
    overflow: hidden;
}

.pricing-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(1.5rem + 2px);
    background: radial-gradient(400px at 50% 50%, rgba(212, 175, 55, 0.7), transparent);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.pricing-card:hover {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
}

.pricing-card:hover::before {
    opacity: 1;
    animation: pulse 2.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.pricing-card.featured {
    border-color: var(--gold);
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.25);
}

.pricing-card h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.pricing-card .price {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--gold);
}

.pricing-card .price sup {
    font-size: 1.5rem;
    font-weight: 400;
    top: -1.2rem;
    left: -0.25rem;
}

.pricing-card ul {
    list-style: none;
    margin-bottom: 2rem;
    text-align: left;
}
.pricing-card ul[dir="rtl"] {
    text-align: right;
}

.pricing-card ul li {
    margin-bottom: 1rem;
    color: var(--grey);
}

.discount-badge-container {
    min-height: 24px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: flex-start;
}

.discount-badge-container[dir="rtl"] {
    justify-content: flex-end;
}

.discount-badge {
    color: var(--gold);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.discount-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.discount-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(30deg);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.discount-badge:hover::before {
    opacity: 1;
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(30deg); }
    100% { transform: translateX(100%) rotate(30deg); }
}

.discount-badge.style-gold {
    background: linear-gradient(45deg, #ffd700, #D4AF37);
    color: var(--black);
    border: 1px solid #e4c55d;
}

.discount-badge.style-black {
    background: #111;
    color: var(--gold);
    border: 1px solid var(--gold);
}

.discount-badge.style-minimal {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}

.discount-info {
    margin-top: 3rem;
    color: var(--grey);
    font-size: 0.9rem;
}

.discount-code {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-weight: 500;
    border: 1px solid rgba(212, 175, 55, 0.3);
    cursor: pointer;
    transition: background 0.3s;
}
.discount-code:hover {
    background: rgba(212, 175, 55, 0.3);
}

/* Contact Section */
.contact-section {
    padding: 100px 5%;
    position: relative;
    z-index: 20;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: left;
}

.contact-grid[dir="rtl"] {
    text-align: right;
}

.contact-info p {
    color: var(--grey);
    line-height: 1.7;
    margin-bottom: 2rem;
    margin-top: 0;
    max-width: 450px;
}

.contact-details {
    list-style: none;
    margin-bottom: 2rem;
}

.contact-details li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.contact-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.contact-details li:hover .contact-icon {
    transform: scale(1.1);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.social-icon img {
    width: 20px;
    height: 20px;
}

.contact-form {
    padding: 2.5rem;
    background: var(--glass-bg);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 1.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    will-change: transform, opacity;
}

.form-group {
    position: relative;
    margin-bottom: 2.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--grey);
    color: var(--white);
    font-family: var(--font-sans);
    font-size: 1rem;
    padding: 0.5rem 0;
    outline: none;
    position: relative;
    z-index: 1;
}

.form-group textarea {
    resize: vertical;
    min-height: 50px;
}

.form-group label {
    position: absolute;
    top: 0.5rem;
    left: 0;
    color: var(--grey);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 0;
}
.form-group[dir="rtl"] label {
    left: auto;
    right: 0;
}

.form-group input:focus + label,
.form-group input:valid + label,
.form-group textarea:focus + label,
.form-group textarea:valid + label {
    top: -1.2rem;
    font-size: 0.8rem;
    color: var(--gold);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-bottom-color: #ff7b7b;
}

.form-group input:invalid:not(:placeholder-shown) + label {
    color: #ff7b7b;
}

.form-feedback {
    margin-top: 1rem;
    color: #ff7b7b;
    text-align: center;
    height: 1.2em;
    font-weight: 500;
    transition: opacity 0.3s;
}
.form-feedback.success {
    color: #7bff95;
}

.contact-form .cta-button {
    width: 100%;
}

/* Theme Preview Modal */
.theme-preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2001; /* Higher than order modal */
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    padding: 1rem;
}

.theme-preview-modal {
    position: relative;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.theme-preview-modal img {
    width: 100%;
    border-radius: 1rem;
    max-height: 70vh;
    object-fit: contain;
}

.theme-preview-modal h3 {
    font-size: 1.5rem;
    color: var(--gold);
}

/* Order Modal */
.order-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    padding: 2vh 2vw;
}

.order-modal {
    width: 100%;
    max-width: 1400px; /* Increased max-width for side-by-side layout */
    height: 100%;
    max-height: 95vh;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* CRITICAL: No scroll on the modal itself */
}

.order-modal-main-content {
    flex-grow: 1;
    display: flex;
    overflow: hidden; /* Ensure children don't cause scroll */
}

.order-modal-steps-container {
    flex: 3; /* Takes up 3/5 of space */
    display: flex;
    flex-direction: column;
    padding: 2rem;
    overflow: hidden;
}

.order-summary-panel {
    flex: 2; /* Takes up 2/5 of space */
    background: rgba(0,0,0,0.3);
    padding: 2rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.order-summary-panel h3 {
    text-align: center;
    color: var(--gold);
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--gold);
    padding-bottom: 1rem;
    font-size: 1.5rem;
}

#final-summary-content {
    flex-grow: 1;
}

.modal-header {
    display: none; /* Stepper is now inside the steps container */
}

.modal-stepper {
    display: flex;
    justify-content: space-around;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.4;
    transition: opacity 0.3s ease;
    position: relative;
    flex: 1;
}
.step-indicator::after {
    content: '';
    position: absolute;
    bottom: -1rem; /* align with border */
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform 0.4s ease-in-out;
}

.step-indicator.active {
    opacity: 1;
}
.step-indicator.active::after {
    transform: scaleX(1);
}

.step-indicator.current {
    opacity: 1;
    font-weight: bold;
}

.step-icon {
    font-size: 1.5rem;
}

.step-name {
    font-size: 0.8rem;
    display: none; /* Hidden on small screens */
}
@media (min-width: 600px) {
    .step-name {
        display: block;
    }
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--grey);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
    width: 44px;
    height: 44px;
    display: grid;
    place-content: center;
    z-index: 10;
}

.modal-close-btn:hover {
    color: var(--white);
}

#modal-content {
    flex-grow: 1;
    overflow: hidden; /* No scroll here */
    position: relative;
    display: flex;
    align-items: center; /* Vertically center step content */
    justify-content: center;
}

#modal-footer {
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--glass-bg);
    padding: 1rem 2rem;
    border-bottom-left-radius: 1.5rem;
    border-bottom-right-radius: 1.5rem;
}

.sticky-summary-bar {
    display: none; /* Replaced by the sticky side panel */
}

.modal-step {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto; /* Allow scroll only if content truly overflows on tiny screens */
    scrollbar-width: none; /* Hide scrollbar for aesthetics */
    -ms-overflow-style: none; /* IE and Edge */
}
.modal-step::-webkit-scrollbar {
    display: none; /* Webkit */
}

.modal-step.active {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-step h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--gold);
}

.modal-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#modal-back-btn {
    background: none;
    border: 1px solid var(--grey);
    color: var(--grey);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#modal-back-btn:hover {
    background: var(--grey);
    color: var(--black);
}

#modal-next-btn:disabled {
    background: var(--grey);
    cursor: not-allowed;
    transform: none;
}

/* Step 1: Theme Gallery */
.theme-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.theme-card {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.theme-card img {
    width: 100%;
    display: block;
    aspect-ratio: 9/16;
    object-fit: cover;
}

.theme-card span {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.7);
    color: var(--white);
    padding: 0.75rem;
    text-align: center;
    font-weight: 500;
}

.theme-card:hover {
    transform: scale(1.03);
    border-color: rgba(212, 175, 55, 0.5);
}

.theme-card.selected {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

/* Step 2 & 3: Social Selection & Forms */
.options-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.option-card {
    flex: 1;
    max-width: 300px;
    padding: 2rem;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option-card:hover {
    border-color: var(--gold);
    transform: translateY(-5px);
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-card input[type="radio"]:checked + .option-content {
    border-color: var(--gold);
}

.option-content {
    border-left: 3px solid transparent;
    padding-left: 1rem;
    transition: border-color 0.3s;
}

.option-card h3 { 
    color: var(--white); 
    margin-bottom: 0.75rem; 
}

.option-card p { 
    color: var(--grey); 
    font-size: 0.9rem; 
    line-height: 1.6;
}

.price-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gold);
    color: var(--black);
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Step 3: Social Selection */
.step-subtitle {
    text-align: center;
    color: var(--grey);
    margin-bottom: 2rem;
    margin-top: -1.5rem;
}

.social-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    width: 100%;
}

.social-select-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.social-select-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-5px);
}

.social-select-card input[type="checkbox"] {
    display: none;
}

.social-select-card input:checked ~ span {
    color: var(--gold);
}

.social-select-card input:checked ~ img {
    filter: drop-shadow(0 0 5px var(--gold));
    transform: scale(1.1);
}

.social-select-card img {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.social-select-card span {
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.social-links-form {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
}

.social-links-form .form-group {
    margin-bottom: 1rem;
}

/* Step 4: Logo Upload */
.logo-options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 2rem auto 0;
}

.logo-option-card {
    padding: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.logo-option-card:hover {
    border-color: rgba(212, 175, 55, 0.5);
}

.logo-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.logo-option-card input[type="radio"]:checked + .option-content {
    border-left-color: var(--gold);
}

.logo-option-card .option-content {
    border-left: 3px solid transparent;
    padding-left: 1.5rem;
    transition: border-color 0.3s;
}

.logo-upload-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logo-preview-container {
    display: none; /* Preview is now in summary panel */
}

.logo-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#logo-file-name {
    font-size: 0.8rem;
    color: var(--grey);
    word-break: break-all;
}

/* Step 5: Checkout Form */
.checkout-form {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.checkout-grid {
    display: block;
}

.checkout-form .form-group {
    margin-bottom: 1.5rem;
}

.order-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkout-grid .form-feedback {
    display: none; /* Now part of the main form */
}

.summary-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
    justify-content: space-between;
    color: var(--grey);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    color: var(--grey);
}
.summary-item strong {
    color: var(--white);
    font-weight: 500;
}
.summary-item span:first-child {
    font-weight: 500;
}
.summary-item span:last-child {
    text-align: right;
    max-width: 60%;
}
.summary-item .social-list {
    line-height: 1.4;
    word-break: break-word;
}

.summary-logo-preview {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.summary-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.summary-total-block {
    margin-top: auto; /* Push to bottom */
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-discount {
    color: #7bff95;
    font-weight: 500;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-top: 0.5rem;
}

.summary-total {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--white);
}

.summary-total strong {
    color: var(--gold);
}

.discount-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.discount-section .form-group {
    margin-bottom: 0.5rem;
}

#discount-feedback {
    font-size: 0.8rem;
    height: 1.2em;
}

#discount-feedback.success {
    color: #7bff95;
}

#discount-feedback.error {
    color: #ff7b7b;
}

.form-feedback-inline {
    font-size: 0.8rem;
    height: 1.2em;
    transition: color 0.3s ease;
}

.form-feedback-inline.success {
    color: #7bff95;
}

.form-feedback-inline.error {
    color: #ff7b7b;
}

.summary-note {
    font-size: 0.8rem;
    color: var(--grey);
    margin-top: 1rem;
    line-height: 1.5;
    text-align: center;
}

/* RTL Styles */
/* These styles are now applied via .lang-ar class on the body */

/* Responsive Design */
@media (min-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
        align-items: flex-start;
    }
}

@media (max-width: 900px) {
    .order-modal-main-content {
        flex-direction: column;
    }
    .order-summary-panel {
        flex: 0 0 auto; /* Don't grow, just take content height */
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        max-height: 35vh; /* Limit height on mobile */
        overflow-y: auto;
    }
    .order-modal-steps-container {
        padding: 1rem;
    }
     .order-summary-panel {
        padding: 1rem;
    }
    .social-links-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.6rem 1rem;
        position: relative; /* ensure absolute centering works */
    }

    .main-nav {
        display: none; /* For simplicity on mobile, can be replaced with a hamburger menu later */
    }

    /* MOBILE: compact, touch-friendly nav (enabled via body.mobile-center-logo) */
    body.mobile-center-logo .main-nav {
        display: flex;
        position: static;
        left: auto;
        transform: none;
        top: auto;
        justify-content: center;
        gap: 0.6rem;
        align-items: center;
        padding: 0.15rem 0;
        margin: 0.25rem 0 0.5rem 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        white-space: nowrap;
    }
    body.mobile-center-logo .main-nav::-webkit-scrollbar { display: none; }

    body.mobile-center-logo .nav-link {
        padding: 0.45rem 0.6rem;
        font-size: 0.92rem;
        display: inline-block;
    }

    .card {
        object-fit: cover;
    }

    .order-modal {
        max-height: 98vh;
        width: 100%;
        padding: 0;
    }

    .options-container {
        flex-direction: column;
    }

    .theme-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1rem;
    }

    /* MOBILE-SPECIFIC HEADER LOGO CENTERING - stable centering that ignores sibling width */
    body.mobile-center-logo .logo-link {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) !important;
        transform-origin: center;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: auto;
        z-index: 3;
    }

    /* HeroUI mobile navbar styles (mobile-only). Matches existing glass/blur luxury style. */
    #heroui-mobile-navbar {
        display: none; /* shown only when injected by JS */
        width: 100%;
        background: rgba(20, 20, 20, 0.45);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid rgba(255,255,255,0.06);
        border-radius: 12px;
        padding: 0.35rem 0.6rem;
        align-items: center;
        justify-content: space-between;
        gap: 0.6rem;
        z-index: 50;
    }

    #heroui-mobile-navbar .hu-left,
    #heroui-mobile-navbar .hu-right {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    #heroui-mobile-navbar .hu-toggle-btn {
        background: transparent;
        border: none;
        color: var(--white);
        padding: 0.5rem;
        display: grid;
        place-items: center;
        border-radius: 8px;
        cursor: pointer;
    }

    #heroui-mobile-navbar .hu-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 3rem);
        background: rgba(12,12,12,0.9);
        border-radius: 12px;
        padding: 0.5rem;
        box-shadow: 0 20px 40px rgba(0,0,0,0.6);
        border: 1px solid rgba(255,255,255,0.06);
    }

    #heroui-mobile-navbar .hu-menu a {
        display: block;
        padding: 0.75rem 1rem;
        color: var(--grey);
        text-decoration: none;
        border-radius: 8px;
        font-weight: 500;
    }
    #heroui-mobile-navbar .hu-menu a:hover {
        background: rgba(255,255,255,0.03);
        color: var(--white);
    }

    /* Show HeroUI navbar only on mobile sizes; ensure old nav is not displayed visually */
    @media (max-width: 768px) {
        #heroui-mobile-navbar { display: flex; position: relative; }
        .main-nav { display: none !important; } /* Safety: old nav hidden on mobile */
    }

    /* Very small screen tweaks (phones) */
    @media (max-width: 420px) {
        body.mobile-center-logo .main-nav {
            gap: 0.4rem;
        }
        body.mobile-center-logo .nav-link {
            padding: 0.35rem 0.5rem;
            font-size: 0.84rem;
        }
        body.mobile-center-logo .language-switcher {
            transform: translateY(0);
            padding: 0.08rem;
        }
    }

    /* Ensure header controls remain touch-friendly and do not push centered logo */
    .header-controls {
        margin-left: 0;
        z-index: 2;
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    /* Compact, touch-friendly language switcher on mobile */
    .language-switcher {
        padding: 0.12rem;
        gap: 0.2rem;
        border-radius: 0.6rem;
        background: rgba(40, 40, 40, 0.6);
    }
    .language-switcher .lang-btn {
        padding: 0.28rem 0.36rem;
        min-width: 34px;
        font-size: 0.82rem;
        border-radius: 0.42rem;
    }

    /* HERO: mobile-first improvements for readability, alignment, and performance */
    .hero-section {
        align-items: center;
        padding: 1rem 0.5rem;
        height: auto;
        min-height: calc(100svh - 64px); /* keep full-screen feel but accommodate header */
    }

    /* Prevent the curtain images from being fixed on mobile to avoid heavy repaints and overflow */
    .card-curtain {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 200%;
        height: 100%;
        z-index: 3;
        pointer-events: none;
        display: flex;
        justify-content: center;
        overflow: hidden;
    }

    .card {
        width: 50%;
        max-width: 360px;
        height: auto;
        object-fit: cover;
        opacity: 0.95;
        filter: saturate(0.95) contrast(0.98);
    }

    .card-left, .card-right {
        position: relative;
        flex: 0 0 50%;
        max-width: 50%;
    }
    .card-left { object-position: right center; transform-origin: left center; }
    .card-right { object-position: left center; transform-origin: right center; }

    /* Hero content: tighter, readable text scales, and single-column layout */
    .hero-content {
        position: relative;
        z-index: 6;
        color: var(--white);
        width: 100%;
        max-width: 680px;
        padding: 0.75rem 1rem;
        margin-top: 1.25rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-logo {
        display: block !important;
        visibility: visible !important;
        width: clamp(180px, 40vw, 480px) !important; /* mobile-friendly scaling */
        height: auto !important;
        margin: 0 0 1.25rem;
        object-fit: contain;
    }

    .hero-content p {
        font-size: clamp(0.95rem, 3.6vw, 1.05rem);
        color: var(--grey);
        margin-bottom: 1.25rem;
        max-width: 92%;
        line-height: 1.5;
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        align-items: center;
    }

    .hero-buttons .cta-button {
        width: min(92%, 420px);
        padding: 0.9rem 1rem;
        border-radius: 10rem;
        font-size: 0.95rem;
        min-height: 48px;
    }

    .hero-buttons .btn-secondary {
        width: min(92%, 420px);
    }

    /* Make scroll indicator smaller and avoid overlap with footer on short screens */
    .scroll-indicator {
        bottom: 1.25rem;
        z-index: 6;
    }

    .arrow {
        width: 18px;
        height: 18px;
        border-width: 2px;
    }

    /* Reduce particle intensity on mobile for performance */
    #particles-js canvas {
        opacity: 0.6;
        transform: translateZ(0); /* force GPU layer */
        will-change: opacity, transform;
    }

    /* Ensure no horizontal overflow */
    html, body {
        overflow-x: hidden;
    }
}