/* Hide WooCommerce's built-in "Calculate shipping" link/form on the cart page.
   Shipping is calculated on checkout only — forcing customers to enter address
   there triggers abandoned cart capture. */
.woocommerce-cart .shipping-calculator-button,
.woocommerce-cart .shipping-calculator-form,
.woocommerce-cart .woocommerce-shipping-calculator {
    display: none !important;
}

/* Hide WooCommerce's default empty "Shipping" row on the cart page.
   We render our own custom row right after subtotal. */
.woocommerce-cart .cart_totals tr.shipping:not(.fragbox-cart-shipping-note) {
    display: none !important;
}

/* Our friendly "almost there!" message on the cart page. */
.fragbox-cart-shipping-note th {
    color: #1d4a23;
    font-weight: 600;
}

.fragbox-cart-almost-there {
    color: #2e8540;
    font-weight: 600;
    font-style: italic;
}

/* Rate note shown under each shipping option */
.fragbox-rate-note {
    display: block;
    margin-top: .3em;
    padding: .3em 0;
    font-size: .85em;
    font-style: italic;
    color: #50575e;
    line-height: 1.4;
}

/* Warning variant — amber background, bolder, not italic */
.fragbox-rate-note.fragbox-rate-warning {
    display: block;
    margin-top: .5em;
    padding: .6em .8em;
    background: #fff8e1;
    border-left: 3px solid #f0a020;
    border-radius: 3px;
    color: #5a3a00;
    font-style: normal;
    font-weight: 500;
    font-size: .9em;
}

/* Pickup variant — friendly light-green pill with an inline check. */
.fragbox-rate-note.fragbox-rate-pickup {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    margin-top: .4em;
    padding: .45em .75em;
    background: #e6f7ea;
    border-left: 3px solid #2e8540;
    border-radius: 3px;
    color: #1d4a23;
    font-style: normal;
    font-weight: 500;
    font-size: .9em;
}

.fragbox-rate-note.fragbox-rate-pickup .fragbox-inline-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #2e8540;
    color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Tier nudge */
