/* Blackcart mobile storefront
   Layout contract: app shell fills the viewport; page-level scrolling is disabled.
   Keep component styles grouped by application region for future development. */

:root {
  color-scheme: dark;
  --black: #08090b;
  --panel: #111318;
  --panel-raised: #191c22;
  --white: #f7f8fa;
  --muted: #9298a4;
  --line: rgba(255,255,255,.09);
  --accent: #3cff00;
  --accent-dark: #a8df2e;
  --topbar-height: 62px;
  --bottom-height: 70px;
  --radius: 15px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--black);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.app-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 37%, rgba(52,58,70,.13), transparent 58%),
    var(--black);
  border-inline: 1px solid rgba(255,255,255,.035);
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,9,11,.94);
  z-index: 2;
}
.brand { display: flex; align-items: center; gap: 7px; color: var(--white); text-decoration: none; }
.brand-mark { width: 24px; height: 24px; display: flex; align-items: end; gap: 3px; transform: skew(-18deg); }
.brand-mark span { display: block; width: 5px; border-radius: 3px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 12px; }
.brand-mark span:nth-child(2) { height: 19px; }
.brand-mark span:nth-child(3) { height: 15px; }
.brand-name { font-size: 15px; font-weight: 850; letter-spacing: -.8px; }
.brand-name span { color: var(--muted); font-weight: 550; }
.search {
  height: 37px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #292c33;
  border-radius: 10px;
  background: linear-gradient(180deg, #1a1c21, #111216);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 3px 8px #0005;
}
.search svg, .icon-button svg, .nav-action svg, .checkout-button svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.search svg { flex: 0 0 auto; color: #9298a4; width: 17px; height: 17px; }
.search input { min-width: 0; width: 100%; color: var(--white); border: 0; outline: 0; background: transparent; font-size: 11px; }
.search input::placeholder { color: #777d88; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.icon-button {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid #2b2e35; border-radius: 11px; background: #17191e;
}
.icon-button svg { width: 19px; height: 19px; }

/* Main fixed viewport: product shelf, cart stage, and control pad */

.main-content {
  flex: 1;
  min-height: 0;
  display: grid;

  /* Give more space to products and less to the cart */
  grid-template-rows:
  minmax(0, 1.65fr)
  minmax(150px, 1fr);

  gap: 9px;
  padding: 10px 12px 9px;
  overflow: hidden;
}

.products-section, .cart-section, .controls-section {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(26,29,35,.96), rgba(15,16,20,.98));
  box-shadow: 0 7px 18px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.025);
}
.products-section { display: flex; flex-direction: column; padding: 10px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 0 0 auto; margin-bottom: 8px; }
.eyebrow { margin: 0 0 2px; color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: 1.5px; }
h1, h2 { margin: 0; font-size: 14px; line-height: 1.1; font-weight: 750; letter-spacing: -.35px; }
.count-pill, .cart-status {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  border: 1px solid #333740; border-radius: 999px; padding: 5px 7px;
  color: #b6bbc4; font-size: 8px; font-weight: 750; letter-spacing: .6px;
}
.count-pill { color: var(--white); }

/* Product grid */
/*
.product-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
*/



/* =========================================
   DELIVA — HORIZONTAL CATEGORY VIEWPORT
========================================= */

.product-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;

    width: 100%;
    min-width: 0;
    flex: 1;
    min-height: 0;

    overflow-x: auto;
    overflow-y: hidden;

    gap: 0;
    padding: 0;

    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;
}

.product-grid::-webkit-scrollbar {
    display: none;
}


/* =========================================
   CATEGORY PANELS
   One panel per category
========================================= */

.category-panel {
    flex: 0 0 100%;

    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: 100%;

    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    padding: 0 2px 8px;

    overflow-x: hidden;
    overflow-y: auto;

    scroll-snap-align: start;
    scroll-snap-stop: always;

    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;
}

.category-panel::-webkit-scrollbar {
    display: none;
}


/* =========================================
   CATEGORY DIRECTORY
========================================= */

.category-directory-panel {
    overflow-y: auto;
}

.category-directory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(65px, auto);

    gap: 8px;
    padding: 2px 2px 10px;
}

.category-directory-card {
    min-width: 0;
    min-height: 65px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;

    padding: 10px;

    border: 1px solid #30333a;
    border-radius: 9px;

    background: linear-gradient(
        145deg,
        #252a30,
        #17191e
    );

    color: var(--white);
    text-align: left;

    cursor: pointer;

    transition:
        border-color 0.16s,
        background 0.16s,
        transform 0.16s;
}

