
@font-face {
  font-family: 'GT America';
  src: url('/fonts/GTAmerica-Regular.woff2') format('woff2'),
       url('/fonts/GTAmerica-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'GT America';
  src: url('/fonts/GTAmerica-Medium.woff2') format('woff2'),
       url('/fonts/GTAmerica-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'GT America';
  src: url('/fonts/GTAmerica-Bold.woff2') format('woff2'),
       url('/fonts/GTAmerica-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}

:root {
  --primary: #0F4B38; /* Spinneys green */
  --primary-700: #0c3a2b;
  --primary-600: #0d4232;
  --accent: #e7f2ee;
  --bg: #f7faf9;
  --text: #1f2d2a;
  --muted: #6c7a77;
  --border: #F4F4F4;
  --btn-border: #ACACAC;
  --danger: #e2544a;
  --success: #1f8a4c;
  --card: #ffffff;
  --faded: #717171;
  --blue-border: #3b82f6;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text); 
  font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Custom checkbox for near-expiry section */
.custom-checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 8px;
}

.custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.custom-checkbox .checkmark {
  position: relative;
  width: 16px;
  height: 16px;
  background-color: #fff;
  border: 2px solid #0F4B38; /* green border */
  border-radius: 4px;
  display: inline-block;
  box-sizing: border-box;
}

.custom-checkbox:hover .checkmark {
  background-color: #f0f0f0;
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: #0F4B38; /* green when checked */
  border-color: #0F4B38;
}

.custom-checkbox .checkmark::after {
  content: "";
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark::after {
  display: block;
}

.custom-checkbox .checkbox-text {
  color: #124634;
  font-weight: 500;
  font-size: 12px;
  font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Loader overlay */
.over-lay-div {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.over-lay-div[style*="display: block"],
.over-lay-div[style*="display:block"] {
  display: flex !important;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-inner {
  width: 100%;
  height: 100%;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.qty-btn { color: #000000 !important;}
.qty button { color: #000000 !important;}
/* Top bar */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar .wrap {
  max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px;
}

.header-left {
  display: flex; align-items: center; gap: 20px;
}

.header-right {
  display: flex; align-items: center; gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--primary); font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.brand .logo {
  width: 114px; height: 26px; border-radius: 50%; background: var(--primary);
  display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800;
}

.reference-text {
  color: var(--muted); font-size: 14px; font-weight: 500; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.timer-section {
  display: flex; align-items: center; gap: 8px;
}
.timer-box {
  background: var(--primary); color: #fff; padding: 6px 12px; border-radius: 20px; font-weight: 700; font-size: 14px;
}
.timer-label {
  color: var(--muted); font-size: 14px; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.language {
  color: var(--muted); font-size: 14px; font-weight: 500; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
input::placeholder {
  color: #ACACAC;  
  opacity: 1;   
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 24px;
  width: 24px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  background-image:  url('cross.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}

/* NEW: Mobile second row under the header */
.mobile-meta { display: none; border-top: 1px solid var(--border); }
.mobile-meta .meta-wrap {
  max-width: 1120px; margin: 0 auto; padding: 8px 1px;
  display: flex; align-items: center; gap: 1px; color: #2c2c2c;
}
.mobile-ref { font-size: 14px; font-weight: 700 !important; }
.mobile-sep { width: 1px; height: 16px; background: #ACACAC; margin: 3px !important}
.mobile-label { font-size: 14px; color: #4a4f4e; margin: 0 4px 0 0 !important; font-weight: 400;}
.mobile-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff; padding: 6px 12px;
  border-radius: 999px; font-weight: 700; font-size: 13px; line-height: 1;
}
.mobile-pill .clock { width: 12px; height: 12px; display: block; }

/* Page container */
.container { max-width: 1120px; margin: 28px auto 80px; padding: 0 20px; }

/* Page title */
.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0 0 8px; font-size: 28px; color: var(--text); font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.page-head span { margin: 0 0 8px; font-size: 28px; color: var(--text); font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.section-title span { margin: 0; font-size: 28px; color: #000000; font-weight: 500; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.page-head p { margin: 0; color: var(--faded); font-size: 14px; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

/* Card */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; padding: 14px 16px; }
.card-header { background: var(--primary); color: #fff; padding: 10px 16px; font-weight: 700; font-size: 14px; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.card-body { padding: 14px 16px; }

/* Substitution grid */
.substitution-grid { display: grid; grid-template-columns: 1fr 1fr;   }
.substitution-col { overflow: hidden; }
.substitution-col .col-head { border-right: 1px solid; background: var(--primary); padding: 12px 16px; font-weight: 500; color: #fff; font-size: 16px;     
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;}
.substitution-col .col-heads { background: var(--primary); padding: 12px 16px; font-weight: 500; color: #fff; font-size: 16px;     border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;}
.item { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 16px; padding: 16px; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.thumb { width: 80px; aspect-ratio: 1 / 1; border-radius: 8px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; font-size: 28px; }
.item-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.price { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 8px; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.availability { color: var(--success); font-size: 12px; font-weight: 500; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

/* Quantity controls */
.qty-container { display: flex; align-items: center; gap: 12px; margin-top: 5px; }
.qty { display: flex; align-items: center; gap: 8px; padding: 4px; }
.qty button { background: #fff; border: 1px solid var(--btn-border); width: 45px; height: 25px;  cursor: pointer; }
.qty-label { color: var(--muted); font-size: 12px; }

/* Add new item section */
.section-title { display: flex; flex-direction: column; justify-content: space-between; margin: 30px 0 12px; }
.section-title h2 { margin: 0; font-size: 32px; color: #000000; font-weight: 500; margin: 0 0 8px; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;}
.section-title small { color: var(--muted); font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

.searchbar { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--btn-border); border-radius: 999px; padding: 10px 14px; }
.searchbar input { border: 0; outline: none; flex: 1; font-size: 14px; background: transparent; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.searchbar .icon { width: 22px; height: 22px; display: grid; place-items: center; color: var(--muted); position: relative; }

/* Non-blocking search loader inside the search icon */
.searchbar.search-loading .icon::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ccc;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

/* Add list */
.add-card { margin-top: 14px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--card); }
.add-row { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; padding: 16px; }
.add-row + .add-row { border-top: 1px solid var(--border); }
.muted { color: var(--muted); font-size: 12px; }
.actions-row-mobile { display: none !important; }
/* Hide mobile price info on desktop */
.mobile-price-info { display: none; }

/* Totals */
.totals { display: flex; margin-top: 18px; align-items: center; gap: 1px }
.total-box { background: var(--card); border: 1px solid var(--border); padding: 14px 16px; flex: 1; display: flex; flex-direction: column; align-items: center; }
.total-box { border-top-left-radius: 8px;
  border-bottom-left-radius: 8px; background: var(--card); border: 1px solid var(--border); padding: 10px 16px; flex: 1; display: flex; flex-direction: column; align-items: center; }
.total-boxs { background: var(--card); border: 1px solid var(--border); padding: 14px 16px; flex: 1; display: flex; flex-direction: column; align-items: center; }
.total-boxs { border-top-right-radius: 8px;
  border-bottom-right-radius: 8px; background: var(--card); border: 1px solid var(--border); padding: 10px 16px; flex: 1; display: flex; flex-direction: column; align-items: center; }
.total-box .label { color: #000000; font-size: 16px; font-weight: 400; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.total-box .value { font-weight: 800; margin-top: 6px; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.total-boxs .label { color: #000000; font-size: 16px; font-weight: 400; }
.total-boxs .value { font-weight: 800; margin-top: 6px; }
.action { margin-top: 16px; }
.btn {
  background: var(--primary); color: #fff; border: none; width: 100%; padding: 14px 18px; border-radius: 10px; font-size: 16px; font-weight: 500; cursor: pointer; letter-spacing: .2px; font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.btn:hover { background: var(--primary-600); }

/* Helpers */
.chip { background: var(--accent); color: var(--primary); border: 1px solid var(--border); padding: 4px 8px; font-size: 11px; border-radius: 999px; display: inline-block; }
.trash { color: var(--danger); cursor: pointer; }
.price-label { color: var(--primary); font-size: 12px; }
.empty-box { display: none !important;}
/* Responsive */
@media (max-width: 900px) {
  .card-body { padding: 0px !important; }
  .add-card {padding: 10px 10px 0px 0px !important;}
  .container { margin: 16px auto 72px; padding: 0 14px; }
  .page-head h1 { font-size: 22px; }
  .substitution-grid { grid-template-columns: 1fr; }
  .item { grid-template-columns: 80px 1fr; padding: 12px; }
  .thumb { width: 80px; }
  .add-row { grid-template-columns: 60px 1fr auto; padding: 12px; }
}

@media (max-width: 600px) {
  .qty-container { margin-top: 0px !important; }
  .item-details {gap: 10px !important;}
  .actions-row { display: none !important; }
  .card-body { padding: 0px !important; }
  .actions-row-mobile { display: flex !important; align-items: center; gap: 8px; width: 100%; padding: 0 20px 0 0px;}
  /* Header tweaks for mobile view */
  .vline { display: none; }                 /* hide center divider */
  .timer-section { display: none !important; }         /* hide desktop timer row-1 */
  .reference-text { display: none; }        /* hide desktop reference row-1 */
  .mobile-meta { display: flex; }          /* show second row */
  .topbar .wrap { padding: 10px 14px; }     /* tighter padding on row-1 */
  .language { margin-left: 0; }             /* keep Arabic next to timer area */
  .col-head { border-radius: 5px !important;}
  .col-heads { border-radius: 5px !important;}
  .item { grid-template-columns: 80px 1fr; }
  .thumb { width: 80px; }
  .total-boxs .value {
    font-weight: 700 !important;
    font-size: 12px !important;
  }
  .total-box .value {
    font-weight: 700 !important;
    font-size: 12px !important;
  }
  /* Mobile responsive add-row layout */
  .add-row { 
    display: flex !important; 
    flex-direction: column;
    align-items: flex-start !important; 
    gap: 5px; 
    padding: 12px 12px 12px 20px;
    border-bottom: 1px solid var(--border);
  }
  .item-details {
    flex-direction: column;
    padding-right: 12px;
  }
  .qty-container {
    flex-direction: row !important;
    justify-content: space-between;
    width: 100%;
  }
  .add-row .left {
    display: flex;
    flex-direction: row-reverse;
    gap: 12px;
    flex: 1;
    order: 1;
  }
  
  .add-row .thumb {
    width: 80px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    order: 1;
  }
  
  .add-row .info {
    display: flex;
  order: 2;
  }
  
  .add-row .item-title {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    margin-bottom: 4px;
    line-height: 1.3;
  }
  
  /* Hide center section on mobile and add price info to left section */
  .add-row .center {
    display: none; /* Hide center section on mobile */
  }
  
  .mobile-price-info {
    display: flex;
    justify-content: flex-end !important;
  flex-direction: column-reverse;
  gap: 5px;
  }
  
  .mobile-price {
    font-size: 12px;
    font-weight: 400;
    color: #000;
    margin-bottom: 2px;
  }
  
  .mobile-price-label {
    font-size: 12px;
    color: #65a389;
    font-weight: 400;
  }
  
  .add-row .right {
    display: flex;
    align-items: flex-start !important;
    gap: 8px;
    width: 100%;
    order: 2;
    padding-left: 70px;
  }
  
  
  .add-row .actions-row {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 8px;
  }
  
  .add-row .qty-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  
  .add-row .qty {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  
  .add-row .qty-btn {
    width: 45px;
    height: 25px;
    border: 1px solid #ACACAC;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
  }
  
  .add-row .qty-btn:hover {
    background: #f5f5f5;
  }
  
  .add-row .qty-label {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    white-space: nowrap;
  }
  
  .add-row .trash img {
    width: 16px;
    height: 16px;
    cursor: pointer;
  }
  
  .action { bottom: 0; padding: 12px 0; background: linear-gradient(to top, rgba(247,250,249,0.95), rgba(247,250,249,0)); }
  .btn { padding: 14px; border-radius: 12px; font-size: 15px; }
}

/* (Your existing component styles below – unchanged) */
.substitution-col { font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.col-head { background: #144d34; color: #fff; padding: 6px 12px; font-weight: bold; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px; }
.thumb { width: 80px; aspect-ratio: 1 / 1; border-radius: 6px; background-size: cover; background-position: center; }
.item-details { display: flex; align-items: center; gap: 16px; }
.left-col { display: flex; flex-direction: column; }
.item-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.price-section { display: flex; flex-direction: column; font-size: 13px; }
.price-label { color: #66A18D; font-size: 12px; }
.price { font-size: 13px; }
.divider { width: 1px; height: 40px; background-color: #ACACAC; }
.right-col { display: flex; flex-direction: column; font-size: 13px; }
.availability-label { color: #65a389; font-size: 12px; }
.availability { font-size: 13px; }

.substitution-col { font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;}
.col-head { background: #144d34; color: #fff; padding: 6px 12px; font-weight: bold; }
.item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px; border-bottom: 1px solid #F4F4F4; }
.thumb { width: 80px; aspect-ratio: 1 / 1; border-radius: 6px; background-size: cover; background-position: center; }
.item-details { flex: 1; display: flex; justify-content: space-between; align-items: flex-start; }
.left { display: flex; flex-direction: column; gap: 3px; }
.item-title { font-size: 14px; font-weight: 500; color: #000; }
.meta { display: flex; align-items: center; gap: 23px; }
.price-col, .avail-col { display: flex; gap: 2px; flex-direction: column; font-size: 13px; }
.label { color: #65a389; font-size: 12px; font-weight: 400; }
.value { font-size: 12px; color: #000; font-weight: 400; }
.divider { width: 1px; height: 30px; background: #ACACAC; }
.qty-container { display: flex; flex-direction: column; gap: 6px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty-btn { display: flex; align-items: center; justify-content: center; width: 45px; height: 25px; border: 1px solid #ACACAC; background: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.qty-btn:hover { background: #f0f0f0; }
.qty-num { min-width: 20px; text-align: center; font-size: 14px; font-weight: bold; }
.qty-label { font-size: 12px; color: #124634; font-weight: 500; }

.add-card { padding: 12px 20px; border-bottom: 1px solid #eee;}
.add-row { display: grid; grid-template-columns: 16fr 225px 302px; align-items: center; }
.left { display: flex; }
.thumb { width: 80px; margin-top: 5px; border-radius: 6px; background-size: cover; background-position: center; }
.item-title { font-size: 14px; font-weight: 400; color: #111; }
.center { border-left: 1px solid #ACACAC; padding-left: 8px; display: flex; align-items: center; min-height: 48px; margin-top: 3px; }
.price-block { text-align: left; }
.price-label { font-size: 12px; color: #66A18D; font-weight: 400; }
.price { font-size: 12px; font-weight: 400; color: #111; }
.right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.actions-row { display: flex; align-items: center; gap: 10px; }
.trash img { width: 18px; height: 18px; cursor: pointer; }
.qty-controls { display: flex; align-items: center; border: 1px solid #ACACAC; border-radius: 6px; overflow: hidden; }
.qty-controls button { background: #fff; border: none; padding: 4px 10px; font-size: 14px; font-weight: bold; cursor: pointer; }
.qty-number { padding: 0 8px; font-size: 14px; font-weight: 600; }
.quantity-text { font-size: 12px; font-weight: 600; color: #0b6b4d; }

/* Proceed checkbox for near expiry items */
.proceed-checkbox {
  display: flex;
  align-items: center;
  margin-right: 30px;
}

.proceed-checkbox .checkbox-icon {
  width: 18px;
  height: 18px;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.proceed-checkbox label {
  color: #124634;
  font-weight: 500;
  margin-left: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: 'GT America', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Checkbox in substitution section - standalone without label */
.substitution-col .proceed-checkbox {
  margin-right: 8px;
}

.topbar { border-bottom: 1px solid #eee; background: #fff;}
.wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-left { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 20px; }
.brand img.logo { height: 32px; display: block; }
.reference-text { font-size: 14px; font-weight: 700; color: #333; margin-left: auto; }
.vline { width: 1px; height: 32px; background-color: #ACACAC; }
.header-right { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 20px; }
.timer-section { display: flex; align-items: center; gap: 8px; }
.timer-label { font-size: 14px; font-weight: 400; color: #000000; }
.timer-box { border: 1px solid #ACACAC; padding: 4px 8px; border-radius: 100px; }
.timer-text { font-weight: bold; font-size: 13px; }
.language { font-size: 18px; font-weight: 500; color: #000000; text-decoration: none; margin-left: auto; }

.languageToggle {
cursor: pointer
}