.fragbox-tier-nudge {
    background: #f0fafb;
    border: 1px solid #5fbec8;
    border-radius: 4px;
    padding: 14px 18px;
    margin: 1em 0;
    font-size: 14px;
}
.fragbox-tier-unlocked {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2a7e86;
    font-weight: 600;
    margin-bottom: 6px;
}
.fragbox-tier-check { color: #2e8b57; font-weight: 700; }
.fragbox-tier-next { color: #444; margin-bottom: 10px; }
.fragbox-tier-diff { color: #f7941d; }
.fragbox-tier-reward { color: #2a7e86; }
.fragbox-tier-bar {
    background: #d8eef0;
    border-radius: 999px;
    height: 8px;
    margin: 8px 0 12px;
    overflow: hidden;
}
.fragbox-tier-bar-fill {
    background: #5fbec8;
    height: 100%;
    transition: width .3s ease;
}
.fragbox-tier-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
}
.fragbox-tier-item {
    flex: 1;
    min-width: 90px;
    text-align: center;
    color: #888;
    padding: 6px 4px;
    border-radius: 3px;
    background: rgba(255,255,255,0.5);
}
.fragbox-tier-item--unlocked {
    color: #2a7e86;
    background: #d8eef0;
    font-weight: 600;
}
.fragbox-tier-item-min { color: #f7941d; font-weight: 600; }
.fragbox-tier-item--unlocked .fragbox-tier-item-min { color: #2e8b57; }

/* Livestock minimum branded notice */
.fb-lsmin {
    max-width: 640px;
    margin: 0 0 1.5em;
    font-family: inherit;
}
.fb-lsmin-bar {
    background: #5fbec8;
    color: #fff;
    padding: 14px 16px;
    border-radius: 4px;
}
.fb-lsmin[data-expanded="true"] .fb-lsmin-bar { border-radius: 4px 4px 0 0; }
.fb-lsmin-row { display: flex; align-items: center; gap: 12px; }
.fb-lsmin-pill {
    background: #f7941d;
    color: #fff;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.fb-lsmin-msg { font-size: 14px; flex: 1; line-height: 1.4; }
.fb-lsmin-msg strong { font-weight: 700; }
.fb-lsmin-why { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.fb-lsmin-why-btn {
    background: rgba(255,255,255,0.25);
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
}
.fb-lsmin-why-link {
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    text-decoration: underline;
}
.fb-lsmin-panel {
    background: #f0fafb;
    border: 1px solid #5fbec8;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}
.fb-lsmin-panel ul { margin: 8px 0 12px 18px; padding: 0; }
.fb-lsmin-panel li { margin-bottom: 4px; color: #444; }
.fb-lsmin-panel p { margin: 0 0 10px; }
.fb-lsmin-panel .fb-lsmin-sub { font-weight: 600; color: #2a7e86; margin-top: 6px; }

@media (max-width: 600px) {
    .fb-lsmin {
        max-width: none;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
    .fb-lsmin-bar, .fb-lsmin-panel { border-radius: 0 !important; border-left: none; border-right: none; }
}

/* "Heads up" amber-bordered notice for free-shipping coral over threshold */
.fragbox-rate-note.fragbox-rate-headsup {
    background: #fff8e6;
    border: 1px solid #f0c265;
    border-left: 3px solid #f7941d;
    border-radius: 3px;
    padding: 10px 14px;
    margin: 8px 0 0;
    font-size: 13px;
    color: #5a3a00;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.fragbox-headsup-pill {
    background: #f7941d;
    color: #fff;
    font-style: normal;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.4;
}
.fragbox-headsup-text { flex: 1; }

/* Pickup confirmation box */
.fragbox-pickup-confirm {
    display: none !important;
    margin: 8px 0 0 24px;
    padding: 12px 14px;
    background: #fff8e6;
    border: 1px solid #f0c265;
    border-left: 3px solid #f7941d;
    border-radius: 3px;
    font-size: 13px;
    color: #5a3a00;
    line-height: 1.5;
}
.fragbox-pickup-confirm.is-visible { display: block !important; }
.fragbox-pickup-confirm-msg { margin-bottom: 10px; }
.fragbox-pickup-confirm-msg strong { color: #3d2500; }
.fragbox-pickup-confirm-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9c08a;
    border-radius: 3px;
    font-size: 14px;
    font-family: monospace;
    letter-spacing: 1px;
    background: #fff;
    box-sizing: border-box;
}
.fragbox-pickup-confirm-input:focus {
    outline: none;
    border-color: #f7941d;
    box-shadow: 0 0 0 2px rgba(247,148,29,0.2);
}
.fragbox-pickup-confirm-input.valid {
    border-color: #46b450;
    background: #f0fff0;
}
.fragbox-pickup-confirm-status {
    margin-top: 6px;
    font-size: 12px;
    color: #888;
    min-height: 16px;
}
.fragbox-pickup-confirm-status.valid {
    color: #2e8b57;
    font-weight: 500;
}
#place_order.fragbox-disabled,
button[name="woocommerce_checkout_place_order"].fragbox-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* Heavy + livestock block notice — reuses .fb-lsmin styles. */
.fb-heavy-block .fb-lsmin-panel.fb-heavy-block-panel {
    display: block;
}
.fb-heavy-block-panel ul.fb-heavy-list {
    margin: 8px 0 12px 0;
    padding-left: 18px;
}
.fb-heavy-block-panel ul.fb-heavy-list li {
    margin-bottom: 3px;
    color: #444;
}

/* Pickup disabled (below pickup minimum) */
.fragbox-pickup-disabled-note {
    font-size: 12px;
    color: #b88300;
    margin: 4px 0 0 22px;
    line-height: 1.4;
}
.fragbox-pickup-disabled-icon {
    color: #f7941d;
    font-weight: 700;
}
.fragbox-pickup-row-disabled {
    opacity: 0.55;
}
.fragbox-pickup-radio-disabled {
    cursor: not-allowed;
}

/* Pickup minimum line within livestock notice */
.fb-lsmin-pickup-note {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.3;
}

/* Notices that should only show when shipping (not pickup) is selected. */
.fb-shipping-only.is-hidden {
    display: none !important;
}

/* Pickup note (green check) — hidden until pickup radio is selected. */
[data-fb-when-pickup-selected] {
    display: none !important;
}
[data-fb-when-pickup-selected].is-visible {
    display: inline-flex !important;
}

/* Coupon form: hide by default, only show when user clicks "Click here to enter your code". */
form.checkout_coupon {
    display: none;
}
form.checkout_coupon.fragbox-coupon-open {
    display: block;
}

/* Mobile: Flatsome and similar themes force-expand the coupon form on mobile.
   Override that with !important. */
@media (max-width: 849px) {
    form.checkout_coupon,
    form.woocommerce-form-coupon {
        display: none !important;
    }
    form.checkout_coupon.fragbox-coupon-open,
    form.woocommerce-form-coupon.fragbox-coupon-open {
        display: block !important;
    }
}

/* ===== Cart-page shipping tier display ===== */
/* Color tokens — defined here so we don't depend on theme variables. */
.shipping-tiers {
  --fb-abyss: #1f6b64;
  --fb-reef: #4aa89e;
  --fb-coral: #ff8a5c;
  --fb-coral-deep: #e66a3f;
  background: transparent;
  border: 1.5px solid var(--fb-reef);
  border-radius: 12px;
  padding: 18px 20px 16px;
  margin-bottom: 24px;
  font-family: 'DM Sans', sans-serif;
}

/* Unlocked pill */
.shipping-tiers .tier-unlocked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px; margin-bottom: 10px;
  background: #eaf7ee; border-radius: 8px;
  font-size: 14px; color: #2d8659; line-height: 1.3;
}
.shipping-tiers .tier-unlocked-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.shipping-tiers .tier-unlocked strong { font-weight: 700; color: #2d8659; }
.shipping-tiers .tier-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #2d8659; color: #fff;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.shipping-tiers .tier-free-pill {
  font-size: 12px;
  font-weight: 600;
  color: #2d8659;
  background: #fff;
  border: 1px solid #2d8659;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* "Spend X more" message */
.shipping-tiers .tier-message {
  font-size: 14px; color: var(--fb-abyss);
  margin-bottom: 18px; line-height: 1.4;
}
.shipping-tiers .tier-message strong {
  color: var(--fb-coral-deep); font-weight: 700;
}

/* Track + animated fill */
.shipping-tiers .tier-track {
  position: relative; height: 6px;
  background: #eaf3f1; border-radius: 10px; margin: 0 6px 14px;
}
.shipping-tiers .tier-fill {
  position: absolute; top: 0; left: 0; height: 100%;
  background: linear-gradient(90deg, #bfebd3, #9adcb8);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(154,220,184,0.5);
  transition: width .8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Milestone dots */
.shipping-tiers .tier-dots {
  position: absolute; top: 50%; left: 0; right: 0; height: 0;
}
.shipping-tiers .tier-dot {
  position: absolute; top: 0; transform: translate(-50%, -50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid rgba(31,107,100,0.25);
}
.shipping-tiers .tier-dot.reached {
  background: #7ace9c; border-color: #7ace9c;
  box-shadow: 0 0 0 3px rgba(122,206,156,0.2);
}
.shipping-tiers .tier-dot.next {
  background: #fff; border-color: var(--fb-coral);
  box-shadow: 0 0 0 3px rgba(255,138,92,0.2);
  animation: tier-pulse 2s ease-in-out infinite;
}
@keyframes tier-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,138,92,0.2); }
  50%      { box-shadow: 0 0 0 6px rgba(255,138,92,0.1); }
}

/* Labels under dots — defaults to 5 columns; PHP overrides via inline style if tier count differs. */
.shipping-tiers .tier-labels {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 4px; text-align: center;
}
.shipping-tiers .tier-amount {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #4a5552; letter-spacing: -0.01em; margin-bottom: 2px;
}
.shipping-tiers .tier-label.reached .tier-amount { color: #2d8659; }
.shipping-tiers .tier-reward {
  font-size: 13px; color: #4a5552;
  line-height: 1.3; font-weight: 600;
}
.shipping-tiers .tier-reward-sub {
  font-size: 11.5px; font-weight: 500; opacity: 1;
}
.shipping-tiers .tier-label.reached .tier-reward { color: #2d8659; }

/* Mobile — full bleed and smaller labels */
@media (max-width: 768px) {
  .shipping-tiers {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding-left: 16px;
    padding-right: 16px;
  }
  .shipping-tiers .tier-amount { font-size: 11px; }
  .shipping-tiers .tier-reward { font-size: 10px; line-height: 1.2; }
  .shipping-tiers .tier-reward-sub { font-size: 9px; }
  .shipping-tiers .tier-labels { gap: 2px; }
  .shipping-tiers .tier-free-pill { font-size: 11px; padding: 3px 8px; }
}

/* Confirmed state: amber box flips to Fragbox teal to signal good-to-go. */
.fragbox-pickup-confirm.fragbox-confirmed {
    background: #e6f7f6;
    border-color: #5fbec8;
    border-left-color: #5fbec8;
    color: #1f6b64;
}
.fragbox-pickup-confirm.fragbox-confirmed .fragbox-pickup-confirm-msg strong {
    color: #1f6b64;
}
.fragbox-pickup-confirm.fragbox-confirmed .fragbox-pickup-confirm-input {
    border-color: #5fbec8;
    background: #fff;
}
.fragbox-pickup-confirm.fragbox-confirmed .fragbox-pickup-confirm-status.valid {
    color: #1f6b64;
    font-weight: 600;
}
