/* AFP shopping cart drawer — themed via the same variables as product pages */
#aafp-cart-root {
  --afp-primary:      var(--e-global-color-primary, #1d1b84);
  --afp-primary-dark: #14126b;
  --afp-accent:       var(--e-global-color-accent, #4f6df5);
  --afp-cta-bg:       #f7b84b;
  --afp-cta-hover:    #f0a92e;
  font-family: inherit;
}
body.aafp-cart-lock { overflow: hidden; }

/* Floating cart button */
#aafp-cart-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 99998;
  width: 60px; height: 60px; border-radius: 999px; border: 0; cursor: pointer;
  background: #16a34a; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 28px rgba(22, 163, 74, .35);
  transition: transform .18s ease, background .18s ease;
}
#aafp-cart-fab:hover { transform: translateY(-2px) scale(1.04); background: #15803d; }
#aafp-cart-fab svg { width: 26px; height: 26px; }
#aafp-cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--afp-cta-bg); color: var(--afp-primary);
  font-size: .78rem; font-weight: 800; line-height: 22px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* Overlay + drawer */
#aafp-cart-overlay {
  position: fixed; inset: 0; z-index: 99998; background: rgba(15, 14, 60, .45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
#aafp-cart-overlay.is-open { opacity: 1; pointer-events: auto; }
#aafp-cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 99999;
  width: min(420px, 94vw); background: #fff;
  border-radius: 20px 0 0 20px;
  box-shadow: -18px 0 60px rgba(15, 14, 60, .25);
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .28s cubic-bezier(.22, .9, .3, 1);
}
#aafp-cart-drawer.is-open { transform: translateX(0); }

/* Header */
.aafp-cart__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px;
}
.aafp-cart__title { margin: 0; font-size: 1.25rem; font-weight: 800; color: var(--afp-primary); }
#aafp-cart-close {
  width: 36px; height: 36px; border-radius: 999px; border: 0; cursor: pointer;
  background: #f1f3f9; color: var(--afp-primary); font-size: 1.05rem; font-weight: 700;
  transition: background .15s ease;
  /* flex-center the ✕ glyph — as inline text it rode the baseline off-center */
  display: flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0;
}
#aafp-cart-close:hover { background: #e4e8f4; }

/* Search */
.aafp-cart__search { position: relative; padding: 0 22px 14px; }
.aafp-cart__search-wrap { position: relative; }
.aafp-cart__search-wrap svg {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; stroke: #94a3b8; pointer-events: none;
}
#aafp-cart-search {
  width: 100%; box-sizing: border-box; padding: 12px 16px 12px 42px;
  border: 1.5px solid #dbe0ee; border-radius: 999px; font-size: .95rem;
  background: #f8f9fd; color: #1e2a36; outline: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
