<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600&amp;family=DM+Sans:wght@400;500;600;700&amp;family=Lora:wght@600&amp;family=Montserrat:wght@600&amp;display=swap" rel="stylesheet">
  <style>
    html {
      font-size: 15px;
      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
    }

    :root {
      --bg: #ebe7e6;
      --brown: #744e35;
      --dark-brown: #622e10;
      --card: #fffaf7;
      --text: #2f2118;
      --muted: #8b7567;
      --border: #e2d7d0;
      --success: #2f7d52;
      --danger: #b64234;
      --shadow: 0 10px 30px rgba(98, 46, 16, 0.12);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: Arial, Helvetica, sans-serif;
      background: var(--bg);
      color: var(--text);
    }

    button,
    input,
    select,
    textarea {
      font-family: inherit;
    }

    .app {
      max-width: 720px;
      margin: 0 auto;
      padding: 18px 14px 90px;
    }

    .shop-header {
      text-align: center;
      padding: 24px 12px 18px;
    }

    .logo {
      width: 250px;
      height: 250px;
      margin: 0 auto 10px;
      border-radius: 50%;
      background: var(--dark-brown);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      font-weight: 700;
      letter-spacing: 1px;
      box-shadow: var(--shadow);
      overflow: hidden;
      border: 1px solid var(--border);
    }

    .logo img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .shop-name {
      font-size: 22px;
      font-weight: 800;
      margin: 0;
      color: var(--dark-brown);
    }

    .shop-desc {
      max-width: 500px;
      margin: 8px auto 0;
      color: var(--muted);
      line-height: 1.5;
      font-size: 13px;
    }

    .banner {
      background: var(--brown);
      color: #fff;
      padding: 10px 12px;
      border-radius: 14px;
      margin: 10px 0 14px;
      font-size: 12px;
      line-height: 1.4;
      box-shadow: var(--shadow);
    }

    .top-actions {
      display: flex;
      gap: 10px;
      margin: 14px 0 18px;
    }

    .top-actions button {
      flex: 1;
    }

    .section-title {
      font-size: 16px;
      color: var(--dark-brown);
      margin: 20px 0 10px;
    }

    .category-title {
      font-size: 13px;
      color: var(--brown);
      margin: 18px 0 8px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .product-grid {
      display: grid;
      grid-template-columns: 2fr 2fr;
      gap: 20px;
      padding-bottom: 15px;
    }

    .product-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 12px;
      box-shadow: var(--shadow);
      cursor: pointer;
      transition: transform 0.16s ease, box-shadow 0.16s ease;
    }

    .product-card:hover {
      transform: translateY(-2px);
    }

    .product-name {
      font-size: 13px;
      font-weight: 800;
      color: var(--dark-brown);
      margin: 0 0 4px;
    }

    .product-image-wrap {
      width: 100%;
      aspect-ratio: 1 / 1;
      border-radius: 12px;
      overflow: hidden;
      background: #f4ece7;
      margin-bottom: 8px;
      border: 1px solid var(--border);
    }

    .product-image-wrap img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .product-meta {
      display: flex;
      justify-content: space-between;
      gap: 6px;
      align-items: center;
    }

    .product-price {
      font-size: 13px;
      font-weight: 800;
      color: var(--brown);
    }

    .product-weight {
      font-size: 11px;
      color: var(--muted);
    }

    .product-desc {
      font-size: 12px;
      line-height: 1.45;
      color: var(--muted);
      margin: 6px 0 0;
    }

    .product-desc b,
    .product-desc strong {
      font-weight: 800;
      color: var(--dark-brown);
    }

    .product-desc i,
    .product-desc em {
      font-style: italic;
    }

    .product-desc p {
      margin: 6px 0;
    }

    .product-desc ul,
    .product-desc ol {
      margin: 8px 0 8px 18px;
      padding: 0;
    }

    .product-desc li {
      margin: 4px 0;
    }

    .modal-product-image {
      width: 100%;
      aspect-ratio: 1 / 1;
      border-radius: 20px;
      overflow: hidden;
      background: #f4ece7;
      border: 1px solid var(--border);
      margin-bottom: 14px;
    }

    .modal-product-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .modal-product-price {
      font-size: 17px;
      font-weight: 800;
      color: var(--brown);
      margin: 8px 0 10px;
    }

    .btn {
      border: none;
      border-radius: 12px;
      padding: 11px 14px;
      background: var(--dark-brown);
      color: #fff;
      font-weight: 700;
      cursor: pointer;
      font-size: 13px;
    }

    .btn.secondary {
      background: #fff;
      color: var(--dark-brown);
      border: 1px solid var(--border);
    }

    .btn.danger {
      background: var(--danger);
    }

    .btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }

    .cart-bar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      background: #fffaf7;
      border-top: 1px solid var(--border);
      padding: 10px 12px;
      box-shadow: 0 -8px 22px rgba(98, 46, 16, 0.12);
      z-index: 50;
    }

    .cart-bar-inner {
      max-width: 720px;
      margin: 0 auto;
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .cart-summary {
      flex: 1;
      font-size: 13px;
      color: var(--dark-brown);
      font-weight: 700;
    }

    .cart-summary span {
      display: block;
      color: var(--muted);
      font-size: 11px;
      font-weight: 400;
      margin-top: 2px;
    }

    .cart-summary strong {
      display: block;
      font-size: 16px;
      line-height: 1.15;
      font-weight: 900;
      margin-top: 2px;
      color: var(--dark-brown);
    }

    .phone-input-row {
      display: flex;
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: hidden;
      background: #fff;
    }

    .phone-prefix {
      width: 68px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #f4ece7;
      color: var(--dark-brown);
      font-weight: 800;
      border-right: 1px solid var(--border);
    }

    .phone-input-row input {
      border: none;
      border-radius: 0;
      flex: 1;
    }

    .phone-input-row input:focus {
      border: none;
    }

    .field-note {
      font-size: 12px;
      color: var(--muted);
      margin-top: 6px;
      line-height: 1.4;
    }

    #dateHint {
      color: var(--danger);
      margin: 4px 0 0;
      line-height: 1.3;
      white-space: normal;
    }

    #scheduleDateDisplay:disabled,
    #scheduleTime:disabled {
      background: #e5e5e5;
      color: #777;
      opacity: 1;
      cursor: not-allowed;
    }

    .schedule-calendar { margin-top: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
    .calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 6px; font-size: 12px; font-weight: 700; }
    .calendar-header button { padding: 4px 8px; }
    .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
    .calendar-weekday { font-size: 10px; color: var(--muted); padding: 4px 0; }
    .calendar-day { border: 0; border-radius: 6px; background: #f4ece7; color: var(--dark-brown); min-height: 30px; padding: 4px 0; font-size: 12px; cursor: pointer; }
    .calendar-day[aria-pressed="true"] { background: var(--dark-brown); color: white; font-weight: 700; }
    .calendar-day:focus-visible { outline: 2px solid var(--brown); outline-offset: 1px; }

    .schedule-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      align-items: start;
    }

    @media (max-width: 420px) {
      .schedule-row {
        grid-template-columns: 1fr;
      }
    }

    .modal-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(47, 33, 24, 0.5);
      z-index: 100;
      padding: 20px 12px;
      overflow-y: auto;
    }

    .modal-backdrop.show {
      display: block;
    }

    .modal {
      max-width: 560px;
      margin: 30px auto;
      background: #fffaf7;
      border-radius: 24px;
      padding: 18px;
      box-shadow: var(--shadow);
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
      margin-bottom: 14px;
    }

    .modal-title {
      margin: 0;
      color: var(--dark-brown);
      font-size: 17px;
    }

    .close-btn {
      border: none;
      background: transparent;
      font-size: 22px;
      cursor: pointer;
      color: var(--muted);
      line-height: 1;
    }

    label {
      display: block;
      font-size: 12px;
      font-weight: 700;
      color: var(--brown);
      margin: 12px 0 5px;
    }

    input,
    select,
    textarea {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #fff;
      color: var(--text);
      font-size: 14px;
      outline: none;
    }

    input:focus,
    select:focus,
    textarea:focus {
      border-color: var(--brown);
    }

    .qty-row {
      display: flex;
      gap: 10px;
      align-items: center;
      margin: 12px 0;
    }

    .qty-row button {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: #fff;
      color: var(--dark-brown);
      font-size: 18px;
      font-weight: 800;
      cursor: pointer;
    }

    .qty-value {
      min-width: 36px;
      text-align: center;
      font-weight: 800;
      font-size: 14px;
      color: var(--dark-brown);
    }

    .cart-item {
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 10px;
      background: #fff;
      margin-bottom: 8px;
    }

    .cart-item-top {
      display: flex;
      justify-content: space-between;
      gap: 10px;
    }

    .cart-item-name {
      font-size: 13px;
      font-weight: 800;
      color: var(--dark-brown);
      margin-bottom: 3px;
    }

    .cart-item-small {
      font-size: 11px;
      color: var(--muted);
      line-height: 1.4;
    }

    .cart-item-actions {
      display: flex;
      gap: 6px;
      margin-top: 8px;
    }

    .mini-btn {
      border: 1px solid var(--border);
      background: #fffaf7;
      color: var(--dark-brown);
      border-radius: 10px;
      padding: 6px 10px;
      cursor: pointer;
      font-weight: 700;
      font-size: 11px;
    }

    .hint {
      background: #fff;
      border: 1px dashed var(--brown);
      color: var(--brown);
      border-radius: 12px;
      padding: 9px 11px;
      font-size: 12px;
      line-height: 1.45;
      margin-top: 10px;
    }

    /* ─── Find Order Status Banners ─── */
    .status-banner {
      display: flex;
      align-items: flex-start;
      gap: 9px;
      padding: 10px 12px;
      border-left: 3px solid;
      border-radius: 0 10px 10px 0;
      font-size: 12px;
      line-height: 1.5;
      margin-top: 12px;
      margin-bottom: 14px;
    }

    .status-banner svg {
      flex-shrink: 0;
      margin-top: 1px;
    }

    .status-banner-loading {
      background: #e8f4fd;
      border-color: #378ADD;
      color: #185FA5;
    }

    .status-banner-success {
      background: #eaf3de;
      border-color: #639922;
      color: #3B6D11;
    }

    .status-banner-error {
      background: #fcebeb;
      border-color: #E24B4A;
      color: #A32D2D;
    }

    .total-box {
      display: flex;
      justify-content: space-between;
      padding: 12px 0;
      border-top: 1px solid var(--border);
      margin-top: 12px;
      font-size: 15px;
      font-weight: 800;
      color: var(--dark-brown);
    }

    .status-pill {
      display: inline-block;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 800;
    }

    .status-new           { background: #fde8e8; color: #b91c1c; }
    .status-paid          { background: #fef9c3; color: #92400e; }
    .status-confirmed     { background: #dcfce7; color: #166534; }
    .status-ready         { background: #dcfce7; color: #166534; }
    .status-out           { background: #dcfce7; color: #166534; }
    .status-completed     { background: #14532d; color: #f0fdf4; }
    .status-cancelled     { background: #f3f4f6; color: #6b7280; }
    .status-default       { background: #f0e4dc; color: var(--dark-brown); }

    .qr-box {
      text-align: center;
      border: 1px solid var(--border);
      background: #fff;
      border-radius: 20px;
      padding: 14px;
      margin: 12px 0;
    }

    .qr-box img {
      max-width: 260px;
      width: 100%;
      border-radius: 14px;
    }

    /* ─── Receipt Toggle  ─── */
    .receipt-section {
      margin: 6px 0 8px;
      padding: 0;
    }

    .receipt-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: flex-start;
      gap: 7px;
      margin: 0;
      padding: 0;
      cursor: pointer;
      user-select: none;
      min-height: 0;
      line-height: 1;
    }

    .receipt-toggle-left {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      min-height: 0;
    }

    .receipt-icon {
      width: 16px;
      height: 16px;
      color: var(--brown);
      flex-shrink: 0;
      display: block;
    }

    .receipt-toggle-label {
      font-size: 12px;
      font-weight: 800;
      color: var(--dark-brown);
      line-height: 1.05;
      margin: 0;
    }

    .receipt-toggle-sub {
      font-size: 10px;
      color: var(--muted);
      margin-top: 2px;
      line-height: 1.05;
    }

    .receipt-chevron {
      width: 14px;
      height: 14px;
      color: var(--muted);
      transition: transform 0.2s ease;
      flex-shrink: 0;
      margin-left: 2px;
    }

    .receipt-chevron.open {
      transform: rotate(180deg);
    }

    /* Very important: no height when closed or image not loaded */
    .receipt-image-wrap {
      display: none !important;
      height: 0 !important;
      max-height: 0 !important;
      margin: 0 !important;
      padding: 0 !important;
      overflow: hidden !important;
    }

    .receipt-image-wrap.open.has-image {
      display: block !important;
      height: auto !important;
      max-height: none !important;
      margin-top: 8px !important;
      padding: 0 !important;
      overflow: visible !important;
    }

    .receipt-image-wrap img {
      display: block;
      width: 100%;
      max-width: 100%;
      height: auto;
      border-radius: 12px;
      border: 1px solid var(--border);
    }

    .invoice {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      margin: 14px 0;
      color: var(--text);
    }

    .invoice-header {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      padding-bottom: 14px;
      margin-bottom: 14px;
      border-bottom: 1px solid var(--border);
      gap: 6px;
    }

    .invoice-logo {
      width: 64px;
      height: 64px;
      border-radius: 50%;
      background: var(--dark-brown);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      font-weight: 900;
      overflow: hidden;
      border: 1px solid var(--border);
      margin-bottom: 4px;
    }

    .invoice-logo img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .invoice-shop-name {
      font-size: 18px;
      font-weight: 900;
      color: var(--dark-brown);
      margin: 0;
      letter-spacing: 0.5px;
    }

    .invoice-slogan {
      font-size: 11px;
      color: var(--muted);
      letter-spacing: 0.5px;
      margin: 0;
      font-style: italic;
    }

    .invoice-status-row {
      margin-top: 6px;
    }

    .invoice h3 {
      margin: 0 0 8px;
      color: var(--dark-brown);
    }

    .invoice-order-badge {
      display: block;
      width: fit-content;
      margin: 0 auto 14px;
      padding: 8px 18px;
      background: var(--dark-brown);
      color: #fff;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 900;
      letter-spacing: 0.5px;
      text-align: center;
    }

    .invoice-footer {
      text-align: center;
      margin-top: 16px;
      padding-top: 14px;
      border-top: 1px dashed var(--border);
      font-size: 12px;
      color: var(--muted);
      line-height: 1.5;
    }

    /* ─── WhatsApp Button ─── */
    .btn-whatsapp {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      min-height: 44px;
      padding: 11px 14px;
      background: #25D366;
      color: #fff;
      border: none;
      border-radius: 12px;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.2;
      cursor: pointer;
      text-decoration: none;
      box-sizing: border-box;
      white-space: nowrap;
    }

    .btn-whatsapp:hover {
      background: #1ebe5d;
    }

    /* Hide the inline SVG because it is not rendering reliably */
    .btn-whatsapp svg {
      display: none !important;
    }

    /* Render WhatsApp icon using CSS instead */
    .btn-whatsapp::before {
      content: "";
      width: 18px;
      height: 18px;
      flex: 0 0 18px;
      display: inline-block;
      background-repeat: no-repeat;
      background-position: center;
      background-size: contain;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347M12.05 21.785h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884M20.463 3.488A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E");
    }

    /* ─── Order Timeline ─── */
    .timeline {
      margin-top: 16px;
      padding-top: 14px;
      border-top: 1px solid var(--border);
    }

    .timeline-title {
      font-size: 13px;
      font-weight: 800;
      color: var(--brown);
      margin-bottom: 12px;
    }

    .timeline-list {
      position: relative;
      padding-left: 22px;
    }

    .timeline-list::before {
      content: '';
      position: absolute;
      left: 6px;
      top: 6px;
      bottom: 6px;
      width: 2px;
      background: var(--border);
      border-radius: 2px;
    }

    .timeline-item {
      position: relative;
      margin-bottom: 14px;
    }

    .timeline-item:last-child {
      margin-bottom: 0;
    }

    .timeline-dot {
      position: absolute;
      left: -19px;
      top: 4px;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--brown);
      border: 2px solid #fffaf7;
      box-shadow: 0 0 0 2px var(--border);
    }

    .timeline-item:last-child .timeline-dot {
      background: var(--dark-brown);
      box-shadow: 0 0 0 2px var(--dark-brown);
    }

    .timeline-action {
      font-size: 13px;
      font-weight: 700;
      color: var(--dark-brown);
      line-height: 1.3;
    }

    .timeline-time {
      font-size: 11px;
      color: var(--muted);
      margin-top: 2px;
    }

    .invoice-row {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      margin: 7px 0;
      font-size: 14px;
    }

    .invoice-row strong {
      color: var(--dark-brown);
    }

    .invoice-items {
      margin-top: 12px;
      border-top: 1px solid var(--border);
      padding-top: 10px;
    }

  /* ─── Splash / Loading Screen ─── */
    #splashScreen {
      position: fixed;
      inset: 0;
      background: var(--dark-brown);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 22px;
      z-index: 9999;
      transition: opacity 0.55s ease, visibility 0.55s ease;
    }

    #splashScreen.hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .splash-bread {
      font-size: 56px;
      animation: splashBounce 1.1s ease-in-out infinite;
      filter: drop-shadow(0 8px 18px rgba(0,0,0,0.35));
    }

    @keyframes splashBounce {
      0%, 100% { transform: translateY(0px) rotate(-4deg); }
      50%       { transform: translateY(-14px) rotate(4deg); }
    }

    .splash-brand {
      font-size: 22px;
      font-weight: 900;
      color: #fffaf7;
      letter-spacing: 2px;
    }

    .splash-sub {
      font-size: 12px;
      color: rgba(255,250,247,0.6);
      letter-spacing: 1px;
    }

    .splash-dots {
      display: flex;
      gap: 8px;
    }

    .splash-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: rgba(255,250,247,0.4);
      animation: dotPulse 1.2s ease-in-out infinite;
    }

    .splash-dot:nth-child(2) { animation-delay: 0.2s; }
    .splash-dot:nth-child(3) { animation-delay: 0.4s; }

    @keyframes dotPulse {
      0%, 80%, 100% { background: rgba(255,250,247,0.3); transform: scale(0.85); }
      40%            { background: rgba(255,250,247,0.9); transform: scale(1.15); }
    }

    /* ─── Skeleton cards ─── */
    .skeleton-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 16px;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .skeleton-block {
      background: linear-gradient(90deg, #f0e8e2 25%, #f9f3ef 50%, #f0e8e2 75%);
      background-size: 200% 100%;
      border-radius: 10px;
      animation: shimmer 1.4s infinite;
    }

    @keyframes shimmer {
      0%   { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }

    .skeleton-img {
      width: 100%;
      aspect-ratio: 1 / 1;
      border-radius: 18px;
      margin-bottom: 12px;
    }

    .skeleton-title {
      height: 18px;
      width: 70%;
      margin-bottom: 10px;
    }

    .skeleton-price {
      height: 16px;
      width: 40%;
    }

    /* ─── Button loading spinner ─── */
    .btn-loading {
      position: relative;
      pointer-events: none;
      opacity: 0.8;
    }

    .btn-loading::after {
      content: '';
      position: absolute;
      right: 14px;
      top: 50%;
      transform: translateY(-50%);
      width: 16px;
      height: 16px;
      border: 2px solid rgba(255,255,255,0.4);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
    }

    @keyframes spin {
      to { transform: translateY(-50%) rotate(360deg); }
    }

    /* ─── Inline loader (replaces old .loading) ─── */
    .loading {
      display: none;
      text-align: center;
      padding: 20px;
      color: var(--brown);
      font-weight: 700;
    }

    .loading.show {
      display: block;
    }

    /* ─── Toast slide-up ─── */
    .toast {
      position: fixed;
      left: 16px;
      right: 16px;
      bottom: 88px;
      max-width: 720px;
      margin: 0 auto;
      background: var(--dark-brown);
      color: #fff;
      padding: 12px 14px;
      border-radius: 14px;
      display: none;
      z-index: 200;
      box-shadow: var(--shadow);
      font-size: 14px;
      transform: translateY(10px);
      opacity: 0;
      transition: transform 0.28s ease, opacity 0.28s ease;
    }

    .toast.show {
      display: block;
      transform: translateY(0);
      opacity: 1;
    }


    .service-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      background: #f4ece7;
      padding: 6px;
      border-radius: 16px;
      margin-top: 5px;
    }

    .service-tab {
      border: none;
      background: transparent;
      color: var(--brown);
      padding: 11px 12px;
      border-radius: 12px;
      font-weight: 800;
      cursor: pointer;
      font-size: 13px;
    }

    .service-tab.active {
      background: #fff;
      color: var(--dark-brown);
      box-shadow: 0 4px 12px rgba(98, 46, 16, 0.08);
    }

    .service-tab:disabled {
      display: none;
    }

    .service-unavailable-note {
      display: none;
      margin-top: 8px;
      font-size: 12px;
      line-height: 1.4;
      color: var(--muted);
    }

    .search-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      background: #f4ece7;
      padding: 6px;
      border-radius: 16px;
      margin-bottom: 16px;
    }

    .search-tab {
      border: none;
      background: transparent;
      color: var(--brown);
      padding: 10px 12px;
      border-radius: 12px;
      font-weight: 800;
      cursor: pointer;
    }

    .search-tab.active {
      background: #fff;
      color: var(--dark-brown);
      box-shadow: 0 4px 12px rgba(98, 46, 16, 0.08);
    }

    #findOrderResult .hint {
      margin-bottom: 14px;
    }

    .order-list-card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 18px;
      padding: 12px;
      margin-bottom: 10px;
      cursor: pointer;
    }

    .order-list-card:hover {
      border-color: var(--brown);
    }

    .order-list-top {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
    }

    .order-list-number {
      font-weight: 900;
      color: var(--dark-brown);
      margin-bottom: 4px;
    }

    .order-list-small {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }

    .order-detail-actions {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      margin-top: 14px;
    }

    #invoiceModal {
      z-index: 300;
    }

    #paymentModal {
      z-index: 280;
    }

    #productModal,
    #cartModal,
    #findOrderModal {
      z-index: 100;
    }

    /* Existing desktop / default CSS above */
    /* ================================================================
      MOBILE LAYOUT - 375PX OPTIMIZED
    ================================================================ */

    @media (max-width: 480px) {
      html {
        font-size: 15px;
      }

      body {
        overflow-x: hidden;
      }

      .app {
        width: 100%;
        max-width: none;
        margin: 0 auto;
        padding: 0 25px 82px;
      }

      .shop-header {
        padding: 24px 4px 18px;
        text-align: center;
      }

      .logo {
        width: 138px;
        height: 138px;
        margin: 0 auto 14px;
      }

      .shop-name {
        font-size: 25px;
        line-height: 1.12;
        font-weight: 900;
        margin: 0 0 16px;
      }

      .shop-desc {
        max-width: 350px;
        margin: 0 auto;
        font-size: 13.5px;
        line-height: 1.55;
        text-align: center;
      }

      .banner {
        margin: 10px 0 14px;
        padding: 10px 11px;
        border-radius: 13px;
        font-size: 12px;
      }

      .top-actions {
        width: 100%;
        max-width: none;
        margin: 18px 0 20px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
      }

      .top-actions .btn {
        height: 40px;
        min-height: 40px;
        padding: 7px 6px;
        border-radius: 12px;
        font-size: 12.5px;
        line-height: 1.15;
      }

      #productArea {
        margin-left: -8px;
        margin-right: -8px;
        padding: 0 6px 16px;
      }

      .category-title {
        margin: 0 0 8px;
        padding: 7px 2px 2px;
        font-size: 13px;
        line-height: 1;
        font-weight: 900;
        letter-spacing: 0.2px;
      }

      .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding-bottom: 16px;
      }

      .product-card {
        border-radius: 12px;
        padding: 7px;
        box-shadow: none;
        overflow: hidden;
        min-height: 0;
      }

      .product-card:hover {
        transform: none;
      }

      .product-image-wrap {
        width: 100%;
        aspect-ratio: 1 / 1;
        height: auto;
        margin: 0 0 6px;
        border-radius: 10px;
      }

      .product-name {
        font-size: 11.5px;
        line-height: 1.2;
        font-weight: 900;
        margin: 0 0 5px;
        min-height: 28px;

        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }

      .product-meta {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 4px;
      }

      .product-weight {
        font-size: 10px;
        line-height: 1.1;
        max-width: 58%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .product-price {
        font-size: 10.5px;
        font-weight: 900;
        white-space: nowrap;
      }

      .cart-bar {
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
      }

      .cart-bar-inner {
        width: 100%;
        max-width: none;
        margin: 0 auto;
        gap: 8px;
      }

      .cart-summary {
        font-size: 12.5px;
      }

      .cart-summary span {
        font-size: 10.5px;
        padding-left: 5px;
      }

      .cart-summary strong {
        display: block;
        font-size: 16px;
        line-height: 1.15;
        font-weight: 900;
        margin-top: 2px;
        padding-left: 5px;
        color: var(--dark-brown);
      }

      .cart-bar .btn {
        min-width: 100px;
        min-height: 35px;
        padding: 8px 12px;
        border-radius: 999px;
        font-size: 13px;
      }

      .modal-backdrop {
        padding: 8px;
      }

      .modal {
        width: 100%;
        max-width: none;
        margin: 8px auto;
        padding: 16px;
        border-radius: 20px;
      }

      .modal-title {
        font-size: 18px;
        line-height: 1.25;
      }

      input,
      select,
      textarea {
        min-height: 42px;
        padding: 10px 11px;
        border-radius: 11px;
        font-size: 14px;
      }

      .schedule-row {
        grid-template-columns: 1fr;
        gap: 0;
      }

      .skeleton-card {
        border-radius: 12px;
        padding: 7px;
        box-shadow: none;
      }

      .skeleton-img {
        width: 100%;
        aspect-ratio: 1 / 1;
        border-radius: 10px;
        margin-bottom: 7px;
      }

      .skeleton-title {
        height: 13px;
        width: 80%;
        margin-bottom: 7px;
      }

      .skeleton-price {
        height: 11px;
        width: 42%;
      }
    }
    .capacity-warning { color: var(--danger); font-size: 11px; line-height: 1.4; margin: 4px 0; }
  
    :root {
      --font-brand: 'Cormorant Garamond', Georgia, serif;
      --font-heading: 'Lora', Georgia, serif;
      --font-body: 'DM Sans', Arial, sans-serif;
    }
    body { font-family: var(--font-body); }
    button, input, select, textarea, label { font-family: var(--font-body); }
    .shop-name:not(:where(#invoiceBox, #invoiceBox *)),
    .category-title:not(:where(#invoiceBox, #invoiceBox *)),
    .product-name:not(:where(#invoiceBox, #invoiceBox *)),
    .product-price:not(:where(#invoiceBox, #invoiceBox *)),
    .product-desc b:not(:where(#invoiceBox, #invoiceBox *)),
    .product-desc strong:not(:where(#invoiceBox, #invoiceBox *)),
    .modal-product-price:not(:where(#invoiceBox, #invoiceBox *)),
    .cart-summary strong:not(:where(#invoiceBox, #invoiceBox *)),
    .phone-prefix:not(:where(#invoiceBox, #invoiceBox *)),
    .qty-row button:not(:where(#invoiceBox, #invoiceBox *)),
    .qty-value:not(:where(#invoiceBox, #invoiceBox *)),
    .cart-item-name:not(:where(#invoiceBox, #invoiceBox *)),
    .total-box:not(:where(#invoiceBox, #invoiceBox *)),
    .status-pill:not(:where(#invoiceBox, #invoiceBox *)),
    .receipt-toggle-label:not(:where(#invoiceBox, #invoiceBox *)),
    .timeline-title:not(:where(#invoiceBox, #invoiceBox *)),
    .splash-brand:not(:where(#invoiceBox, #invoiceBox *)),
    .service-tab:not(:where(#invoiceBox, #invoiceBox *)),
    .search-tab:not(:where(#invoiceBox, #invoiceBox *)),
    .order-list-number:not(:where(#invoiceBox, #invoiceBox *)) { font-weight: 600; }
    h1:not(:where(#invoiceBox *)), h2:not(:where(#invoiceBox *)), h3:not(:where(#invoiceBox *)),
    .product-name, .modal-title, .section-title, .category-title,
    .cart-item-name:not(:where(#invoiceBox *)) {
      font-family: var(--font-heading);
      font-weight: 600;
    }
    .shop-name, .splash-brand, .logo {
      font-family: var(--font-brand);
      font-weight: 600;
    }
    .btn, .btn-secondary, .btn-whatsapp, .service-tab, .search-tab { font-weight: 600; }
    #invoiceBox, #invoiceBox button, #invoiceBox input, #invoiceBox select, #invoiceBox textarea, #invoiceBox label {
      font-family: Arial, Helvetica, sans-serif;
    }

  
    #productModal .modal { padding: 16px; border-radius: 20px; }
    #productModal .modal-header { gap: 12px; align-items: flex-start; margin-bottom: 14px; }
    #productModal .modal-title { font-family: 'Montserrat', Arial, sans-serif; font-size: clamp(18px, 4.8vw, 18px); line-height: 1.18; overflow-wrap: anywhere; }
    #productModal .close-btn { flex: 0 0 auto; color: var(--dark-brown); }
    #productModal .detail-media { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: 8px; align-items: stretch; }
    #productModal .modal-product-image { width: 100%; height: auto; min-width: 0; margin: 0; border: 0; border-radius: 12px; overflow: hidden; }
    #productModal .modal-product-image img { width: 100%; height: 100%; min-height: 236px; object-fit: cover; display: block; }
    #productModal .detail-nutrition { background: #f3efea; border-radius: 12px; padding: 10px 7px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; color: var(--dark-brown); }
    #productModal .detail-nutrient { display: flex; align-items: center; gap: 5px; min-width: 0; }
    #productModal .detail-nutrient svg { width: 20px; height: 24px; flex: 0 0 20px; }
    #productModal .detail-nutrient strong { display: block; font-size: 13px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
    #productModal .detail-nutrient span { display: block; font-size: 10px; color: var(--muted); line-height: 1.4; }
    #productModal .detail-nutrition-basis { border-top: 1px solid var(--border); padding-top: 7px; text-align: center; font-size: 11px; color: var(--muted); }
    #productModal .detail-no-image { grid-template-columns: 1fr; }
    #productModal .detail-no-image .detail-nutrition { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #productModal .detail-no-image .detail-nutrition-basis { grid-column: 1 / -1; }
    #productModal .detail-price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 12px 0; }
    #productModal .modal-product-price { margin: 0; font-family: var(--font-body); font-size: 16px; font-weight: 700; }
    #productModalWeight { color: var(--muted); font-size: 13px; text-align: right; overflow-wrap: anywhere; }
    #productModal .product-desc { background: #f3efea; border: 0; border-radius: 12px; padding: 12px; margin: 0 0 12px; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
    #productModal .product-desc:empty { display: none; }
    #productModal .detail-ingredients { display: flex; align-items: flex-start; gap: 12px; margin: 12px 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
    #productModal .detail-ingredients[hidden] { display: none; }
    #productModal .detail-ingredients svg { width: 28px; height: 28px; flex: 0 0 28px; color: var(--dark-brown); }
    #productModal .detail-ingredients strong { font-weight: 600; color: var(--dark-brown); }
    #productModalIngredientsText { white-space: pre-line; }
    #productModal #variationWrap { border-top: 1px solid var(--border); padding-top: 10px; }
    #productModal label { font-size: 13px; font-weight: 600; }
    #productModal #productVariation { width: 100%; border-radius: 8px; }
    #productModal .qty-row { gap: 0; width: fit-content; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
    #productModal .qty-row button { width: 38px; height: 36px; border: 0; border-radius: 0; background: transparent; font-size: 20px; }
    #productModal .qty-value { min-width: 48px; font-size: 15px; font-weight: 600; text-align: center; }
    #productModal .btn { background: var(--dark-brown); color: var(--card); border-radius: 9px; box-shadow: none; font-size: 16px; font-weight: 600; }
    @media (min-width: 600px) {
      #productModal .detail-media { gap: 12px; }
      #productModal .detail-nutrition { padding: 16px; }
      #productModal .detail-nutrient { gap: 12px; }
      #productModal .detail-nutrient svg { width: 28px; height: 32px; flex-basis: 28px; }
      #productModal .detail-nutrient strong { font-size: 18px; }
      #productModal .detail-nutrient span { font-size: 13px; }
      #productModal .modal-product-image img { min-height: 320px; }
    }

  
    #productModal #productVariation[hidden] { display: none; }
    #productModal .variation-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 5px 0 12px; }
    #productModal .variation-option { padding: 11px 12px; min-height: 42px; border: 1px solid var(--brown); border-radius: 12px; background: transparent; color: var(--dark-brown); font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
    #productModal .variation-option[aria-pressed="true"] { background: var(--dark-brown); color: var(--card); }
    #productModal .variation-option:focus-visible, #cartModal .cart-add-more:focus-visible { outline: 2px solid var(--brown); outline-offset: 3px; }
    #cartModal .cart-add-more { display: block; width: 100%; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--brown); border-radius: 10px; background: transparent; color: var(--dark-brown); font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; }
  
    .store-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; padding: 4px 0 10px; border-bottom: 1px solid var(--border); }
    .nav-wordmark { font-family: var(--font-brand); font-weight: 600; letter-spacing: .18em; text-align: center; color: var(--dark-brown); font-size: 20px; }
    .nav-icon { position: relative; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; background: transparent; border: 0; color: var(--dark-brown); font-size: 26px; cursor: pointer; }
    .nav-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
    .nav-cart-count { position: absolute; right: 0; top: 0; min-width: 17px; padding: 2px 4px; border-radius: 10px; background: var(--dark-brown); color: var(--card); font-size: 10px; line-height: 1.2; }
    .nav-cart-count[hidden], #orderView[hidden], #aboutView[hidden] { display: none; }
    .store-drawer { position: fixed; inset: 0 auto 0 0; margin: 0; width: 82vw; max-width: 320px; height: 100dvh; max-height: 100%; padding: 18px; border: 0; background: var(--card); color: var(--dark-brown); box-sizing: border-box; }
    .store-drawer[open] { animation: storeDrawerIn .2s ease-out; }
    .store-drawer::backdrop { background: rgba(47, 33, 24, .35); }
    .drawer-heading { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 14px; }
    .store-drawer nav button { display: block; width: 100%; text-align: left; padding: 16px 4px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--dark-brown); font-family: var(--font-body); font-size: 15px; cursor: pointer; }
    .store-drawer nav button[aria-current="page"] { font-weight: 700; }
    .about-view { padding: 28px 8px; }
    .about-view .nav-wordmark { margin: 0 0 12px; font-size: 26px; }
    .about-tagline { text-align: center; color: var(--muted); font-size: 13px; }
    .about-view .shop-desc { margin: 24px auto; text-align: left; line-height: 1.65; }
    .about-highlights { display: grid; gap: 0; margin: 24px 0; }
    .about-highlights > div { padding: 16px 0; border-top: 1px solid var(--border); }
    .about-highlights strong, .about-highlights span { display: block; }
    .about-highlights strong { font-size: 15px; font-weight: 600; }
    .about-highlights span { font-size: 13px; color: var(--muted); margin-top: 5px; }
    .about-view > .btn { width: 100%; }
    @keyframes storeDrawerIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }
    @media (prefers-reduced-motion: reduce) { .store-drawer[open] { animation: none; } }

  
    .store-nav { position: sticky; top: 0; z-index: 40; background: var(--bg); }
    .category-carousel { display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 10px 2px 12px; margin: 0 0 8px; scrollbar-width: thin; }
    .category-carousel[hidden] { display: none; }
    .category-shortcut { flex: 0 0 78px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--dark-brown); cursor: pointer; scroll-snap-align: start; }
    .category-shortcut-icon { position: relative; display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border: 1px solid transparent; border-radius: 50%; background: var(--card); padding: 4px; font-family: var(--font-brand); font-size: 18px; overflow: hidden; }
    .category-shortcut-icon img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 50%; object-fit: cover; }
    .category-shortcut[aria-pressed="true"] .category-shortcut-icon { border-color: var(--brown); }
    .category-shortcut-label { font-family: var(--font-body); font-size: 12px; line-height: 1.3; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
    .category-shortcut:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; border-radius: 4px; }
  
    .store-nav { width: 100%; padding: 6px max(14px, calc((100% - 692px) / 2)); }
    #backToTop { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(90px + env(safe-area-inset-bottom)); width: 44px; height: 44px; padding: 10px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--dark-brown); color: var(--card); box-shadow: 0 2px 8px rgba(47,33,24,.18); z-index: 45; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s; cursor: pointer; }
    #backToTop.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
    #backToTop svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    #backToTop:focus-visible { outline: 2px solid var(--brown); outline-offset: 3px; }
    @media (prefers-reduced-motion: reduce) { #backToTop { transition: none; } }
  
    :is(#invoicePickup, #invoicePickupFind) { margin-top: 12px; }
    :is(#invoicePickup, #invoicePickupFind)[hidden], :is(#invoicePickup, #invoicePickupFind) [hidden] { display: none; }
    :is(#checkPickupAddress, #checkPickupAddressFind) { width: 100%; }
    :is(#invoicePickupPanel, #invoicePickupPanelFind) { margin-top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
    :is(#invoicePickupAddressLink, #invoicePickupAddressLinkFind), :is(#invoicePickupAddressText, #invoicePickupAddressTextFind) { display: block; margin: 10px 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; color: var(--dark-brown); user-select: text; }
    :is(#invoicePickupAddressLink, #invoicePickupAddressLinkFind) { text-decoration: underline; text-underline-offset: 3px; }
    .pickup-address-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .pickup-address-actions .btn { flex: 1 1 110px; text-align: center; font-size: 12px; text-decoration: none; }
    :is(#pickupCopyStatus, #pickupCopyStatusFind) { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
  