/* ============================================================
   store_preorder — "طلب مسبق" section of the instrument store
   landing. Two columns (form on the start side, instrument photo
   + model captions on the end side), a features strip, and the
   "طلبك آمن" note at the bottom.
   Light / Dark / wallpaper / RTL aware. Palette via CSS vars only.
   ============================================================ */

.store-preorder-section {
    position: relative;
    padding: 32px 0;
    /* Anchor target for the hero CTA — offset for the sticky header */
    scroll-margin-top: 96px;
}

.store-preorder__panel {
    padding: clamp(24px, 3.5vw, 56px);
    border-radius: 24px;
    border: 1.5px solid var(--primary);
    background: #fbdefcf8;
    box-shadow: 0 16px 36px rgba(62, 0, 95, 0.10);
    overflow: hidden;
}
body.dark-mode .store-preorder__panel,
body.home-wallpaper-active:not(.dark-mode) .store-preorder__panel {
    background: rgba(31, 15, 51, 0.45);
    border-color: rgba(180, 143, 255, 0.65);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.30);
}

.store-preorder__layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(20px, 3.5vw, 56px);
}

/* ---- Form column ---- */
.store-preorder__form-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.store-preorder__heading {
    margin: 0;
    font-weight: 800;
    font-size: clamp(1.4rem, 2.4vw, 2.1rem);
    color: var(--dark);
}
body.dark-mode .store-preorder__heading { color: #ffffff; }
body.home-wallpaper-active:not(.dark-mode) .store-preorder__heading {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(20, 0, 40, 0.35);
}

.store-preorder__description {
    margin: 0 0 6px;
    font-size: clamp(0.9rem, 1.05vw, 1.02rem);
    line-height: 1.8;
    color: var(--gray-500);
}
body.dark-mode .store-preorder__description { color: var(--gray-400); }
body.home-wallpaper-active:not(.dark-mode) .store-preorder__description {
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 1px 2px rgba(20, 0, 40, 0.22);
}

/* ---- Form fields ---- */
.store-preorder__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.store-preorder__hp {
    position: absolute;
    inset-inline-start: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.store-preorder__input {
    width: 100%;
    padding: 13px 18px;
    border-radius: 14px;
    border: 1.5px solid rgba(180, 143, 255, 0.55);
    background: rgba(255, 255, 255, 0.92);
    color: var(--dark);
    font-size: 0.95rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.store-preorder__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(180, 143, 255, 0.25);
}
.store-preorder__input::placeholder { color: var(--gray-500); }
body.dark-mode .store-preorder__input,
body.home-wallpaper-active:not(.dark-mode) .store-preorder__input {
    background: rgba(20, 6, 38, 0.55);
    border-color: rgba(180, 143, 255, 0.45);
    color: #ffffff;
}
body.dark-mode .store-preorder__input::placeholder,
body.home-wallpaper-active:not(.dark-mode) .store-preorder__input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}
/* Email/phone: the ARABIC placeholder renders in the page direction
   (right-to-left, aligned with the other fields), but as soon as the
   visitor types, the value flips to LTR so "+9715..." and email
   addresses read left-to-right — while staying visually anchored to
   the field's reading side via text-align:end. */
.store-preorder__input--ltr-value:not(:placeholder-shown) {
    direction: ltr;
    text-align: end;
}
body.rtl .store-preorder__input--ltr-value:not(:placeholder-shown) {
    text-align: right;
}

.store-preorder__select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a78bda' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    background-size: 16px;
    cursor: pointer;
}
html[dir="ltr"] .store-preorder__select { background-position: right 16px center; }
body.dark-mode .store-preorder__select option,
body.home-wallpaper-active:not(.dark-mode) .store-preorder__select option {
    background: #1f0f33;
    color: #ffffff;
}

