/* SALSA — Order Page Styles */

/* HEADER */
.order-header{background:var(--black);padding:36px 20px;text-align:center;color:#fff;border-bottom:3px solid var(--tan)}
.order-header h1{font-size:clamp(1.8rem,4vw,2.8rem);font-weight:900;margin-bottom:6px}
.order-header p{opacity:.85;font-size:.95rem}

/* STEP INDICATOR — 3 steps */
.order-steps{display:flex;align-items:center;justify-content:center;padding:28px 20px 0;gap:0;max-width:480px;margin:0 auto}
.step{display:flex;flex-direction:column;align-items:center;gap:6px;flex:1;position:relative}
.step:not(:last-child)::after{content:'';position:absolute;top:18px;left:calc(50% + 20px);width:calc(100% - 40px);height:2px;background:var(--border);z-index:0}
.step.done:not(:last-child)::after{background:var(--green)}
.step.active:not(:last-child)::after{background:var(--red)}
.step-num{width:38px;height:38px;border-radius:50%;background:var(--border);color:var(--gray-text);font-weight:700;font-size:.9rem;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;transition:all .25s ease}
.step.active .step-num{background:var(--red);color:var(--white);box-shadow:0 0 0 4px rgba(192,24,46,.15)}
.step.done .step-num{background:var(--green);color:var(--white)}
.step-label{font-size:.68rem;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:var(--gray-text);text-align:center}
.step.active .step-label{color:var(--red)}
.step.done .step-label{color:var(--green)}

/* PANELS */
.order-panel{display:none;max-width:680px;margin:0 auto;padding:24px 20px 60px}
.order-panel.active{display:block}
.order-panel-section{background:var(--white);border-radius:20px;padding:24px;margin-bottom:20px;border:1px solid var(--border);box-shadow:0 2px 12px rgba(38,38,38,0.05)}
.order-section-title{font-size:1rem;font-weight:700;margin-bottom:18px;color:var(--black)}
.order-panel-title{font-size:1.3rem;font-weight:900;margin-bottom:20px}
.add-more-link{display:inline-flex;align-items:center;gap:6px;color:var(--red);font-size:.85rem;font-weight:700;margin-top:14px;transition:opacity .2s}
.add-more-link:hover{opacity:.75}

/* CART ITEMS IN ORDER PAGE */
.order-cart-item{display:flex;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid var(--border)}
.order-cart-item:last-of-type{border-bottom:none}
.order-cart-item-info{flex:1;min-width:0}
.order-cart-item-name{font-weight:700;font-size:.95rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.order-cart-item-detail{font-size:.78rem;color:var(--gray-text);margin-top:2px}
.order-cart-item-price{font-weight:700;color:var(--red);white-space:nowrap;font-size:.95rem}
.order-item-qty{display:flex;align-items:center;gap:6px;background:var(--gray-bg);border-radius:var(--radius-pill);padding:3px 6px;flex-shrink:0}
.order-item-qty button{width:26px;height:26px;border-radius:50%;background:var(--white);border:1px solid var(--border);font-size:.95rem;font-weight:700;display:flex;align-items:center;justify-content:center;transition:all .2s}
.order-item-qty button:hover{background:var(--red);color:var(--white);border-color:var(--red)}
.order-item-qty span{min-width:22px;text-align:center;font-weight:700;font-size:.9rem}
.order-item-remove{width:30px;height:30px;border-radius:50%;background:rgba(192,24,46,.09);color:var(--red);font-size:1rem;font-weight:700;display:flex;align-items:center;justify-content:center;transition:all .2s;flex-shrink:0}
.order-item-remove:hover{background:var(--red);color:var(--white)}

/* TYPE CARDS */
.type-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:16px}
.type-card{border:2px solid var(--border);border-radius:18px;padding:20px 14px;text-align:center;cursor:pointer;transition:all .2s ease;background:var(--white);user-select:none}
.type-card:hover{border-color:var(--red);background:rgba(192,24,46,.03);transform:translateY(-2px)}
.type-card.selected{border-color:var(--red);background:rgba(192,24,46,.05);box-shadow:0 0 0 3px rgba(192,24,46,.12)}
.type-icon{font-size:2rem;margin-bottom:8px}
.type-name{font-size:1rem;font-weight:800;margin-bottom:4px}
.type-info{font-size:.75rem;color:var(--gray-text);line-height:1.4;margin-bottom:10px}
.type-price{display:inline-block;background:var(--red);color:var(--white);border-radius:var(--radius-pill);padding:4px 14px;font-size:.78rem;font-weight:700}
.type-price.free{background:var(--green)}

/* LIVE TOTAL BOX */
.order-live-total{background:var(--cream);border-radius:18px;padding:20px 24px;margin-bottom:20px;border:2px solid rgba(192,24,46,.15)}
.live-total-row{display:flex;justify-content:space-between;align-items:center;font-size:.95rem;padding:6px 0;border-bottom:1px solid rgba(38,38,38,.07)}
.live-total-row:last-child{border-bottom:none}
.live-grand-total{font-size:1.2rem;font-weight:900;padding-top:12px;margin-top:4px}
.live-grand-total span:last-child{color:var(--red)}

/* FORM */
.form-group{margin-bottom:18px}
.form-label{display:block;font-size:.88rem;font-weight:700;margin-bottom:8px;color:var(--black)}
.form-control{width:100%;padding:14px 16px;border:2px solid var(--border);border-radius:14px;font-size:1rem;font-family:'Outfit',sans-serif;color:var(--black);transition:border-color .2s;background:var(--white)}
.form-control:focus{outline:none;border-color:var(--red)}
.form-hint{font-size:.78rem;color:var(--gray-text);margin-top:5px;line-height:1.4}
.phone-wrap{display:flex;align-items:center;border:2px solid var(--border);border-radius:14px;overflow:hidden;transition:border-color .2s;background:var(--white)}
.phone-wrap:focus-within{border-color:var(--red)}
.phone-prefix{padding:14px 14px;font-weight:700;color:var(--gray-text);border-right:1px solid var(--border);background:var(--gray-bg);white-space:nowrap;font-size:.95rem}
.phone-wrap input{border:none;outline:none;padding:14px 14px;font-size:1.05rem;font-family:'Outfit',sans-serif;flex:1;background:transparent;color:var(--black);letter-spacing:.04em}
.loyalty-hint{font-size:.82rem;font-weight:700;color:var(--red);margin-top:8px}

.reward-prompt{display:flex;align-items:center;gap:10px;background:#fff5f5;border:2px solid var(--red);border-radius:14px;padding:14px 16px;margin-bottom:16px;font-weight:700;font-size:.92rem;cursor:pointer}
.reward-prompt input{width:20px;height:20px;flex-shrink:0}

/* MAP */
.map-label{font-size:.88rem;font-weight:700;margin-bottom:4px}
.map-hint{font-size:.8rem;color:var(--gray-text);margin-bottom:10px;line-height:1.4}
#delivery-map{width:100%;height:300px;border-radius:16px;border:2px solid var(--border);overflow:hidden;margin-bottom:8px}
.pin-coords{font-size:.82rem;color:var(--gray-text);min-height:20px;margin-top:4px}

/* SUMMARY */
.summary-box{background:var(--gray-bg);border-radius:16px;padding:20px;margin-bottom:20px}
.summary-row{display:flex;justify-content:space-between;align-items:center;padding:9px 0;border-bottom:1px solid var(--border);font-size:.9rem;gap:12px}
.summary-row:last-child{border-bottom:none}
.summary-val{font-weight:700;text-align:right}
.summary-row-type .summary-val{color:var(--red)}
.summary-row-total{font-size:1.1rem;font-weight:900;padding-top:14px;margin-top:4px;border-top:2px solid var(--black)!important}
.summary-total-amount{color:var(--red);font-size:1.4rem}

/* CALL CONFIRM BOX */
.call-confirm-box{display:flex;gap:16px;align-items:flex-start;background:rgba(49,88,47,.07);border:1.5px solid rgba(49,88,47,.25);border-radius:16px;padding:18px}
.call-icon{font-size:2rem;flex-shrink:0;margin-top:2px}
.call-title{font-weight:700;font-size:.95rem;margin-bottom:4px;color:var(--green)}
.call-sub{font-size:.83rem;color:var(--gray-text);line-height:1.5}

/* NAV */
.order-nav{display:flex;gap:12px;justify-content:space-between;padding-top:4px}

/* RESPONSIVE */
@media(max-width:520px){
  .type-grid{grid-template-columns:1fr}
  #delivery-map{height:240px}
  .order-panel{padding:16px 12px 60px}
}

/* Map placeholder while Leaflet loads on demand (or if it never arrives) */
.map-loading{display:flex;align-items:center;justify-content:center;height:100%;min-height:240px;
  padding:20px;text-align:center;color:var(--gray-text);font-size:.9rem;font-weight:700;
  background:var(--gray-bg);border-radius:16px}

/* Keep the confirm row clear of anything floating at the bottom of the screen */
.order-panel{padding-bottom:calc(40px + var(--safe-bottom))}
.order-nav{padding-bottom:calc(8px + var(--safe-bottom))}

/* ─── MAP: markers, zone and status ───────────────────────────────────────── */
.map-pin-marker{font-size:2.4rem;line-height:1;filter:drop-shadow(0 3px 6px rgba(38,38,38,.45));cursor:grab}
.map-pin-marker:active{cursor:grabbing}
.map-shop-marker{font-size:1.6rem;line-height:34px;text-align:center;background:#fff;border-radius:50%;
  width:34px;height:34px;box-shadow:0 2px 8px rgba(38,38,38,.25);border:2px solid var(--red)}

/* Status line under the map — one clear sentence, colour-coded */
.pin-coords{font-size:.86rem;line-height:1.45;min-height:22px;margin-top:8px;padding:10px 12px;
  border-radius:12px;background:var(--gray-bg);color:var(--gray-text)}
.pin-coords.is-ok{background:rgba(49,88,47,.10);color:var(--green)}
.pin-coords.is-warn{background:rgba(180,83,9,.10);color:#b45309}
.pin-coords.is-err{background:rgba(192,24,46,.09);color:var(--red)}
.pin-coords strong{font-weight:900}

.pin-inline-btn{background:var(--red);color:#fff;border:none;border-radius:10px;
  padding:8px 14px;font-weight:700;font-size:.82rem;font-family:inherit;cursor:pointer;
  margin-left:6px;min-height:36px}
.pin-inline-btn:hover{background:var(--red-dark)}

/* "Me localiser" is the primary action here, so make it look like one */
#locate-me-btn{min-height:44px}

/* Leaflet's own controls must not fight the site's layers */
.leaflet-pane,.leaflet-control{z-index:auto !important}
.leaflet-top,.leaflet-bottom{z-index:400 !important}

.map-wrap{position:relative}
.map-locate-btn{position:absolute;top:10px;right:10px;z-index:500;background:#fff;
  border:2px solid var(--red);color:var(--red);border-radius:12px;padding:10px 14px;
  font-size:.85rem;font-weight:900;font-family:inherit;cursor:pointer;
  box-shadow:0 2px 10px rgba(38,38,38,.18);min-height:44px}
.map-locate-btn:disabled{opacity:.65;cursor:default}

/* ─── CART ROWS ON NARROW SCREENS ───────────────────────────────────────────
   The quantity and remove controls are 44px touch targets, which on a 375px
   phone left almost no room for the dish name (it truncated to "P…"). Below
   560px the row becomes two lines: name on top, controls underneath. */
@media (max-width: 560px) {
  .order-cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "info  info  remove"
      "qty   price price";
    align-items: center;
    row-gap: 8px;
    column-gap: 10px;
  }
  .order-cart-item-info   { grid-area: info; }
  .order-item-qty         { grid-area: qty;    justify-self: start; }
  .order-cart-item-price  { grid-area: price;  justify-self: end; font-size: 1rem; }
  .order-item-remove      { grid-area: remove; justify-self: end; }
  .order-cart-item-name   { white-space: normal; }   /* wrap instead of truncate */
}

/* ─── NEIGHBOURHOOD CHIPS ───────────────────────────────────────────────────
   Tapping the name of your quartier is far easier than dropping a pin for
   someone who has not used a map before. */
.zone-chips{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:12px}
.zone-chips-label{width:100%;font-size:.82rem;color:var(--gray-text);font-weight:700;margin-bottom:2px}
.zone-chip{padding:0 14px;min-height:44px;border-radius:var(--radius-pill,50px);
  border:1.5px solid var(--border);background:var(--white);font-family:inherit;
  font-size:.86rem;font-weight:700;cursor:pointer;color:var(--black)}
.zone-chip.is-on{background:var(--red);border-color:var(--red);color:#fff}

.call-eta{font-size:.88rem;font-weight:700;color:var(--green);margin-top:6px}
.summary-row-reward{color:var(--green);font-weight:700}.summary-pay{margin-top:12px;font-size:.85rem;font-weight:700;color:var(--green);text-align:center}.type-card[aria-pressed="true"]{border-color:var(--red)}
