/* Spare-part request page + its confirmation (piece_request.php, piece_request_confirmation.php).
   Brand: navy #1B3A5F, orange #E85D04, Manrope titles / Inter text (Cairo in Arabic). Behaviour in assets/js/piece_request.js. */
.pr-page { --pr-navy: #1B3A5F; --pr-navy-d: #0B1A2D; --pr-orange: #E85D04; --pr-orange-d: #C94F03; --pr-line: #DCE3EC; --pr-muted: #5B6B80; background: #F3F6FA; padding-bottom: 3rem; }
/* The floating call / social buttons would cover the fixed send button: hidden on this page only */
.floating-contact { display: none !important; }

/* ---------- Header ---------- */
.pr-hero { position: relative; isolation: isolate; color: #fff; padding: 3rem 0 6.5rem; overflow: hidden; background: var(--pr-navy-d); }
.pr-hero-bg { position: absolute; inset: 0; background: url("../img/piece-hero.webp") right center / cover no-repeat; }
/* Arabic: text on the right, so the photo is mirrored to keep the parts visible on the free side */
html[dir="rtl"] .pr-hero-bg { transform: scaleX(-1); }
.pr-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(11, 26, 45, .94) 0%, rgba(27, 58, 95, .82) 55%, rgba(27, 58, 95, .55) 100%); }
html[dir="rtl"] .pr-hero::before { background: linear-gradient(270deg, rgba(11, 26, 45, .94) 0%, rgba(27, 58, 95, .82) 55%, rgba(27, 58, 95, .55) 100%); }
.pr-hero > .container { position: relative; z-index: 2; }
.pr-eyebrow { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem; border-radius: 999px; background: rgba(232, 93, 4, .16); border: 1px solid rgba(232, 93, 4, .45); color: #FFB37A; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
html[dir="rtl"] .pr-eyebrow { letter-spacing: 0; }
.pr-hero-title { font-family: Manrope, sans-serif; font-weight: 800; font-size: clamp(1.7rem, 4.6vw, 2.75rem); line-height: 1.15; margin: 1rem 0 .6rem; max-width: 22ch; }
html[dir="rtl"] .pr-hero-title { font-family: Cairo, sans-serif; line-height: 1.35; }
.pr-hero-sub { font-size: 1.05rem; color: rgba(255, 255, 255, .86); max-width: 46ch; margin-bottom: 1.6rem; }
.pr-how { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .75rem; counter-reset: pr; }
.pr-how li { display: flex; align-items: center; gap: .7rem; padding: .6rem .9rem .6rem .6rem; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(6px); }
html[dir="rtl"] .pr-how li { padding: .6rem .6rem .6rem .9rem; }
.pr-how-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 11px; background: var(--pr-orange); color: #fff; font-size: 1.1rem; }
.pr-how-text { display: flex; flex-direction: column; line-height: 1.25; }
.pr-how-text strong { font-size: .92rem; }
.pr-how-text small { font-size: .76rem; color: rgba(255, 255, 255, .72); }

/* ---------- Card ---------- */
.pr-wrap { position: relative; z-index: 1; margin-top: -4.5rem; }
.pr-card {
    max-width: 760px; margin: 0 auto; background: #fff; border-radius: 22px; padding: 1.75rem 2rem 1.5rem;
    box-shadow: 0 30px 60px -30px rgba(11, 26, 45, .45), 0 2px 6px rgba(11, 26, 45, .06); border: 1px solid rgba(27, 58, 95, .06);
}
.pr-progress { margin-bottom: 1.5rem; }
.pr-progress-steps { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .7rem; }
.pr-progress-step { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 600; color: var(--pr-muted); }
.pr-progress-step b { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--pr-line); font-size: .78rem; background: #fff; transition: all .3s ease; }
.pr-progress-step.is-active { color: var(--pr-navy); }
.pr-progress-step.is-active b { border-color: var(--pr-orange); color: var(--pr-orange); }
.pr-progress-step.is-done b { background: var(--pr-orange); border-color: var(--pr-orange); color: #fff; }
.pr-progress-bar { height: 4px; border-radius: 4px; background: #E9EEF4; overflow: hidden; }
.pr-progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--pr-orange), #FF8A3D); border-radius: 4px; transition: width .45s cubic-bezier(.4, 0, .2, 1); }
html[dir="rtl"] .pr-progress-bar span { margin-inline-start: 0; background: linear-gradient(270deg, var(--pr-orange), #FF8A3D); }

.pr-step-title { font-family: Manrope, sans-serif; font-size: 1.15rem; font-weight: 800; color: var(--pr-navy); margin: 0 0 1.1rem; outline: none; }
html[dir="rtl"] .pr-step-title { font-family: Cairo, sans-serif; }
.pr-step.from-fwd { animation: pr-in-fwd .35s ease both; }
.pr-step.from-back { animation: pr-in-back .35s ease both; }
@keyframes pr-in-fwd { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes pr-in-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
html[dir="rtl"] .pr-step.from-fwd { animation-name: pr-in-back; }
html[dir="rtl"] .pr-step.from-back { animation-name: pr-in-fwd; }

.pr-alert { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; margin-bottom: 1.2rem; border-radius: 12px; background: #FFF1EE; border: 1px solid #F5C2B5; color: #8A2A12; font-size: .92rem; }
.pr-alert i { font-size: 1.15rem; }

/* ---------- Photo zone ---------- */
.pr-photo {
    border: 2px dashed #C6D2E0; border-radius: 18px; padding: 1.4rem; margin-bottom: 1.3rem; text-align: center;
    background: linear-gradient(180deg, #FBFCFE, #F2F6FB); transition: border-color .25s ease, background-color .25s ease;
}
.pr-photo.is-drag { border-color: var(--pr-orange); background: #FFF6EF; }
.pr-photo.has-photos { border-style: solid; border-color: rgba(232, 93, 4, .35); }
.pr-photo-empty { display: flex; flex-direction: column; align-items: center; gap: .3rem; color: var(--pr-navy); }
.pr-photo.has-photos .pr-photo-empty { display: none; }
.pr-photo-icon { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--pr-orange); font-size: 1.9rem; box-shadow: 0 10px 24px -14px rgba(232, 93, 4, .7); margin-bottom: .35rem; }
.pr-photo-empty strong { font-size: 1.02rem; }
.pr-photo-empty small { color: var(--pr-muted); font-size: .84rem; }
.pr-thumbs { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.pr-thumbs:empty { display: none; }
.pr-thumb { position: relative; width: 88px; height: 88px; border-radius: 12px; overflow: hidden; background: #E9EEF4; animation: pr-pop .3s ease both; }
.pr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pr-thumb-del { position: absolute; top: 4px; inset-inline-end: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(11, 26, 45, .75); color: #fff; font-size: .75rem; }
@keyframes pr-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.pr-photo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1rem; }
.pr-tips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; padding: 0; margin: 1rem 0 0; font-size: .8rem; color: var(--pr-muted); }
.pr-tips i { color: var(--pr-orange); margin-inline-end: .25rem; }

/* ---------- Buttons ---------- */
.pr-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.25rem;
    border-radius: 12px; border: 1.5px solid transparent; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.pr-btn:active { transform: scale(.98); }
.pr-btn-orange { background: var(--pr-orange-d); color: #fff; box-shadow: 0 10px 22px -12px rgba(232, 93, 4, .9); }
.pr-btn-orange:hover { background: #A94202; color: #fff; }
.pr-btn-ghost { background: #fff; color: var(--pr-navy); border-color: var(--pr-line); }
.pr-btn-ghost:hover { border-color: var(--pr-navy); color: var(--pr-navy); }
.pr-btn:focus-visible, .pr-link:focus-visible, .pr-more summary:focus-visible { outline: 3px solid rgba(232, 93, 4, .45); outline-offset: 2px; }
.pr-btn[disabled] { opacity: .75; cursor: progress; }
.pr-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pr-btn:focus-within { outline: 3px solid rgba(232, 93, 4, .45); outline-offset: 2px; }
.pr-link { background: none; border: 0; padding: .2rem .3rem; color: var(--pr-orange); font-weight: 700; font-size: .85rem; }

/* ---------- Fields ---------- */
.pr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.pr-field { margin-bottom: 1rem; }
.pr-field label { display: block; font-size: .86rem; font-weight: 600; color: var(--pr-navy); margin-bottom: .35rem; }
.pr-input { position: relative; }
.pr-input > i { position: absolute; top: 50%; inset-inline-start: .95rem; transform: translateY(-50%); color: #8597AD; pointer-events: none; transition: color .2s ease; }
.pr-input input, .pr-input select, .pr-field textarea {
    width: 100%; min-height: 50px; border: 1.5px solid var(--pr-line); border-radius: 12px; background: #fff; color: #10233A;
    font-size: 1rem; padding: .7rem 2.6rem .7rem 2.6rem; transition: border-color .2s ease, box-shadow .2s ease; appearance: none;
}
.pr-field textarea { padding: .75rem 1rem; resize: vertical; min-height: 90px; }
.pr-input select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235B6B80' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; }
html[dir="rtl"] .pr-input select { background-position: left 1rem center; }
.pr-input select:disabled { background-color: #F5F7FA; color: #8597AD; }
.pr-input input::placeholder, .pr-field textarea::placeholder { color: #9AA8B9; }
.pr-input input:focus, .pr-input select:focus, .pr-field textarea:focus { outline: none; border-color: var(--pr-orange); box-shadow: 0 0 0 4px rgba(232, 93, 4, .14); }
.pr-input:focus-within > i { color: var(--pr-orange); }
/* Check mark once a field is correct; red border when a required field is missing */
.pr-input::after { content: "\F26E"; font-family: bootstrap-icons; position: absolute; top: 50%; inset-inline-end: .9rem; transform: translateY(-50%) scale(.4); color: #1E9E5A; opacity: 0; transition: opacity .2s ease, transform .25s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.pr-input.is-ok::after { opacity: 1; transform: translateY(-50%) scale(1); }
.pr-input:has(select)::after { inset-inline-end: 2.3rem; }
.pr-input.is-bad input, .pr-input.is-bad select { border-color: #D9472B; }
.pr-help { display: block; margin-top: .35rem; font-size: .8rem; color: var(--pr-muted); }
.pr-field-error, .pr-error { display: block; margin: .35rem 0 0; font-size: .82rem; color: #C2391D; font-weight: 600; }
.pr-error { margin: 0 0 .5rem; }
.pr-shake { animation: pr-shake .4s ease; }
@keyframes pr-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.pr-more { margin-bottom: .8rem; border-top: 1px solid #EEF2F6; padding-top: .8rem; }
.pr-more summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .9rem; color: var(--pr-navy); padding: .3rem 0; margin-bottom: .6rem; }
.pr-more summary::-webkit-details-marker { display: none; }
.pr-more summary i { color: var(--pr-orange); transition: transform .25s ease; }
.pr-more[open] summary i { transform: rotate(45deg); }

/* ---------- Review ---------- */
.pr-review { display: grid; gap: .8rem; margin-bottom: 1.2rem; }
.pr-review-block { border: 1px solid var(--pr-line); border-radius: 14px; padding: .9rem 1rem; background: #FBFCFE; }
.pr-review-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--pr-navy); margin-bottom: .5rem; }
.pr-review-head i { color: var(--pr-orange); margin-inline-end: .3rem; }
.pr-review-thumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.pr-review-thumbs .pr-thumb { width: 56px; height: 56px; border-radius: 9px; }
.pr-review dl { margin: 0; display: grid; gap: .3rem; }
.pr-review dl div { display: flex; gap: .6rem; font-size: .9rem; }
.pr-review dt { font-weight: 500; color: var(--pr-muted); min-width: 38%; }
.pr-review dd { margin: 0; color: #10233A; font-weight: 600; word-break: break-word; }
.pr-muted { color: var(--pr-muted); font-size: .88rem; }
.pr-trust { display: flex; gap: .55rem; align-items: flex-start; font-size: .84rem; color: var(--pr-muted); margin: .4rem 0 0; }
.pr-trust i { color: #1E9E5A; font-size: 1.1rem; }

/* ---------- Navigation ---------- */
.pr-actions { display: flex; gap: .7rem; justify-content: flex-end; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid #EEF2F6; }
.pr-actions .pr-btn-main { min-width: 210px; }
.pr-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: pr-spin .8s linear infinite; }
@keyframes pr-spin { to { transform: rotate(360deg); } }
.pr-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 1080; background: #10233A; color: #fff; padding: .65rem 1rem; border-radius: 10px; font-size: .88rem; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5); transition: opacity .4s ease; }
.pr-toast.is-out { opacity: 0; }

/* ---------- Phones ---------- */
@media (max-width: 767.98px) {
    .pr-hero { padding: 2rem 0 5.5rem; }
    .pr-hero-bg { background-image: url("../img/piece-hero-mobile.webp"); background-position: center bottom; }
    html[dir="rtl"] .pr-hero-bg { transform: none; }
    .pr-hero::before, html[dir="rtl"] .pr-hero::before { background: linear-gradient(180deg, rgba(11, 26, 45, .93) 0%, rgba(27, 58, 95, .86) 60%, rgba(27, 58, 95, .78) 100%); }
    .pr-hero-sub { font-size: .98rem; margin-bottom: 1.2rem; }
    .pr-how { gap: .5rem; flex-wrap: nowrap; }
    .pr-how li { flex: 1 1 0; flex-direction: column; text-align: center; padding: .6rem .35rem; gap: .4rem; min-width: 0; }
    html[dir="rtl"] .pr-how li { padding: .6rem .35rem; }
    .pr-how-icon { width: 36px; height: 36px; flex-basis: 36px; }
    .pr-how-text strong { font-size: .78rem; }
    .pr-how-text small { display: none; }
    .pr-wrap { margin-top: -3.8rem; }
    .pr-card { padding: 1.2rem 1.1rem 1rem; border-radius: 20px; }
    .pr-progress-step span { display: none; }
    .pr-progress-step.is-active span { display: inline; }
    .pr-row { grid-template-columns: 1fr; }
    .pr-photo { padding: 1.1rem .8rem; }
    .pr-photo-actions .pr-btn { flex: 1 1 100%; }
    .pr-page { padding-bottom: 6.5rem; }
    /* Send / next button always under the thumb */
    .pr-actions {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; margin: 0; border: 0;
        padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(10px); box-shadow: 0 -10px 30px -18px rgba(11, 26, 45, .5);
    }
    .pr-actions .pr-btn-main { flex: 1; min-width: 0; }
    .pr-actions #pr-back { flex: 0 0 auto; padding-inline: 1rem; }
}

/* ---------- Confirmation ---------- */
.pr-done { max-width: 560px; margin: 0 auto; text-align: center; padding: 2.4rem 2rem 2rem; }
.pr-check { width: 92px; height: 92px; margin: 0 auto 1.2rem; }
.pr-check circle { fill: none; stroke: #1E9E5A; stroke-width: 4; stroke-dasharray: 260; stroke-dashoffset: 260; animation: pr-draw .7s ease-out .1s forwards; }
.pr-check path { fill: none; stroke: #1E9E5A; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: pr-draw .45s ease-out .7s forwards; }
.pr-check-bg { fill: rgba(30, 158, 90, .1); stroke: none !important; animation: none !important; }
@keyframes pr-draw { to { stroke-dashoffset: 0; } }
.pr-done h1 { font-family: Manrope, sans-serif; font-weight: 800; color: var(--pr-navy); font-size: 1.6rem; }
html[dir="rtl"] .pr-done h1 { font-family: Cairo, sans-serif; }
.pr-ref { display: inline-flex; flex-direction: column; gap: .15rem; margin: .4rem 0 1rem; padding: .7rem 1.4rem; border-radius: 14px; background: #F3F6FA; border: 1px dashed #B9C6D6; }
.pr-ref small { font-size: .75rem; color: var(--pr-muted); text-transform: uppercase; letter-spacing: .05em; }
.pr-ref strong { font-size: 1.3rem; color: var(--pr-navy); letter-spacing: .04em; }
.pr-done p { color: var(--pr-muted); }
.pr-btn-wa { background: #25D366; color: #fff; width: 100%; font-size: 1.02rem; min-height: 54px; box-shadow: 0 12px 24px -14px rgba(37, 211, 102, .9); }
.pr-btn-wa:hover { background: #1EBE5A; color: #fff; }
.pr-done .pr-btn-ghost { width: 100%; margin-top: .6rem; }

@media (prefers-reduced-motion: reduce) {
    .pr-step.from-fwd, .pr-step.from-back, .pr-thumb, .pr-shake { animation: none; }
    .pr-check circle, .pr-check path { animation: none; stroke-dashoffset: 0; }
    .pr-progress-bar span, .pr-input::after { transition: none; }
}