.category-directory-card:active {
    transform: scale(0.97);
    border-color: var(--accent);
    background: #293221;
}

.category-directory-name {
    width: 100%;
    overflow: hidden;

    color: #f2f3f5;
    font-size: 12px;
    font-weight: 750;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-directory-count {
    color: var(--accent);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: 0.7px;
    display: none;
}


/* =========================================
   CATEGORY PRODUCT GRID
   Three columns, unlimited vertical rows
========================================= */

.category-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 116px;
    gap: 8px 6px;

    width: 100%;
    height: max-content;
    min-height: min-content;

    align-content: start;
    justify-content: stretch;

    padding: 8px;
    box-sizing: border-box;
}

.category-product-grid .product-card {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
}


/* Product images */

.category-product-grid .product-image {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

.category-product-grid .product-image > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}


/* Product information */

.category-product-grid .product-info {
    min-width: 0;
    padding-top: 5px;
}

.category-product-grid .product-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.category-product-grid .product-price {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 600;
}


/* Quantity controls */

.category-product-grid .overlay-controls {
    gap: 4px;
}

.category-product-grid .overlay-btn {
    width: 23px;
    height: 23px;
    flex-shrink: 0;
}

.category-product-grid .overlay-qty {
    min-width: 12px;
    font-size: 11px;
}

.category-panel:not(.category-directory-panel) {
    flex: 0 0 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    align-items: stretch;
}

.category-panel:not(.category-directory-panel) .category-product-grid {
    flex: 0 0 auto;
}


/* Empty states */

.product-grid > .empty-products,
.product-grid > .loading,
.product-grid > .catalogue-error {
    flex: 0 0 100%;
    box-sizing: border-box;
}


/* =========================================
   NARROW SCREEN ADJUSTMENTS
========================================= */

@media (max-width: 360px) {

    .category-directory-grid {
        gap: 6px;
    }

    .category-directory-card {
        padding: 8px;
    }

    .category-directory-name {
        font-size: 11px;
    }

    .category-product-grid {
        gap: 7px 5px;
        grid-auto-rows: 108px;
    }

    .category-product-grid .product-name,
    .category-product-grid .product-price {
        font-size: 10px;
    }
}


/* Side-view shopping cart illustration */

/* Cart scene background and animation */
.cart-section {
  position: relative;
  isolation: isolate;
  min-height: 0;
  height: 100%;
  overflow: hidden;

  display: flex;
  flex-direction: column;

  background:
    radial-gradient(
      ellipse at center,
      rgba(40, 40, 40, 0.12) 0%,
      rgba(12, 12, 12, 0.35) 65%,
      rgba(0, 0, 0, 0.85) 100%
    ),
    #171717;

  border: none;
  box-shadow: none;
  animation: cart-vibration 1.8s ease-in-out infinite;
}



/* Continuously moving rough texture */
.cart-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.018) 0px,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 5px
  );

  background-size: 36px 36px;
  animation: cart-texture-flow 5s linear infinite;
}

/* Scene fills the available cart section */

.cart-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.cart-scene {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: visible;
}

