/* ============================================================
   🧾 ORDER TRACKER PANEL — Fluid Flat Layout (v2.0 merged)
   ------------------------------------------------------------
   • Preserves panel transitions
   • Unified flat container and card design
   • Lazada-style timeline, delivery, and product layout
============================================================ */

/* --- Panel Header --- */
.sf-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e5e5;
  background: var(--mh-primary);
  position: sticky;
  top: 0;
  z-index: 3;
}

/* --- Body --- */
.sf-order-tracker .sf-panel-body {
  flex: 1;
  overflow-y: auto;
}

/* --- Tabs --- */
.sf-tracker-tabs {
  display: flex;
  justify-content: space-around;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 12px;
}
.sf-tab-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.sf-tab-btn.active {
  color: var(--color-primary, #28a745);
  border-bottom: 2px solid var(--color-primary, #28a745);
}

/* --- Container --- */
.sf-tracker-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0px 0px 0px;
  box-sizing: border-box;
  padding-bottom: 55px;
}

/* --- Card Base --- */
.sf-tracker-card,
.sf-delivery-card,
.sf-products-card {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 10px 18px;
}

/* ============================================================
   🟢 STATUS TIMELINE CARD
============================================================ */
.sf-tracker-status-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.sf-status-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #155724;
}
.sf-status-delivery-date {
  font-size: 0.9rem;
  color: #007bff;
  font-weight: 600;
  white-space: nowrap;
}
/* ============================================================
   • One element per bullet (no pseudo)
   • Consistent alignment across screen sizes
============================================================ */
.sf-timeline {
  position: relative;
  padding-left: 40px; /* spacing for text */
  margin-top: 10px;
}

/* vertical line behind bullets */
.sf-timeline::before {
  content: "";
  position: absolute;
  left: 16px; /* ✅ shared center axis for line and bullet */
  top: 0;
  bottom: 0;
  width: 2px;
  background: #155724;
  z-index: 0;
}

/* each status item */
.sf-timeline-item {
  position: relative;
  margin-bottom: 24px;
}

/* single bullet perfectly intersecting the line */
.sf-timeline-marker {
  position: absolute;
  top: 2.5px;
  left: -31px;               /* ✅ centers the bullet on the same column as line */
  width: 16px;
  height: 16px;
  background: #28a745;     /* inner fill */
  border: 3px solid #fff;  /* white ring (gap) */
  outline: 2px solid #28a745; /* outer border */
  border-radius: 50%;
  box-sizing: border-box;
  z-index: 2;
}

/* first (active) marker — darker color */
.sf-timeline-item:first-child .sf-timeline-marker {
  background: #1e7e34;
  outline-color: #1e7e34;
}

/* text content */
.sf-timeline-date {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 2px;
}
.sf-timeline-desc {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.4;
}

/* ============================================================
   📦 DELIVERY DETAILS CARD
============================================================ */
.sf-delivery-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #155724;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.sf-delivery-card h3 i {
  color: #28a745;
  width: 18px;
  height: 18px;
}
.sf-delivery-name {
  font-weight: 600;
  color: #111;
}
.sf-delivery-mobile {
  font-weight: 500;
  color: #333;
}
.sf-delivery-address {
  font-size: 0.95rem;
  color: #555;
  margin-top: 0px;
  line-height: 1.4;
}

/* ============================================================
   🛒 PRODUCT CAROUSEL CARD
============================================================ */
.sf-product-carousel {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 6px 0 8px;
  scrollbar-width: none;
}
.sf-product-carousel::-webkit-scrollbar { display: none; }

