/* ── KARTICA (mobile) — polaroid look ─────────────────────────── */
.fs-pol-card-mobile {
  background: #fdfdfa;
  border: 1px solid #ece8de;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
  box-shadow:
    0 2px 4px rgba(0,0,0,.08),
    0 10px 24px rgba(0,0,0,.16),
    0 18px 40px rgba(0,0,0,.08);
}

/* Mobile thumbnail — polaroid beli rob */
.fs-pol-thumb-mobile {
  position: relative;
  background: #fdfdfa;
  cursor: pointer;
}
.fs-pol-thumb-mobile canvas {
  display: block;
  width: 100%;
  border-radius: 2px;
}
.fs-pol-tap-hint-mobile {
  position: absolute;
  top: calc(50% - 14px);
  right: 14px;
  opacity: 0;
  pointer-events: none;
}
.fs-pol-thumb-mobile.fs-pol-tapping { opacity: 0.75; }

/* Mobile card bar */
.fs-pol-card-bar-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  gap: 8px;
  background: #fdfdfa;
  border-top: 1px solid #f0ede3;
}
.fs-pol-card-info-mobile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}
.fs-pol-card-fmt-mobile {
  font-size: 14px;
  font-weight: 600;
  color: #1c1a17;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-pol-card-price-mobile { font-size: 12px; color: #888; }
.fs-pol-card-actions-mobile {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.fs-pol-mob-edit-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #e0e0e0;
  border-radius: 7px;
  background: #fafafa;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}
.fs-pol-mob-qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fafafa;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}
.fs-pol-mob-qty-val {
  font-weight: 700;
  font-size: 14px;
  min-width: 20px;
  text-align: center;
}
.fs-pol-mob-del-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: none;
  color: #ccc;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fs-pol-mob-del-btn:hover { background: #fee; color: #e33; }

/* ── MOBILE STICKY BAR ───────────────────────────────────────── */
.fs-pol-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #ebebeb;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fs-pol-sticky-add-lbl {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f0f0f0;
  color: #1c1a17;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.fs-pol-sticky-add-lbl:active { background: #e0e0e0; }
.fs-pol-sticky-set-btn {
  flex-shrink: 0;
  background: #f0f0f0;
  color: #1c1a17;
  border: none;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  gap: 4px;
}
.fs-pol-sticky-set-btn:active { background: #e0e0e0; }

/* ── MOBILE DRAWER (slide from left) ────────────────────────── */
html.fs-pol-drawer-open,
html.fs-pol-drawer-open body { overflow: hidden !important; }

.fs-pol-drawer {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
}
.fs-pol-drawer.is-open { pointer-events: auto; }

.fs-pol-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity .22s ease;
}
.fs-pol-drawer.is-open .fs-pol-drawer__overlay { opacity: 1; }

/* iOS HIG — inset grouped table style */
.fs-pol-drawer__panel {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: min(88vw, 320px);
  background: #f2f2f7;
  border-right: none;
  transform: translateX(-102%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 24px rgba(0,0,0,.18);
}
.fs-pol-drawer.is-open .fs-pol-drawer__panel { transform: translateX(0); }

/* Navigation bar */
.fs-pol-drawer__header {
  padding: 0 16px;
  height: 38px;
  background: rgba(242,242,247,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: .5px solid rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.fs-pol-drawer__title {
  font-size: 15px;
  font-weight: 600;
  color: #000;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  letter-spacing: -.4px;
}
.fs-pol-drawer__close {
  border: 0;
  background: transparent;
  color: #E8A050;
  font-size: 14px;
  padding: 0;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: -.2px;
  line-height: 38px;
  flex-shrink: 0;
}

/* Scrollable content area */
.fs-pol-drawer__content {
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

/* ── iOS GROUPED SECTIONS ────────────────────────────────────── */
.fs-pol-drawer-section {
  margin: 20px 16px 0;
}
.fs-pol-drawer-section:last-child { margin-bottom: 20px; }

.fs-pol-drawer-section-title {
  font-size: 11px;
  font-weight: 400;
  color: #6d6d72;
  text-transform: uppercase;
  letter-spacing: -.1px;
  margin-bottom: 8px;
  padding: 0 4px;
}

/* Grouped card — all rows inside one rounded card */
.fs-pol-drawer-section .fs-pol-opt:first-of-type {
  border-radius: 10px 10px 0 0;
}
.fs-pol-drawer-section .fs-pol-opt:last-of-type {
  border-radius: 0 0 10px 10px;
  border-bottom: none !important;
}
.fs-pol-drawer-section .fs-pol-opt:only-of-type {
  border-radius: 10px;
  border-bottom: none !important;
}

/* ── OPTION ROWS ─────────────────────────────────────────────── */
.fs-pol-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  background: #fff;
  border-bottom: .5px solid #c6c6c8;
  cursor: pointer;
  touch-action: pan-x pan-y;
  -webkit-tap-highlight-color: transparent;
  min-height: 38px;
  box-sizing: border-box;
}
.fs-pol-opt:active { background: #e5e5ea; }

.fs-pol-opt-label {
  font-size: 15px;
  font-weight: 400;
  color: #000;
  flex: 1;
  letter-spacing: -.4px;
  line-height: 1.3;
}
.fs-pol-opt-price {
  font-size: 15px;
  font-weight: 400;
  color: #8e8e93;
  letter-spacing: -.4px;
}
.fs-pol-opt.is-sel .fs-pol-opt-price { color: #8e8e93; }
.fs-pol-opt-tier {
  font-size: 11px;
  color: #aeaeb2;
  letter-spacing: 0;
}
.fs-pol-opt-sub {
  font-size: 13px;
  color: #8e8e93;
  letter-spacing: -.2px;
}

/* iOS blue checkmark — right side */
.fs-pol-opt-check {
  color: #E8A050;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
  margin-left: 4px;
}

/* ── ACTION BUTTONS ──────────────────────────────────────────── */
.fs-pol-drawer-actions {
  position: sticky;
  bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(242,242,247,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: .5px solid rgba(0,0,0,.12);
  margin-top: 8px;
}
.fs-pol-drawer-confirm {
  width: 100%;
  background: #E8A050;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.3px;
  cursor: pointer;
  touch-action: pan-x pan-y;
  -webkit-tap-highlight-color: transparent;
}
.fs-pol-drawer-confirm:active { background: #c97d35; }
.fs-pol-drawer-danger {
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 400;
  color: #FF3B30;
  letter-spacing: -.4px;
  cursor: pointer;
  touch-action: pan-x pan-y;
  -webkit-tap-highlight-color: transparent;
}
.fs-pol-drawer-danger:active { background: #f2f2f7; }
.fs-pol-opt.is-sel { border-color: rgba(0,0,0,.85); }
.fs-pol-opt-label { font-weight: 700; color: #111; flex: 1; }
.fs-pol-opt-price { font-size: 13px; font-weight: 800; color: rgba(0,0,0,.55); }
.fs-pol-opt-check { color: #1c1a17; font-weight: 800; font-size: 15px; flex-shrink: 0; }

.fs-pol-drawer-confirm {
  width: 100%;
  background: #111;
  color: #fff;
  border: 1px solid #111;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 8px;
  touch-action: pan-x pan-y;
}
.fs-pol-drawer-danger {
  width: 100%;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  border-radius: 12px;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 14px;
  color: #b00020;
  cursor: pointer;
  touch-action: pan-x pan-y;
}

/* ── MOBILE LAYOUT ───────────────────────────────────────────── */
@media (max-width: 767px) {
  .fs-pol-layout {
    flex-direction: column;
  }
  .fs-pol-sidebar {
    display: none !important;
  }
  .fs-pol-cards-container {
    width: 100%;
  }
  .fs-pol-cards {
    grid-template-columns: 1fr !important;
    gap: 10px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
    display: block;
  }
}

/* ── MOBILE LAYOUT OVERRIDE ─────────────────────────────────── */
@media (max-width: 767px) {
  .fs-pol-layout {
    display: block !important;
    width: 100%;
  }
  .fs-pol-cards-container {
    display: block !important;
    width: 100%;
  }
  .fs-pol-cards {
    display: block !important;
    width: 100%;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .fs-pol-card-mobile {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    margin-bottom: 10px;
    box-sizing: border-box;
  }
  .fs-pol-thumb-mobile {
    width: 100%;
    box-sizing: border-box;
  }
  .fs-pol-thumb-mobile canvas {
    display: block !important;
    width: 100% !important;
    height: auto !important;
  }
}

/* ── FORMAT GRID (2 col) ─────────────────────────────────────── */
.fs-pol-fmt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.fs-pol-fmt-grid-cell {
  background: #fff;
  border: 1.5px solid #e5e5ea;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  text-align: left;
  position: relative;
  touch-action: pan-x pan-y;
  -webkit-tap-highlight-color: transparent;
  min-height: 54px;
}
.fs-pol-fmt-grid-cell:active { background: #f2f2f7; }
.fs-pol-fmt-grid-cell.is-sel {
  border-color: #E8A050;
  background: #fff9f3;
}
.fs-pol-fmt-grid-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -.3px;
}
.fs-pol-fmt-grid-price {
  font-size: 12px;
  color: #8e8e93;
}
.fs-pol-fmt-grid-check {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 13px;
  color: #E8A050;
  font-weight: 700;
}
