/* ==========================================================================
   Landaty — One-Page Checkout
   فورم الطلب جوّه اللاندنج. كل الألوان من متغيرات الثيم (fv-scheme-*).
   ========================================================================== */

.lp-op {
    --op-line: #e2e7ee;
    /* حدود الحقول أغمق من حدود الكارت عشان الخانة تبان على الموبايل من غير ما تعتمد على اللون */
    --op-field: #c8d2de;
    --op-field-bg: #fafbfd;
    --op-muted: #7b8794;
    --op-ok: #16a34a;
    --op-err: #ef4444;
    padding: 56px 20px 40px;
    background:
        radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--primary, #ff6b00) 7%, transparent) 0%, transparent 62%),
        var(--bg, #f7f8fa);
    scroll-margin-top: 70px;
}

.lp-op-inner {
    max-width: 1080px;
    margin: 0 auto;
}

/* ---------- العنوان ---------- */
.lp-op-head {
    text-align: center;
    margin-bottom: 26px;
}

.lp-op-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: color-mix(in srgb, var(--primary, #ff6b00) 11%, #fff);
    color: var(--primary, #ff6b00);
    font-size: 13px;
    font-weight: 800;
    padding: 7px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.lp-op-eyebrow svg {
    fill: currentColor;
}

.lp-op-title {
    font-size: 30px;
    font-weight: 900;
    color: var(--dark, #111);
    margin: 0 0 6px;
    line-height: 1.3;
}

.lp-op-sub {
    font-size: 15px;
    color: var(--op-muted);
    margin: 0;
}

/* ---------- الشبكة ---------- */
.lp-op-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 22px;
    align-items: start;
}

.lp-op-card {
    background: var(--white, #fff);
    border: 1px solid var(--op-line);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 26px rgba(16, 24, 40, .05);
}

.lp-op-summary {
    position: sticky;
    top: 20px;
}

/* ---------- الحقول ---------- */
.lp-op-row {
    margin-bottom: 16px;
}

.lp-op-row:last-child {
    margin-bottom: 0;
}

.lp-op-row > label {
    display: block;
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -.1px;
}

.lp-op-input {
    position: relative;
    display: flex;
    align-items: center;
}

.lp-op-input input {
    width: 100%;
    padding: 15px 16px;
    border: 1.5px solid var(--op-field);
    border-radius: 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--dark, #111);
    background: var(--op-field-bg);
    transition: border-color .2s, box-shadow .2s, background-color .2s;
    outline: none;
    -webkit-appearance: none;
}

.lp-op-input input::placeholder {
    color: #98a4b3;
}

.lp-op-input input:hover,
.lp-op-select-btn:hover {
    border-color: #a9b6c6;
}

.lp-op-input input:focus {
    border-color: var(--primary, #ff6b00);
    background: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary, #ff6b00) 12%, transparent);
}

#billing_phone {
    direction: ltr;
    text-align: right;
}

/* حالة الخطأ */
.lp-op-row.has-err .lp-op-input input,
.lp-op-row.has-err .lp-op-select-btn {
    border-color: var(--op-err);
    background: #fff7f7;
}

.lp-op-err {
    display: none;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--op-err);
    margin-top: 6px;
}

.lp-op-row.has-err .lp-op-err {
    display: block;
}

/* ---------- قائمة المحافظات ---------- */
.lp-op-select {
    position: relative;
}

.lp-op-native {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.lp-op-select-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 16px;
    border: 1.5px solid var(--op-field);
    border-radius: 14px;
    background: var(--op-field-bg);
    font-family: inherit;
    font-size: 15px;
    color: var(--dark, #111);
    cursor: pointer;
    text-align: start;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.lp-op-select-txt {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lp-op-select-btn.placeholder .lp-op-select-txt {
    color: #98a4b3;
}

/* المنسدلة مفتوحة = نفس إحساس التركيز في الحقول */
.lp-op-select.open .lp-op-select-btn {
    border-color: var(--primary, #ff6b00);
    background: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary, #ff6b00) 12%, transparent);
}

.lp-op-caret {
    width: 0;
    height: 0;
    border-inline-start: 5px solid transparent;
    border-inline-end: 5px solid transparent;
    border-top: 6px solid #9aa5b1;
    transition: transform .2s;
    flex-shrink: 0;
}

.lp-op-select.open .lp-op-select-btn {
    border-color: var(--primary, #ff6b00);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary, #ff6b00) 12%, transparent);
}

.lp-op-select.open .lp-op-caret {
    transform: rotate(180deg);
}

.lp-op-select-pop {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    inset-inline: 0;
    background: #fff;
    border: 1px solid var(--op-line);
    border-radius: 14px;
    box-shadow: 0 12px 34px rgba(16, 24, 40, .14);
    z-index: 60;
    overflow: hidden;
}

.lp-op-select.open .lp-op-select-pop {
    display: block;
    animation: lp-op-pop .16s ease;
}

@keyframes lp-op-pop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

.lp-op-search {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid var(--op-line);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    color: var(--dark, #111);
}

.lp-op-opts {
    max-height: 240px;
    overflow-y: auto;
    padding: 5px 0;
    overscroll-behavior: contain;
}

.lp-op-opt {
    padding: 11px 16px;
    font-size: 14.5px;
    color: #33414f;
    cursor: pointer;
    transition: background .12s;
}

.lp-op-opt:hover,
.lp-op-opt.hl {
    background: color-mix(in srgb, var(--primary, #ff6b00) 9%, #fff);
    color: var(--primary, #ff6b00);
}

.lp-op-opt.sel {
    font-weight: 800;
    color: var(--primary, #ff6b00);
}

.lp-op-empty {
    padding: 16px;
    text-align: center;
    color: var(--op-muted);
    font-size: 13px;
}

/* ---------- الملاحظات ---------- */
.lp-op-note-toggle {
    background: none;
    border: none;
    padding: 4px 0;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary, #ff6b00);
    cursor: pointer;
}

.lp-op-note-box textarea {
    width: 100%;
    margin-top: 8px;
    padding: 13px 16px;
    border: 1.5px solid var(--op-line);
    border-radius: 14px;
    font-family: inherit;
    font-size: 14.5px;
    resize: vertical;
    outline: none;
    color: var(--dark, #111);
}

.lp-op-note-box textarea:focus {
    border-color: var(--primary, #ff6b00);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary, #ff6b00) 12%, transparent);
}

/* ---------- الملخص ---------- */
.lp-op-sum-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--dark, #111);
    margin: 0 0 16px;
}

.lp-op-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--op-line);
}

.lp-op-item img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    background: #f2f4f7;
    flex-shrink: 0;
}

.lp-op-item-body {
    flex: 1;
    min-width: 0;
}

.lp-op-item-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--dark, #111);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lp-op-item-meta {
    font-size: 12.5px;
    color: var(--op-muted);
    margin-top: 3px;
}

.lp-op-item-qty {
    font-size: 14px;
    font-weight: 800;
    color: var(--op-muted);
    flex-shrink: 0;
}

/* الأوردر بامب */
.lp-op-bump {
    display: block;
    margin-top: 14px;
    cursor: pointer;
}

.lp-op-bump input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lp-op-bump-box {
    display: block;
    border: 2px dashed color-mix(in srgb, var(--primary, #ff6b00) 45%, #fff);
    background: color-mix(in srgb, var(--primary, #ff6b00) 5%, #fff);
    border-radius: 14px;
    padding: 13px;
    transition: border-color .2s, background .2s;
}

.lp-op-bump input:checked + .lp-op-bump-box {
    border-style: solid;
    border-color: var(--primary, #ff6b00);
    background: color-mix(in srgb, var(--primary, #ff6b00) 10%, #fff);
}

.lp-op-bump-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--dark, #111);
    margin-bottom: 10px;
}

.lp-op-bump-top::before {
    content: '';
    width: 19px;
    height: 19px;
    border: 2px solid var(--primary, #ff6b00);
    border-radius: 6px;
    flex-shrink: 0;
    background: #fff;
    transition: background .2s;
}

.lp-op-bump input:checked + .lp-op-bump-box .lp-op-bump-top::before {
    background: var(--primary, #ff6b00) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/13px no-repeat;
}

.lp-op-bump-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lp-op-bump-body img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.lp-op-bump-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--dark, #111);
    line-height: 1.5;
}

.lp-op-bump-price {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 2px;
}

.lp-op-bump-price b {
    color: var(--primary, #ff6b00);
    font-size: 14px;
}

.lp-op-bump-price del {
    color: #a6b0bb;
    font-size: 12.5px;
}

/* السطور */
.lp-op-lines {
    padding: 16px 0;
    border-bottom: 1px solid var(--op-line);
}

.lp-op-line[hidden] {
    display: none !important;
}

.lp-op-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14.5px;
    color: #55606c;
    padding: 5px 0;
}

.lp-op-line span:last-child {
    font-weight: 700;
    color: var(--dark, #111);
}

.lp-op-save,
.lp-op-save span:last-child {
    color: var(--op-ok) !important;
    font-weight: 700;
}

.lp-op-free {
    color: var(--op-ok) !important;
}

.lp-op-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 0 18px;
    font-size: 16px;
    font-weight: 800;
    color: var(--dark, #111);
}

.lp-op-total span:last-child {
    font-size: 25px;
    font-weight: 900;
    color: var(--primary, #ff6b00);
}

/* الزرار */
.lp-op-submit {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 17px 18px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary, #ff6b00), color-mix(in srgb, var(--primary, #ff6b00) 72%, #000));
    color: #fff;
    font-family: inherit;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--primary, #ff6b00) 34%, transparent);
    overflow: hidden;
    transition: transform .15s, box-shadow .2s, opacity .2s;
}

.lp-op-submit::after {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
    transform: skewX(-20deg);
    animation: lp-op-shine 3.4s ease-in-out infinite;
}

@keyframes lp-op-shine {
    0%, 62% { inset-inline-start: -60%; }
    100%    { inset-inline-start: 130%; }
}

.lp-op-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--primary, #ff6b00) 42%, transparent);
}

.lp-op-submit:active {
    transform: translateY(0);
}

.lp-op-submit.loading {
    pointer-events: none;
    opacity: .82;
}

.lp-op-submit.loading::after {
    display: none;
}

.lp-op-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lp-op-spin .7s linear infinite;
}

.lp-op-submit.loading .lp-op-spinner {
    display: block;
}

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

/* رسالة الخطأ العامة */
.lp-op-alert {
    margin-top: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.7;
}

/* ثقة */
.lp-op-trust {
    list-style: none;
    margin: 16px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--op-line);
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.lp-op-trust li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #55606c;
    font-weight: 600;
}

.lp-op-trust svg {
    width: 16px;
    height: 16px;
    fill: var(--op-ok);
    flex-shrink: 0;
}

/* ---------- شريط الموبايل ---------- */
.lp-op-bar {
    display: none;
}

@media (max-width: 900px) {
    .lp-op {
        padding: 38px 14px 30px;
    }

    .lp-op-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .lp-op-summary {
        position: static;
    }

    .lp-op-title {
        font-size: 24px;
    }

    .lp-op-sub {
        font-size: 14px;
    }

    .lp-op-card {
        padding: 18px 16px;
        border-radius: 18px;
    }

    .lp-op-input input,
    .lp-op-select-btn {
        padding-top: 14px;
        padding-bottom: 14px;
        font-size: 16px; /* يمنع تكبير iOS */
    }

    .lp-op-bar {
        display: flex;
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 9998;
        align-items: center;
        gap: 12px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--op-line);
        box-shadow: 0 -4px 20px rgba(16, 24, 40, .08);
        transform: translateY(110%);
        transition: transform .25s ease;
    }

    .lp-op-bar.show {
        transform: none;
    }

    .lp-op-bar[hidden] {
        display: none !important;
    }

    .lp-op-bar-total {
        display: flex;
        flex-direction: column;
        line-height: 1.25;
    }

    .lp-op-bar-total small {
        font-size: 11px;
        color: var(--op-muted);
    }

    .lp-op-bar-total b {
        font-size: 18px;
        font-weight: 900;
        color: var(--primary, #ff6b00);
        white-space: nowrap;
    }

    .lp-op-bar-btn {
        flex: 1;
        padding: 14px;
        border: none;
        border-radius: 13px;
        background: var(--primary, #ff6b00);
        color: #fff;
        font-family: inherit;
        font-size: 16px;
        font-weight: 900;
        cursor: pointer;
    }

    /* لما شريط الطلب يظهر نخفي زرار الـCTA العائم عشان مايبقاش فيه زرارين */
    body.lp-op-bar-on .lp-floating {
        display: none !important;
    }
}

/* اهتزاز تنبيهي لقسم المواصفات لو العميل نسي يختار */
.lp-op-shake {
    animation: lp-op-shake .5s ease;
}

@keyframes lp-op-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-7px); }
    40%      { transform: translateX(7px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}


/* ---------- كوبون الخصم ---------- */
.lp-op-coupon {
    padding: 12px 0 0;
    border-top: 1px solid var(--op-line);
}

.lp-op-coupon-toggle {
    background: none;
    border: none;
    padding: 2px 0;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary, #ff6b00);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lp-op-coupon-box {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.lp-op-coupon-box[hidden] { display: none; }

.lp-op-coupon-box input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1.5px solid var(--op-field, #c8d2de);
    border-radius: 12px;
    background: var(--op-field-bg, #fafbfd);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--dark, #111);
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.lp-op-coupon-box input::placeholder {
    font-weight: 400;
    letter-spacing: 0;
    color: #98a4b3;
}

.lp-op-coupon-box input:focus {
    background: #fff;
    border-color: var(--primary, #ff6b00);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary, #ff6b00) 12%, transparent);
}

.lp-op-coupon-box button {
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    background: var(--dark, #111);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: opacity .2s;
}

.lp-op-coupon-box button:hover { opacity: .88; }
.lp-op-coupon-box button:disabled { opacity: .5; cursor: default; }

.lp-op-coupon-msg {
    margin-top: 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--op-err, #ef4444);
}

.lp-op-coupon-msg.ok { color: var(--op-ok, #16a34a); }

.lp-op-coupon-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: color-mix(in srgb, var(--op-ok, #16a34a) 9%, #fff);
    border: 1px solid color-mix(in srgb, var(--op-ok, #16a34a) 30%, #fff);
    border-radius: 12px;
    padding: 10px 12px;
}

.lp-op-coupon-chip[hidden] { display: none; }

.lp-op-coupon-chip span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: #0f766e;
}

.lp-op-coupon-chip svg {
    width: 15px;
    height: 15px;
    fill: var(--op-ok, #16a34a);
    flex-shrink: 0;
}

.lp-op-coupon-chip b {
    font-weight: 900;
    letter-spacing: .5px;
}

.lp-op-coupon-chip button {
    background: none;
    border: none;
    font-size: 19px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0 2px;
}

.lp-op-coupon-chip button:hover { color: var(--op-err, #ef4444); }

.lp-op-disc span:last-child { color: var(--op-ok, #16a34a) !important; }