.sf-product-item {
  flex: 0 0 70px;
  text-align: center;
}
.sf-product-thumb {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  background: #f6f6f6;
  margin-bottom: 4px;
}
.sf-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sf-product-name {
  font-size: 0.8rem;
  color: #333;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-timeline-status-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

/* ============================================================
   ⚙️ RESPONSIVE
============================================================ */
@media (min-width: 1024px) {
  .sf-tracker-container {
    padding: 20px 40px 100px;
  }
  .sf-tracker-card,
  .sf-delivery-card,
  .sf-products-card {
    padding: 20px 24px;
  }
  .sf-status-name {
    font-size: 1.25rem;
  }
  .sf-product-item {
    flex: 0 0 80px;
  }
  .sf-products-card {
   margin-bottom: 20px;
}

}
/* ============================================================
   🧭 STOREFRONT — TRACKER HEADER SVG ICONS
   ------------------------------------------------------------
   Targets the <svg> icons that Lucide injects into <h3> headers
   ============================================================ */
.sf-order-tracker h3 svg {
  width: 20px !important;
  height: 20px !important;
  stroke-width: 1.8 !important;
  color: var(--color-primary, #155724);
  stroke: var(--color-primary, #155724);
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

/* Optional: tweak spacing + alignment of the entire header */
.sf-order-tracker h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #155724;
  margin-bottom: 10px;
}

.sf-product-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: max-content; /* keep image size as the reference */
}

.sf-product-thumb {
  width: 120px; /* USE EXISTING IMAGE WIDTH VALUE HERE */
}

.sf-product-thumb img {
  width: 100%;
  display: block;
}

.sf-product-name {
  width: 100%;              /* ⬅️ THIS IS THE MISSING PIECE */
  max-width: 100%;
  text-align: center;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  line-height: 1.2em;
  max-height: 2.4em;
}

.sf-order-header {
  padding: 10px 14px;
  margin-bottom: 0px;
  margin-left: 10px;
  background: #f8fafc;
  border-left: 4px solid #22c55e; /* FreshMarket green */
  border-radius: 6px;
}

.sf-order-number {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.2px;
}

/* ======================================================
   TO PAY — MODERN CARD UI
====================================================== */

.sf-to-pay-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.sf-to-pay-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sf-to-pay-invoice {
  font-weight: 600;
  font-size: 15px;
}

.sf-to-pay-date {
  font-size: 12px;
  color: #6b7280;
}

.sf-to-pay-products {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sf-to-pay-product-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sf-to-pay-product-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}

.sf-to-pay-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sf-to-pay-product-info {
  flex: 1;
  min-width: 0;
}

.sf-to-pay-product-name {
  font-size: 14px;
  font-weight: 500;
}

.sf-to-pay-product-meta {
  font-size: 12px;
  color: #6b7280;
}

.sf-to-pay-product-total {
  font-weight: 600;
  font-size: 14px;
}

/* ===============================
   SUMMARY
================================ */

.sf-to-pay-summary {
  margin-top: 18px;
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sf-to-pay-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.sf-to-pay-summary-row.grand {
  font-weight: 600;
}

.sf-to-pay-summary-row.highlight {
  font-size: 15px;
  font-weight: 700;
  color: #16a34a;
}

/* ===============================
   PAYMENT METHOD
================================ */

.sf-to-pay-payment {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 13px;
}

.sf-to-pay-payment .label {
  color: #6b7280;
}

.sf-to-pay-payment .value {
  font-weight: 600;
  margin-top: 4px;
}

.sf-to-pay-qr {
  margin-top: 16px;
  text-align: center;
}

.sf-to-pay-qr img {
  width: 140px;
  height: auto;
}

/* =========================================================
   TO-PAY CARD ENHANCEMENTS
   Payment Icon + Header Alignment
========================================================= */

/* Ensure header properly aligns */
.sf-to-pay-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

/* Payment icon container */
.sf-to-pay-mop-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Payment icon image */
.sf-to-pay-mop-icon img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
}

/* Slight spacing between header text rows */
.sf-to-pay-invoice {
    font-weight: 600;
    font-size: 14px;
}

.sf-to-pay-date {
    font-size: 12px;
    color: #6b7280;
    margin-top: 3px;
}

/* Slight polish on card spacing */
.sf-to-pay-card {
    border-radius: 12px;
    padding: 16px;
}

/* Improve summary highlight row */
.sf-to-pay-summary-row.grand.highlight {
    font-weight: 600;
    color: #111827;
}

/* Slight improvement for product rows */
.sf-to-pay-product-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sf-to-pay-product-thumb img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
}

/* Clean consistent total alignment */
.sf-to-pay-product-total {
    font-weight: 600;
    white-space: nowrap;
}

/* ======================================================
   PANEL STRUCTURE FIX
====================================================== */
/* Scroll area padding so footer never overlaps */
#sf-to-pay-list {
  padding-bottom: 40px; /* footer height + navbar + breathing */
}

/* ======================================================
   GROUP PAY FOOTER — FIXED (SAFE)
====================================================== */

.sf-group-pay-footer {
  position: sticky;
  bottom: 55px; /* bottom navbar height */
  background: #ffffff;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
  z-index: 50;
}
.sf-group-pay-summary {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 12px;
}

.sf-group-pay-total {
  font-weight: 700;
  font-size: 16px;
}

.sf-group-pay-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  background: #16a34a;
  color: #ffffff;
  transition: background .2s ease, transform .05s ease;
}

.sf-group-pay-btn:hover {
  background: #15803d;
}

.sf-group-pay-btn:active {
  transform: scale(0.98);
}

/* =========================================================
   💳 PAYMENT MODAL (To-Pay Module v2)
   - QR focused layout
   - Smooth animation
   - Cleaner spacing
========================================================= */

.sf-payment-modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.sf-payment-modal.hidden {
    display: none;
}

/* Modal Box */
.sf-payment-modal-box {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    animation: sfModalEnter 0.22s ease-out;
}

/* Entry Animation */
@keyframes sfModalEnter {
    from {
        transform: translateY(18px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Header */
.sf-payment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 18px;
    color: #111827;
}

.sf-payment-modal-header button {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    color: #6b7280;
    transition: color 0.2s ease;
}

.sf-payment-modal-header button:hover {
    color: #111827;
}

/* Body */
.sf-payment-modal-body {
    text-align: center;
}

/* QR Section */
.sf-payment-qr-wrap {
    margin-bottom: 18px;
}

.sf-payment-qr-wrap img {
    width: 200px;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 8px;
    background: #f9fafb;
}

/* Total Section */
.sf-payment-total-wrap {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.sf-payment-total {
    font-size: 22px;
    font-weight: 700;
    margin: 6px 0 20px;
    color: #111827;
}

/* Download Button */
.sf-payment-download-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: #16a34a;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sf-payment-download-btn:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.sf-payment-download-btn:active {
    transform: translateY(0);
}

/* Mobile Refinement */
@media (max-width: 480px) {
    .sf-payment-modal-box {
        border-radius: 14px;
        padding: 18px;
    }

    .sf-payment-qr-wrap img {
        width: 180px;
    }

    .sf-payment-total {
        font-size: 20px;
    }
}

.sf-payment-capture-area {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
}