.cart-illustration {
  display: block;
  width: min(100%, 350px);
  height: 100%;
  max-height: 190px;
  overflow: visible;
  filter: drop-shadow(0 9px 7px #0008);
}

/* Floating cart summary, layered over the cart illustration */
.cart-summary {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* Items and View: left side, near the handle */
.cart-summary-left {
  position: absolute;
  left: 3%;
  top: 40%;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;

  pointer-events: auto;
}

/* Bill: right side, in front of the basket */
.cart-summary-bill {
  position: absolute;
  right: 2%;
  top: 40%;

  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;

  pointer-events: none;
}

.cart-summary-label {
  margin: 0;
  color: #9298a4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.cart-summary-value {
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.cart-view-button {
  min-width: 46px;
  height: 25px;
  margin-top: 3px;
  padding: 0 10px;

  border: 1px solid rgba(200, 255, 77, .55);
  border-radius: 7px;

  background: rgba(200, 255, 77, .12);
  color: var(--accent);

  font-size: 9px;
  font-weight: 800;

  cursor: pointer;
}

.cart-view-button:active {
  background: rgba(200, 255, 77, .25);
  transform: translateY(1px);
}


/* The SVG and track share one positioning reference */
.cart-illustration {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 9px 7px #0008);
}


/* Controls integrated into the cart panel */
/* Integrated cart controls: left | up/down | right */
.cart-controls {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  min-height: 62px;
  padding: 7px 12px;

  border-top: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(
    180deg,
    rgba(8, 9, 11, .3),
    rgba(8, 9, 11, .72)
  );
}

.cart-middle-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.cart-controls .cart-left {
  justify-self: start;
}

.cart-controls .cart-right {
  justify-self: end;
}

.cart-controls .direction-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.cart-controls .direction-button svg {
  width: 17px;
  height: 17px;
}

/* Track is drawn and positioned inside the SVG */
.cart-track {
  pointer-events: none;
}

/* Cart and background animations */
@keyframes cart-vibration {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-0.5px); }
  75% { transform: translateY(0.5px); }
}

@keyframes cart-texture-flow {
  from { background-position: 0 0; }
  to { background-position: -36px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cart-section,
  .cart-section::before {
    animation: none;
  }
}



/* Vertical cart vibration */
@keyframes cart-vibration {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-0.5px); }
  75% { transform: translateY(0.5px); }
}

/* Shared leftward motion for texture and track */
@keyframes cart-texture-flow {
  from { background-position: 0 0; }
  to { background-position: -36px 0; }
}

/* Accessibility: respect reduced-motion settings */
@media (prefers-reduced-motion: reduce) {
  .cart-section,
  .cart-section::before,
  .cart-track {
    animation: none;
  }
}


/* Bottom navigation */
.bottom-bar {
  height: var(--bottom-height); min-height: var(--bottom-height);
  display: grid; grid-template-columns: 58px minmax(0, 1fr) 58px; align-items: center; gap: 9px;
  padding: 8px 13px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: rgba(8,9,11,.97);
}
.nav-action { height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: #969ca7; }
.nav-action svg { width: 20px; height: 20px; }
.nav-action span:last-child { font-size: 8px; font-weight: 650; }
.home-action { color: var(--accent); }
.nav-cart-wrap { position: relative; height: 21px; }
.nav-cart-wrap svg { display: block; }
.cart-badge { position: absolute; top: -5px; right: -8px; min-width: 15px; height: 15px; display: grid; place-items: center; padding-inline: 3px; border: 2px solid var(--black); border-radius: 99px; background: var(--accent); color: #111; font-size: 8px; font-weight: 900; }
.checkout-button {
  min-width: 0; height: 36px; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 10px; border: 1px solid #3cff00; border-radius: 12px;
  color: #11150a; background: linear-gradient(180deg, #9af802, #3cff00);
  box-shadow: 0 5px 16px #c8ff4d1a, inset 0 1px 0 #ffffffb0;
  font-size: 11px; font-weight: 850; white-space: nowrap;
}
.checkout-total { padding-left: 7px; border-left: 1px solid #1115; font-size: 9px; font-weight: 800; }
.checkout-button svg { width: 16px; height: 16px; stroke-width: 2.2; }

/* Compact devices: preserve all three main subsections without page scrolling. */
@media (max-height: 720px) {
  :root { --topbar-height: 55px; --bottom-height: 62px; }
  .main-content {
  grid-template-rows:
    minmax(0, 1.65fr)
    minmax(132px, 1fr);
  gap: 6px;
  padding: 7px 9px;
}
  .products-section { padding: 7px; }
  .section-heading { margin-bottom: 5px; }
  .cart-section { padding: 0; }
  .product-grid { gap: 4px; }
  .product-card { padding: 3px 4px 4px; }
  .bottom-bar { padding-inline: 9px; }
}
@media (max-width: 360px) {
  .topbar { gap: 8px; padding-inline: 10px; grid-template-columns: auto minmax(0, 1fr) 34px; }
  .brand-name { font-size: 13px; }
  .brand-mark { width: 20px; }
  .icon-button { width: 34px; height: 36px; }
  .main-content { padding-inline: 7px; }
  .products-section { padding: 7px; }
   .product-grid {
    gap: 3px;
  }

  .product-card {
    padding: 2px;
    border-radius: 6px;
  }

  .product-image {
    border-radius: 4px;
  }

  .product-name {
    font-size: 8px;
  }

  .product-price {
    font-size: 8px;
  }

  .product-info {
    gap: 3px;
    padding: 2px 1px;
  }

    .cart-summary-left {
    left: 3%;
    top: 40%;
  }

  .cart-summary-bill {
    right: 2%;
    top: 40%;
  }

  .cart-summary-value {
    font-size: 12px;
  }

  .cart-view-button {
    min-width: 42px;
    height: 23px;
  }

.cart-controls {
  min-height: 56px;
  padding-inline: 7px;
}

.cart-controls .direction-button {
  width: 29px;
  height: 31px;
}
  .bottom-bar { grid-template-columns: 43px minmax(0, 1fr) 43px; gap: 5px; padding-inline: 7px; }
  .checkout-button { gap: 5px; padding-inline: 6px; font-size: 10px; }
  .checkout-total { font-size: 8px; padding-left: 5px; }
}


.cart-stage {
  flex: 1 1 0;
  min-height: 0;
}

.cart-controls {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  min-height: 62px;
}

.cart-controls .direction-button {
  display: grid;
  place-items: center;
  visibility: visible;
  opacity: 1;
  cursor: pointer;
}


/* Catalogue loading and error states */
.loading,
.empty-products,
.catalogue-error {
    grid-column: 1 / -1;
    padding: 24px 12px;
    text-align: center;
    color: #92949c;
    font-size: 13px;
}

.catalogue-error button {
    margin-top: 12px;
    padding: 9px 14px;
    border: 1px solid #c8ff4d;
    border-radius: 8px;
    background: transparent;
    color: #c8ff4d;
    cursor: pointer;
}

/* Product image and stock status */
.product-image {
    position: relative;
    overflow: hidden;
}

.product-image > img {
    display: block;
    width: 100%;
    height: 95%;
    object-fit: contain;
}

.stock-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    z-index: 2;
}

.stock-dot.available {
    background: #48e200;
}

.stock-dot.unavailable {
    background: #ff000d;
}

.product-card:not(.in-cart) .product-overlay {
    opacity: 0;
    pointer-events: none;
}

.product-card.in-cart .product-overlay,
.product-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Product controls */
.overlay-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.overlay-btn {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #c8ff4d;
    color: #08090b;
    font-size: 19px;
    cursor: pointer;
}

.overlay-qty {
    min-width: 14px;
    text-align: center;
    color: #fff;
    font-size: 13px;
}

.product-card:not(.in-cart) .product-overlay {
    visibility: hidden;
}

.product-card.in-cart .product-overlay {
    visibility: visible;
}

.product-image-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 80px;
    place-items: center;
    color: #92949c;
    font-size: 11px;
}



/* =========================================
   DELIVA — PRODUCT CARD
========================================= */

.category-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    align-items: stretch;
    grid-auto-rows: unset;
    min-height: 0;
}

