/* Local wholesale cart */
.cart-trigger {
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--primary-dark);
    background: var(--surface);
    cursor: pointer;
    line-height: 0;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease, transform 200ms ease;
}
.cart-trigger:hover { border-color: var(--primary-light); color: var(--primary-light); background: rgba(15,59,51,.05); transform: translateY(-1px); }
.site-header .cart-trigger { color: #fff; border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); }
.site-header .cart-trigger:hover { color: #fff; border-color: rgba(255,255,255,.38); background: rgba(255,255,255,.14); }
.cart-trigger-icon { width: 23px; height: 23px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-count {
    position: absolute;
    inset-block-start: -6px;
    inset-inline-end: -6px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1px 4px 0;
    border: 2px solid var(--surface);
    border-radius: 999px;
    color: #fff;
    background: var(--accent-dark);
    box-shadow: 0 3px 8px rgba(9,43,37,.2);
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: center;
    transition: opacity 180ms ease, transform 180ms ease;
}
.site-header .cart-count { border-color: var(--primary-dark); }
.cart-count.is-empty { visibility: hidden; opacity: 0; transform: scale(.7); }
.add-to-cart:disabled { opacity: .58; cursor: not-allowed; }
.card-actions-cart { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cart-backdrop {
    position: fixed;
    z-index: 90;
    inset: 0;
    visibility: hidden;
    opacity: 0;
    background: rgba(9, 28, 24, .5);
    backdrop-filter: blur(2px);
    transition: opacity 250ms ease, visibility 250ms ease;
}
.cart-backdrop.is-open { visibility: visible; opacity: 1; }
.cart-drawer {
    position: fixed;
    z-index: 100;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(440px, 100%);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    transform: translateX(105%);
    color: var(--text-primary);
    background: var(--surface);
    box-shadow: -24px 0 60px rgba(9,43,37,.2);
    transition: transform 300ms ease, visibility 300ms ease;
}
html[dir="rtl"] .cart-drawer { transform: translateX(-105%); box-shadow: 24px 0 60px rgba(9,43,37,.2); }
.cart-drawer.is-open, html[dir="rtl"] .cart-drawer.is-open { visibility: visible; transform: translateX(0); }
body.cart-open { overflow: hidden; }
.cart-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px; border-bottom: 1px solid var(--border); }
.cart-drawer-head h2, .cart-drawer-head p { margin: 0; }
.cart-drawer-head h2 { color: var(--primary-dark); font-size: 24px; }
.cart-close { width: 42px; height: 42px; flex: 0 0 42px; padding: 0; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--primary-dark); background: var(--background); cursor: pointer; line-height: 0; }
.cart-close svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 22px; }
.cart-item { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.cart-item-image { width: 76px; height: 94px; border-radius: 11px; background: var(--surface-alt); object-fit: cover; }
.cart-item-copy { min-width: 0; }
.cart-item-copy h3 { margin: 0 0 3px; overflow: hidden; color: var(--text-primary); font-size: 15px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-copy > span { display: block; color: var(--text-secondary); font-size: 12px; }
.cart-item-copy > .cart-item-pack { margin-top: 3px; color: var(--primary); font-weight: 700; }
.cart-item-price { display: block; margin-top: 4px; color: var(--primary); font-size: 13px; }
.cart-item-subtotal { margin-top: 3px; display: block; color: var(--text-secondary); font-size: 11px; }
.cart-item-controls { width: fit-content; display: inline-flex; align-items: center; margin-top: 9px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; }
.cart-item-controls button { width: 30px; height: 29px; border: 0; color: var(--primary); background: var(--background); cursor: pointer; font-weight: 800; }
.cart-item-controls span { min-width: 30px; text-align: center; font-weight: 700; }
.cart-item-remove { align-self: start; border: 0; color: #a83b35; background: transparent; cursor: pointer; font-size: 21px; }
.cart-empty { flex: 1; display: none; place-items: center; align-content: center; padding: 38px; text-align: center; }
.cart-empty.is-visible { display: grid; }
.cart-empty-icon { width: 68px; height: 68px; display: grid; place-items: center; border: 1px solid rgba(15,59,51,.16); border-radius: 50%; color: var(--primary); background: rgba(15,59,51,.055); }
.cart-empty-icon svg { width: 34px; height: 34px; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cart-empty strong { margin-top: 12px; color: var(--primary-dark); font-size: 20px; }
.cart-empty p { max-width: 310px; color: var(--text-secondary); }
.cart-summary { padding: 20px 22px 24px; border-top: 1px solid var(--border); background: var(--surface); }
.cart-summary.is-hidden { display: none; }
.cart-summary > div { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 7px; }
.cart-summary > .cart-summary-total { padding-top: 8px; border-top: 1px dashed var(--border); font-size: 17px; }
.cart-summary small { display: block; margin: 10px 0 15px; color: var(--text-secondary); line-height: 1.65; }
.cart-clear { width: 100%; margin-top: 9px; border: 0; color: #96352f; background: transparent; cursor: pointer; font-weight: 700; }
.cart-toast {
    position: fixed;
    z-index: 240;
    left: 50%;
    right: auto;
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
    width: max-content;
    max-width: min(420px, calc(100vw - 32px));
    min-height: 48px;
    padding: 11px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 14px;
    color: #fff;
    background: var(--primary-dark);
    box-shadow: 0 14px 34px rgba(5,34,28,.24);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.55;
    text-align: center;
    overflow-wrap: anywhere;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(-50%, 15px, 0) scale(.97);
    transition: opacity 250ms ease, transform 250ms ease, visibility 0s linear 250ms;
}
.cart-toast::before {
    content: "✓";
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--primary-dark);
    background: #fff;
    font-size: 14px;
    font-weight: 900;
}
.cart-toast.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translate3d(-50%, 0, 0) scale(1);
    transition-delay: 0s;
}

.flash {
    position: fixed;
    z-index: 320;
    left: 50%;
    right: auto;
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
    width: max-content;
    max-width: min(480px, calc(100vw - 32px));
    min-height: 50px;
    margin: 0;
    padding: 10px 12px 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 14px;
    color: #fff;
    background: var(--primary-dark);
    box-shadow: 0 14px 34px rgba(5,34,28,.24);
    font-size: 14px;
    font-weight: 750;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(-50%, 15px, 0) scale(.97);
    transition: opacity 220ms ease, transform 220ms ease, visibility 0s linear 220ms;
}
.flash.success { border-color: rgba(255,255,255,.16); color: #fff; background: var(--primary-dark); }
.flash.error { border-color: rgba(255,255,255,.18); color: #fff; background: #8b2c2c; }
.flash.is-visible { visibility: visible; opacity: 1; pointer-events: auto; transform: translate3d(-50%, 0, 0) scale(1); transition-delay: 0s; }
.flash.is-dismissing { visibility: hidden; opacity: 0; transform: translate3d(-50%, 12px, 0) scale(.97); }
.flash-icon { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 50%; color: currentColor; background: rgba(255,255,255,.13); }
.flash-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.flash-message { min-width: 0; flex: 1; line-height: 1.6; overflow-wrap: anywhere; }
.flash-close { width: 34px; height: 34px; flex: 0 0 34px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 9px; color: currentColor; background: transparent; cursor: pointer; }
.flash-close:hover { background: rgba(255,255,255,.1); }
.flash-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.flash-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 480px) {
    .cart-toast,
    .flash {
        width: calc(100vw - 24px);
        max-width: none;
        min-height: 52px;
        bottom: max(12px, calc(env(safe-area-inset-bottom) + 10px));
        padding: 11px 14px;
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    .cart-trigger { width: 40px; height: 40px; flex-basis: 40px; }
    .cart-trigger-icon { width: 22px; height: 22px; }
    .cart-drawer-head { padding: 18px; }
    .cart-items { padding-inline: 16px; }
    .cart-summary { padding: 16px 18px 20px; }
    .cart-item { grid-template-columns: 68px minmax(0, 1fr) auto; gap: 10px; }
    .cart-item-image { width: 68px; height: 86px; }
}

@media (max-width: 360px) {
    .cart-count { inset-block-start: -5px; inset-inline-end: -4px; }
    .card-actions-cart { grid-template-columns: 1fr; }
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin: 2rem 0 0;
}

.pagination a {
  min-width: 2.5rem;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem .8rem;
  border: 1px solid rgba(15, 91, 77, .18);
  border-radius: .7rem;
  background: #fff;
  color: #173f38;
  font-weight: 700;
}

.pagination a:hover,
.pagination a.active {
  background: #0f5b4d;
  border-color: #0f5b4d;
  color: #fff;
}