#aafp-cart-search:focus { border-color: var(--afp-accent); background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--afp-accent) 18%, transparent); }
#aafp-cart-results { display: none; margin-top: 10px; border-radius: 14px; overflow: hidden; border: 1px solid #e7eaf4; }
#aafp-cart-results.has-results { display: block; }
.aafp-cart__searching { padding: 14px; font-size: .88rem; color: #64748b; background: #fff; }
.aafp-cart__result { cursor: pointer; transition: background .12s ease; }
.aafp-cart__result:hover { background: #f3f6ff; }
.aafp-cart__result-add.is-added { background: #16a34a !important; border-color: #16a34a !important; color: #fff !important; }
.aafp-cart__result {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff;
  border-bottom: 1px solid #f0f2f9; transition: background .12s ease;
}
.aafp-cart__result:last-child { border-bottom: 0; }
.aafp-cart__result:hover { background: #f8f9fd; }
.aafp-cart__result img { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #f5f2ee; flex: 0 0 auto; }
.aafp-cart__result-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.aafp-cart__result-meta a { font-weight: 700; font-size: .92rem; color: var(--afp-primary); text-decoration: none; line-height: 1.3; overflow-wrap: break-word; }
.aafp-cart__result-meta a:hover { color: var(--afp-accent); }
.aafp-cart__result-meta span { font-size: .78rem; color: #64748b; }
.aafp-cart__result-price { font-weight: 800; font-size: .88rem; color: var(--afp-primary); margin-top: 3px; }
.aafp-cart__catalog-link {
  display: block; text-align: center; padding: 13px 16px 6px; margin-top: 6px;
  border-top: 1px solid #eef1f5;
  font-size: .84rem; color: #64748b; text-decoration: none; line-height: 1.45;
}
.aafp-cart__catalog-link strong { color: var(--afp-primary); font-weight: 700; }
.aafp-cart__catalog-link:hover strong { text-decoration: underline; }
.aafp-cart__result-add {
  border: 0; cursor: pointer; border-radius: 999px; padding: 7px 14px;
  background: var(--afp-primary); color: #fff; font-size: .8rem; font-weight: 700;
  transition: background .15s ease;
}
.aafp-cart__result-add:hover { background: var(--afp-primary-dark); }

/* Items */
#aafp-cart-items { flex: 1 1 auto; overflow-y: auto; padding: 6px 22px; }
.aafp-cart__item {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px 0;
  border-bottom: 1px solid #f0f2f9;
}
.aafp-cart__thumb { flex: 0 0 auto; width: 62px; height: 62px; border-radius: 14px; background: #f5f2ee; display: block; overflow: hidden; }
.aafp-cart__thumb img { width: 100%; height: 100%; object-fit: contain; }
.aafp-cart__thumb--ph { flex: 0 0 auto; width: 62px; height: 62px; border-radius: 14px; background: linear-gradient(135deg, #eef1fb, #f5f2ee); display: inline-block; }
.aafp-cart__meta { flex: 1 1 auto; min-width: 0; }
.aafp-cart__name { display: block; font-weight: 800; font-size: .95rem; color: var(--afp-primary); text-decoration: none; }
.aafp-cart__name:hover { color: var(--afp-accent); }
.aafp-cart__opt { display: block; font-size: .8rem; color: #64748b; margin-top: 1px; }
.aafp-cart__opt--days { color: #16a34a; font-weight: 600; }
/* Quantity steppers + Remove: fully self-contained resets so theme button
   styles (padding, min-heights, pink borders, ovals) can't distort them. */
.aafp-cart__qty { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
#aafp-cart-root .aafp-cart__qty button[data-q] {
  appearance: none; -webkit-appearance: none;
  width: 30px !important; height: 30px !important; min-width: 0 !important; min-height: 0 !important;
  padding: 0 !important; margin: 0 !important;
  border: 1.5px solid #dbe0ee !important; border-radius: 999px !important;
  background: #fff !important; color: var(--afp-primary) !important;
  font-size: 1.05rem; font-weight: 700; line-height: 0 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  text-align: center !important; vertical-align: middle;
  box-shadow: none !important; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
#aafp-cart-root .aafp-cart__qty button[data-q]:hover { border-color: var(--afp-accent) !important; background: #f6f8ff !important; }
.aafp-cart__qty > span { min-width: 20px; text-align: center; font-weight: 800; font-size: .95rem; color: #1e2a36; }
#aafp-cart-root .aafp-cart__remove {
  appearance: none; -webkit-appearance: none;
  border: 0 !important; border-radius: 0 !important; background: transparent !important;
  padding: 0 !important; margin: 0 0 0 10px !important; min-height: 0 !important;
  color: #9aa3b5 !important; font-size: .78rem !important; font-weight: 500 !important;
  text-decoration: underline; box-shadow: none !important; cursor: pointer; line-height: 1;
}
#aafp-cart-root .aafp-cart__remove:hover { color: #dc2626 !important; }
.aafp-cart__price { font-weight: 800; color: var(--afp-primary); font-size: .98rem; white-space: nowrap; padding-top: 2px; }

/* Empty state */
.aafp-cart__empty { text-align: center; padding: 60px 20px; color: #64748b; }
.aafp-cart__empty svg { width: 54px; height: 54px; color: #c3cadd; margin-bottom: 12px; }
.aafp-cart__empty p { margin: 0 0 4px; font-weight: 800; color: var(--afp-primary); font-size: 1.02rem; }
.aafp-cart__empty span { font-size: .86rem; }

/* Footer */
.aafp-cart__footer { padding: 16px 22px 20px; border-top: 1px solid #eef0f8; background: #fbfcfe; border-radius: 0 0 0 20px; }
.aafp-cart__subrow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.aafp-cart__subrow span { font-size: .95rem; color: #475569; font-weight: 600; }
#aafp-cart-subtotal { font-size: 1.25rem; font-weight: 800; color: var(--afp-primary); }
.aafp-cart__viewall {
  display: block; text-align: center; margin: 0 0 10px; padding: 12px 24px;
  border: 1.5px solid var(--afp-primary); border-radius: 999px;
  color: var(--afp-primary); font-size: .92rem; font-weight: 700; text-decoration: none;
  transition: background .15s ease;
}
.aafp-cart__viewall:hover { background: #f3f6ff; color: var(--afp-primary); }
.aafp-cart__viewall--empty { display: inline-block; margin: 16px 0 0; padding: 11px 26px; }
#aafp-cart-checkout {
  display: block; width: 100%; border: 0; cursor: pointer;
  padding: 15px 24px; border-radius: 999px;
  background: #16a34a; color: #fff;
  font-size: 1rem; font-weight: 800;
  transition: background .15s ease, transform .12s ease;
}
#aafp-cart-checkout:hover { background: #15803d; transform: translateY(-1px); }
.aafp-cart__note { margin: 10px 0 0; text-align: center; font-size: .75rem; color: #94a3b8; }

/* Header cart icon (in the menu bar) */
.aafp-headercart-li { list-style: none; display: flex; align-items: center; }
.aafp-headercart-abs { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); z-index: 50; }
/* Mobile instance: pinned to the header's top-right corner, far from the
   hamburger. Hidden on desktop where the nav-menu instance shows instead.
   1024px matches Elementor's default mobile-nav breakpoint. */
.aafp-headercart-mobile { display: none; position: fixed; top: 12px; right: 12px; z-index: 99997; }
.aafp-headercart-mobile .aafp-cart-headbtn {
  margin: 0; width: 42px; height: 42px; justify-content: center;
  background: transparent !important; border-radius: 0 !important;
  box-shadow: none !important;
  color: #16a34a !important; /* green cart glyph, no circle */
}
.aafp-headercart-mobile .aafp-cart-headbtn svg {
  width: 26px; height: 26px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); /* legible over any header */
}
body.admin-bar .aafp-headercart-mobile { top: 58px; } /* clear the WP admin bar when logged in */
@media (max-width: 1024px) {
  /* !important armor: some theme/menu CSS hides injected header elements */
  .aafp-headercart-mobile { display: inline-flex !important; visibility: visible !important; opacity: 1 !important; }
  .aafp-headercart-li { display: none; } /* hide the in-menu duplicate on mobile */
}
.aafp-cart-headbtn {
  appearance: none; -webkit-appearance: none; position: relative;
  border: 0 !important; background: transparent !important; box-shadow: none !important;
  padding: 6px !important; margin: 0 0 0 10px; min-height: 0 !important;
  color: #fff; cursor: pointer; display: inline-flex; align-items: center;
  transition: opacity .15s ease, transform .15s ease;
}
.aafp-cart-headbtn:hover { opacity: .85; transform: translateY(-1px); }
.aafp-cart-headbtn svg { width: 24px; height: 24px; }
.aafp-cart-count-head {
  position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #16a34a; color: #fff;
  font-size: .7rem; font-weight: 800; line-height: 18px; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
/* Floating button steps aside once the header cart is mounted */
#aafp-cart-root.has-headercart #aafp-cart-fab { display: none; }

@media (max-width: 480px) {
  #aafp-cart-fab { right: 14px; bottom: 14px; width: 54px; height: 54px; }
  #aafp-cart-drawer { border-radius: 0; width: 100vw; }
  .aafp-cart__footer { border-radius: 0; }
}

.aafp-cart__result--cond { background: #fbfbff; }
.aafp-cart__result-type {
  flex: 0 0 auto; align-self: center; padding: 4px 10px; border-radius: 999px;
  background: #eef2ff; color: #4338ca; font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
}
.aafp-cart__result-condlink { color: var(--afp-primary); font-size: .78rem; font-weight: 700; margin-top: 2px; }