.category-product-grid .product-card {
    position: relative;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: auto;
    overflow: hidden;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    padding: 3px;
    border: 1px solid #30333a;
    border-radius: 8px;

    text-align: left;
    background: linear-gradient(155deg, #22252c, #15171c);
    cursor: pointer;

    transition: border-color 0.16s, transform 0.16s;
}

.category-product-grid .product-card:active {
    transform: scale(0.98);
}

.category-product-grid .product-card.is-selected {
    border-color: var(--accent);
    background: linear-gradient(150deg, #2a3021, #171b15);
}

/* Image area */
.category-product-grid .product-image {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;
}

.category-product-grid .product-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Product name */
.category-product-grid .product-info {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;

    display: block;
    padding: 3px 2px 2px;
}

.category-product-grid .product-name {
    display: block;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #f2f3f5;
    font-size: 9px;
    font-weight: 650;
}

/* Price badge — single authoritative rule */
.category-product-grid .product-price {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 3;

    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    padding: 2px 3px;
    border-radius: 4px;

    color: var(--accent);
    background: rgba(8, 9, 11, 0.85);

    font-size: 9px;
    font-weight: 800;
}

/* Stock dot */
.category-product-grid .stock-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
}

/* Quantity overlay */
.category-product-grid .product-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    padding: 5px;
    box-sizing: border-box;
    background: linear-gradient(
        to top,
        rgba(8, 9, 11, 0.88),
        transparent 55%
    );

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.category-product-grid .product-card.in-cart .product-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.category-product-grid .overlay-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.category-product-grid .overlay-btn {
    width: 23px;
    height: 23px;
    flex-shrink: 0;
}

.category-product-grid .overlay-qty {
    min-width: 12px;
    color: #fff;
    font-size: 11px;
    text-align: center;
}

.category-product-grid .product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    color: #92949c;
    font-size: 10px;
}