/* ---- Inline status message ---- */
.store-preorder__msg {
    margin: 0;
    min-height: 1em;
    font-size: 0.88rem;
    font-weight: 600;
}
.store-preorder__msg.is-success { color: #f5d8ff; }
.store-preorder__msg.is-error { color: #ff9db3; }
body:not(.dark-mode):not(.home-wallpaper-active) .store-preorder__msg.is-success { color: var(--primary); }
body:not(.dark-mode):not(.home-wallpaper-active) .store-preorder__msg.is-error { color: #c0383a; }

/* ---- Submit — same pill language as the hero CTA ---- */
.store-preorder__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: clamp(12px, 1.4vw, 15px) clamp(26px, 3vw, 40px);
    border-radius: 999px;
    border: 1.5px solid rgba(180, 143, 255, 0.65);
    background: var(--primary);
    color: var(--primary-btn-color);
    font-weight: 700;
    font-size: clamp(0.95rem, 1.05vw, 1.05rem);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: 0 10px 24px rgba(62, 0, 95, 0.25);
}
.store-preorder__submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(62, 0, 95, 0.35);
}
.store-preorder__submit:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}
.store-preorder__submit-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
}
html[dir="ltr"] .store-preorder__submit-arrow svg { transform: scaleX(-1); }

/* ---- Visual column ---- */
.store-preorder__visual-col {
    flex: 0 0 38%;
    max-width: 38%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}
.store-preorder__visual-col img {
    display: block;
    width: 100%;
    height: auto;
    max-height: clamp(280px, 36vw, 460px);
    object-fit: contain;
    filter: drop-shadow(0 24px 48px rgba(20, 0, 40, 0.45));
}
.store-preorder__model-title {
    font-weight: 800;
    letter-spacing: 0.05em;
    font-size: clamp(1rem, 1.4vw, 1.35rem);
    color: var(--dark);
}
body.dark-mode .store-preorder__model-title { color: #ffffff; }
body.home-wallpaper-active:not(.dark-mode) .store-preorder__model-title { color: #ffffff; }
.store-preorder__model-edition {
    font-family: 'Segoe Script', 'Brush Script MT', cursive;
    font-size: clamp(0.95rem, 1.3vw, 1.25rem);
    color: var(--primary);
}
body.dark-mode .store-preorder__model-edition { color: var(--accent); }
body.home-wallpaper-active:not(.dark-mode) .store-preorder__model-edition { color: #f5d8ff; }

/* ---- Features strip ---- */
.store-preorder__features {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(14px, 3vw, 44px);
    margin-top: clamp(20px, 2.6vw, 36px);
    padding: clamp(12px, 1.6vw, 20px);
    border-radius: 16px;
    border: 1px solid rgba(180, 143, 255, 0.35);
    background: rgba(180, 143, 255, 0.08);
}
.store-preorder__feature {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
/* Icon tile — IDENTICAL to the homepage .is-feature__icon so the
   two feature strips read as one system (56px primary tile, 16px
   radius, thin-line glyph rendered white). */
.store-preorder__feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary);
    box-shadow: 0 6px 16px rgba(62, 0, 95, 0.20);
    flex-shrink: 0;
}
.store-preorder__feature-icon img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
.store-preorder__feature-title {
    font-weight: 700;
    font-size: clamp(0.85rem, 0.95vw, 0.95rem);
    color: var(--dark);
}
body.dark-mode .store-preorder__feature-title { color: #ffffff; }
body.home-wallpaper-active:not(.dark-mode) .store-preorder__feature-title { color: #ffffff; }

/* ---- Secure note ---- */
.store-preorder__secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-weight: 700;
    font-size: clamp(0.85rem, 0.95vw, 0.95rem);
    color: var(--primary);
}
body.dark-mode .store-preorder__secure,
body.home-wallpaper-active:not(.dark-mode) .store-preorder__secure { color: #f5d8ff; }

/* ============================================================
   Responsive — 1199 / 991 / 767 / 575
   ============================================================ */
@media (max-width: 1199px) {
    .store-preorder__visual-col { flex-basis: 42%; max-width: 42%; }
}

@media (max-width: 991px) {
    .store-preorder__layout { gap: 20px; }
    .store-preorder__visual-col { flex-basis: 44%; max-width: 44%; }
}

@media (max-width: 767px) {
    .store-preorder__layout {
        flex-direction: column-reverse;   /* photo above the form on mobile */
    }
    .store-preorder__visual-col { flex-basis: auto; max-width: 70%; }
    .store-preorder__form-col { width: 100%; text-align: center; }
    .store-preorder__features { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 575px) {
    .store-preorder-section { padding: 20px 0; }
    .store-preorder__panel { padding: 20px 16px; border-radius: 20px; }
    .store-preorder__visual-col { max-width: 86%; }
}