/* =========================================
   DELIVA — CART BASKET CAPACITY LIGHTS
========================================= */

#cartFillCells .basket-cell {
    fill: #20252c;
    fill-opacity: 0.72;
    stroke: #69727e;
    stroke-width: 1;
    rx: 3;

    transition:
        fill 180ms ease,
        fill-opacity 180ms ease,
        stroke 180ms ease,
        filter 180ms ease;
}

/* Normal basket: green cells */
#cartFillCells .basket-cell.is-green {
    fill: #39ef65;
    fill-opacity: 0.95;
    stroke: #a2ffb5;
    filter: drop-shadow(0 0 3px #39ef6580);
}

/* Overflow: red cells */
#cartFillCells .basket-cell.is-red {
    fill: #ff414b;
    fill-opacity: 0.98;
    stroke: #ff9a9f;
    filter: drop-shadow(0 0 4px #ff414b);
}

/* Exactly full: amber rim glow */
.cart-illustration.is-full .cart-basket-rim {
    filter: drop-shadow(0 0 4px #ffd43b);
}

/* =========================================
   DELIVA — VIEW CART PANEL
========================================= */

.cart-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 16px;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(4px);
}

.cart-panel-overlay[hidden] {
    display: none;
}

.cart-panel {
    width: min(680px, 100%);
    max-height: min(78vh, 620px);

    display: flex;
    flex-direction: column;
    gap: 16px;

    padding: 20px;

    color: #f4f6f8;
    background: #171b20;
    border: 1px solid #39414b;
    border-radius: 16px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Header */

.cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cart-panel-header h2 {
    margin: 0;
    min-width: 0;

    color: #f4f6f8;
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1.3;
}

.cart-panel-close {
    flex: 0 0 auto;

    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    color: #c8ff4d;
    background: #29313a;
    border: 1px solid #414b56;
    border-radius: 8px;

    font-size: 1.5rem;
    cursor: pointer;
}

.cart-panel-close:hover {
    background: #36414c;
}

/* Scrollable table area */

.cart-panel-table-wrap {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.cart-panel-table {
    min-width: 490px;
}

/* Five-column layout */

.cart-panel-row {
    display: grid;
    grid-template-columns:
        minmax(150px, 2fr)
        44px
        68px
        78px
        104px;

    align-items: center;
    gap: 8px;
}

.cart-panel-column-headings {
    padding: 0 0 10px;

    color: #aeb8c4;
    font-size: 0.72rem;
    font-weight: 650;

    border-bottom: 1px solid #39414b;
}

.cart-panel-product-row {
    min-height: 44px;
    padding: 7px 0;

    color: #e8edf2;
    font-size: 0.8rem;

    border-bottom: 1px solid #2b323a;
}

/* Product name: one line, clipped with ellipsis */

.cart-panel-product-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cart-panel-product-name::before {
    content: "• ";
    color: #c8ff4d;
}

/* Quantity controls */

.cart-panel-quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-panel-quantity-controls button {
    width: 25px;
    height: 25px;
    padding: 0;

    display: grid;
    place-items: center;

    color: #c8ff4d;
    background: #29313a;
    border: 1px solid #414b56;
    border-radius: 6px;

    font-size: 1rem;
    cursor: pointer;
}

.cart-panel-quantity-controls button:hover {
    background: #3a4652;
}

.cart-panel-quantity {
    min-width: 18px;
    text-align: center;
    color: #f4f6f8;
}

/* Footer totals */

.cart-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;

    padding-top: 14px;
    border-top: 1px solid #39414b;

    color: #aeb8c4;
    font-size: 0.82rem;
}

.cart-panel-footer strong {
    margin-left: 4px;
    color: #c8ff4d;
    font-weight: 700;
}

/* Empty cart message */

.cart-panel-empty {
    padding: 24px 8px;
    color: #aeb8c4;
    text-align: center;
}

/* Small screens */

@media (max-width: 480px) {
    .cart-panel {
        padding: 15px;
        gap: 13px;
        border-radius: 13px;
    }

    .cart-panel-header h2 {
        font-size: 0.95rem;
    }

    .cart-panel-footer {
        font-size: 0.76rem;
    }
}


/* =========================================
   DELIVA — SIMPLIFIED CHECKOUT
========================================= */

.checkout-overlay,
.checkout-info-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 14px;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(5px);
}

.checkout-overlay[hidden],
.checkout-info-overlay[hidden],
#checkout-review[hidden],
#checkout-success-stage[hidden],
#checkout-error-stage[hidden] {
    display: none;
}


/* =========================================
   CHECKOUT MODAL
========================================= */

.checkout-modal {
    width: min(460px, 100%);
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px;
    color: #f4f6f8;
    background: #171b20;
    border: 1px solid #39414b;
    border-radius: 16px;
    box-shadow: 0 20px 65px #0008;
}


/* =========================================
   HEADERS
========================================= */

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.checkout-header h2 {
    margin: 0;
    color: #f4f6f8;
    font-size: 1.2rem;
    line-height: 1.35;
}

.checkout-close {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    color: #3cff00;
    background: #29313a;
    border: 1px solid #414b56;
    border-radius: 8px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.checkout-close:hover {
    background: #35404b;
}

.checkout-muted {
    color: #aeb8c4;
    font-size: 0.78rem;
}



/* =========================================
   CHECKOUT SUMMARY — ALIGNED THREE COLUMNS
========================================= */

.checkout-order-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 12px;
    padding: 12px 0;
    margin: 0;
}

.checkout-cart-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
}

.checkout-cart-label strong {
    font-size: 0.9rem;
    color: #f1f3f5;
}

.checkout-cart-label span {
    font-size: 0.76rem;
    color: #929ba6;
}

.checkout-overview-total {
    font-size: 0.92rem;
    color: #f1f3f5;
    white-space: nowrap;
    text-align: right;
}

.checkout-view-cart {
    justify-self: end;
    white-space: nowrap;
}


.checkout-view-cart:hover {
    background: #29352a;
}

.checkout-view-cart {
    justify-self: end;
    white-space: nowrap;
    padding: 4px 9px;
    color: #3cff00;
    background: #29352a;
    border: 1px solid #506044;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 750;
    cursor: pointer;
    transition: background 0.2s ease;
}

.checkout-view-cart:hover {
    background: #354735;
}

/* =========================================
   PRICE BREAKDOWN
========================================= */

.checkout-breakdown {
    margin-top: 0;
    padding: 0 2px;
}

.checkout-breakdown-row,
.checkout-breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.checkout-breakdown-row {
    min-height: 40px;
    padding: 9px 0;
    color: #e3e7ec;
    font-size: 0.83rem;
    border-bottom: none;
}

.checkout-breakdown-row > span:first-child {
    color: #c3cbd4;
}

.checkout-breakdown-row > span:last-child,
.checkout-breakdown-row > strong {
    font-weight: 700;
    white-space: nowrap;
}

.checkout-fee-value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.checkout-fee-value strong {
    color: #f4f6f8;
    font-size: 0.84rem;
    white-space: nowrap;
}

.checkout-info-button {
    padding: 4px 9px;
    color: #3cff00;
    background: #29352a;
    border: 1px solid #506044;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 750;
    cursor: pointer;
    transition: background 0.2s ease;
}

.checkout-info-button:hover {
    background: #354536;
}

.checkout-breakdown-total {
    margin-top: 5px;
    padding: 14px 0;
    color: #f4f6f8;
    font-size: 0.96rem;
    font-weight: 800;
    border-top: 1px solid #39414b;
}

.checkout-breakdown-total strong:last-child {
    color: #3cff00;
    font-size: 1.08rem;
}


/* =========================================
   CUSTOMER FORM
========================================= */

#checkout-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 13px;
}

.checkout-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #e3e7ec;
    font-size: 0.8rem;
}

.checkout-field b {
    color: #ff727b;
}

.checkout-field small {
    color: #aeb8c4;
    font-weight: 400;
}

.checkout-field input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px;
    color: #f4f6f8;
    background: #20262d;
    border: 1px solid #3b4652;
    border-radius: 8px;
    outline: none;
    font: inherit;
    font-size: 0.86rem;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.checkout-field input:focus {
    border-color: #3cff00;
    box-shadow: 0 0 0 2px #3cff0020;
}

.checkout-field input::placeholder {
    color: #778391;
}


/* =========================================
   OPERATIONS CONTACT NOTE
========================================= */

.checkout-contact {
    margin: 3px 0;
    padding: 11px 12px;
    color: #aeb8c4;
    background: #20262d;
    border-left: 3px solid #3cff00;
    border-radius: 5px;
    font-size: 0.74rem;
    line-height: 1.6;
}

.checkout-contact a,
.checkout-payment-message a {
    color: #3cff00;
    text-decoration: none;
}


/* =========================================
   ACTION BUTTONS
========================================= */

.checkout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 5px;
}

.checkout-actions button,
.checkout-done {
    min-height: 44px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 0.83rem;
    font-weight: 750;
    cursor: pointer;
    transition:
        background 0.2s ease,
        opacity 0.2s ease,
        transform 0.15s ease;
}

.checkout-cancel {
    color: #e3e7ec;
    background: #29313a;
    border: 1px solid #46515d;
}

.checkout-cancel:hover {
    background: #35404b;
}

.checkout-pay {
    color: #101710;
    background: #3cff00;
    border: 1px solid #3cff00;
}

.checkout-pay:hover {
    background: #70ff48;
}

.checkout-actions button:active,
.checkout-done:active {
    transform: scale(0.98);
}

.checkout-actions button:disabled,
.checkout-done:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}


/* =========================================
   SUCCESS STAGE
========================================= */

.checkout-payment-message {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkout-payment-message > p {
    margin: 0;
    color: #d5dbe2;
    font-size: 0.84rem;
    line-height: 1.6;
}

.checkout-payment-symbol {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: #3cff00;
    background: #29352a;
    border: 1px solid #506044;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 850;
}

.checkout-payment-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    color: #e3e7ec;
    border-top: 1px solid #39414b;
    font-size: 0.82rem;
    font-weight: 750;
}

.checkout-payment-summary strong {
    color: #3cff00;
    overflow-wrap: anywhere;
    text-align: right;
}

.checkout-copy-order {
    align-self: flex-start;
    padding: 8px 11px;
    color: #3cff00;
    background: #29352a;
    border: 1px solid #506044;
    border-radius: 7px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
}

.checkout-copy-order:hover {
    background: #354536;
}

.checkout-done {
    width: 100%;
    margin-top: 20px;
}


/* =========================================
   ERROR STAGE
========================================= */

#checkout-error-message {
    color: #d5dbe2;
    font-size: 0.84rem;
    line-height: 1.65;
}


/* =========================================
   SERVICE FEE INFORMATION MODAL
========================================= */

.checkout-info-modal {
    width: min(390px, 100%);
    max-height: 85dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 21px;
    color: #f4f6f8;
    background: #171b20;
    border: 1px solid #39414b;
    border-radius: 15px;
    box-shadow: 0 20px 65px #0008;
}

.checkout-info-modal > p {
    margin: 0 0 14px;
    color: #c3cbd4;
    font-size: 0.81rem;
    line-height: 1.6;
}

.checkout-info-modal .checkout-breakdown {
    margin: 13px 0 17px;
    padding: 0 11px;
    background: #20262d;
    border: 1px solid #343d47;
    border-radius: 9px;
}

.checkout-info-modal .checkout-breakdown-row {
    min-height: 40px;
    font-size: 0.76rem;
    border-bottom: 1px solid #2b323a;
}

.checkout-info-modal .checkout-breakdown-row:last-child {
    border-bottom: none;
}

.checkout-info-modal .checkout-breakdown-row strong {
    color: #3cff00;
}


/* =========================================
   RESPONSIVE DESIGN
========================================= */

@media (max-width: 480px) {

    .checkout-overlay,
    .checkout-info-overlay {
        padding: 10px;
    }

    .checkout-modal {
        width: 100%;
        max-height: 92dvh;
        padding: 18px;
    }

    .checkout-info-modal {
        width: 100%;
        padding: 18px;
    }

    .checkout-order-overview {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 8px;
    }

    .checkout-view-cart {
        padding: 7px 9px;
        font-size: 0.7rem;
    }

    .checkout-cart-total strong {
        font-size: 0.84rem;
    }
}


@media (max-width: 350px) {

    .checkout-modal {
        padding: 15px;
    }

    .checkout-order-overview {
        gap: 6px;
    }

    .checkout-cart-label strong {
        font-size: 0.8rem;
    }

    .checkout-cart-total strong {
        font-size: 0.78rem;
    }

    .checkout-view-cart {
        padding: 7px;
        font-size: 0.66rem;
    }

    .checkout-actions {
        grid-template-columns: 1fr;
    }

    .checkout-actions button {
        width: 100%;
    }
}
