/* custom-bundle.css (v1.7)
   RTL + برند نارنجی (#EA5B0C) + local IRANYekan fallback
*/

/* Variables */
:root{
  --brand: #EA5B0C;
  --brand-700: #c44c0a;
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #111111;
  --muted: #8d8d8d;
  --line: #e9e9e9;
  --font: 'IRANYekan', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* Container */
#bundle-builder.bundle-theme{
  background: var(--bg);
  color: var(--ink);
  padding: 28px;
  box-sizing: border-box;
  direction: rtl;
  font-family: var(--font);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Filterbar */
.bundle-filterbar { text-align: center; margin-bottom: 12px; }
.bundle-filterbar select, .bundle-filterbar input[type="search"] {
  padding:8px 10px; border-radius:8px; border:1px solid var(--line);
  background:#fff; font-weight:700;
  font-family: var(--font) !important;
}

/* Header */
.bundle-header{ text-align:center; margin-bottom:18px; }
.bundle-title{ font-size:28px; margin:0 0 6px; font-weight:700; }
.bundle-price{
  font-size:22px; font-weight:800; color:var(--brand);
  display:inline-block; padding:12px 20px; border-radius:10px;
  background: rgba(234,91,12,0.06);
}

/* Size selection */
.section-title{ text-align:center; font-size:16px; margin:0 0 6px; }
.bundle-size-section{ text-align:center; margin-bottom:20px; }

.bundle-options{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px; margin:12px 0;
}
@media (min-width: 768px){
  .bundle-options{ grid-template-columns: repeat(2, 1fr); }
}

.bundle-btn{
  background:#fff; color:#111; border:1px solid rgba(255,255,255,0.06);
  padding:12px 14px; border-radius:12px; cursor:pointer; text-align:center;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease, border-color .12s ease;
  display:flex; flex-direction:column; justify-content:center; gap:6px;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
}
.bundle-btn .btn-label{ font-weight:700; font-size:15px; line-height:1.4; }
.bundle-btn .btn-note{ font-size:13px; color:#111; line-height:1.6; }
.bundle-btn:hover{ transform: translateY(-2px); }
.bundle-btn.active{
  background:var(--brand); color:#fff; border-color:transparent;
  box-shadow: 0 8px 30px rgba(234,91,12,0.18);
}
.bundle-btn .btn-note.active{
    color:#fff !important;
}
/* main layout */
.bundle-main{ display:flex; gap:20px; align-items:flex-start; justify-content:space-between; margin-top:12px; }

/* product grid */
.product-list{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:20px; flex:1 1 720px;
}

/* product card */
.product{
  background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px; text-align:center; position:relative; overflow:visible;
}
.thumb{ position:relative; border-radius:10px; overflow:hidden; background:#fafafa; }
.product img{ display:block; width:100%; height:180px; object-fit:contain; }
.product-title{ margin:10px 0 10px; font-size:15px; font-weight:700; min-height:36px; }

/* overlay on image (hidden by default) */
.info-overlay{
  display:flex; flex-direction:column; align-items:flex-start;
  position:absolute; inset:8px; border-radius:10px; padding:14px;
  background:rgba(20,20,20,0.9); color:#fff; z-index:30; opacity:0; transform: translateY(-6px) scale(.99);
  pointer-events:none; transition: opacity .18s ease, transform .18s ease;
}
.info-overlay.open{ opacity:1; transform: translateY(0) scale(1); pointer-events:auto; }
.info-overlay .close-overlay{
  position:absolute; top:8px; left:10px; background:transparent; border:0; color:#fff; font-size:20px; cursor:pointer;
}
.overlay-title{ font-size:16px; margin-bottom:8px; font-weight:800; }
.overlay-text{ font-size:13px; line-height:1.6; opacity:.95; }

/* qty box (centered) */
.qty-box{
  display:grid; grid-template-columns: 44px 1fr 44px; align-items:center; justify-items:center; gap:8px; margin:8px 0 6px;
}
.qty-btn{
  width:44px; height:44px; border-radius:10px; background:var(--brand); color:#fff; border:0; font-size:20px; display:grid; place-items:center; cursor:pointer; transition:background .12s;
}
.qty-btn:hover{ background:var(--brand-700); }
.qty-box input{
  width:64px; height:40px; border-radius:10px; border:1px solid var(--line); font-weight:700; display:grid; place-items:center; background:#fff;
  accent-color: var(--brand);
}

/* view details */
.view-details{
  display:inline-block; margin-top:6px; background:transparent !important; border:0 !important;
  color:var(--brand); text-decoration:none; cursor:pointer; padding:0; font-weight:700; box-shadow:none !important; outline: none;
}
.view-details:hover{ color:var(--brand-700); }
.view-details:focus{ outline: none; box-shadow: none; }

/* sidebar */
.actions-panel{
  width:320px; min-width:260px; border:1px solid var(--line); border-radius:14px; padding:12px; background:#fff; box-shadow:0 6px 26px rgba(0,0,0,.04); height: fit-content; position:sticky; top:20px;
}
.steps{ display:flex; gap:8px; margin-bottom:8px; justify-content:center; }
.step-dot{
  width:36px; height:36px; border-radius:50%; display:grid; place-items:center; border:2px solid #FC7000; color:#FC7000 !important; font-weight:700; cursor:pointer;
  background: transparent;
}
.step-dot.active{ background:#FC7000; color:#fff; }

/* selected list */
.selected-list{ max-height:360px; overflow-y:auto; margin-bottom:10px; }
.selected-list .empty{ padding:18px 6px; color:var(--muted); text-align:center; }
.sel-row{ display:grid; grid-template-columns:52px 1fr auto; align-items:center; gap:8px; background:#fff; border:1px solid var(--line); padding:8px; border-radius:10px; margin-bottom:8px; }
.sel-thumb{ width:52px; height:52px; border-radius:8px; overflow:hidden; background:#f7f7f7; display:grid; place-items:center; }
.sel-thumb img{ width:100%; height:100%; object-fit:contain; }
.sel-name{ font-size:13px; font-weight:700; }
.remove-row{ background:transparent; border:0; color:var(--muted); text-decoration:underline; cursor:pointer; padding:0; margin-top:6px; }
.sel-qty{ display:flex; gap:8px; align-items:center; }
.sel-qty button{ width:34px; height:34px; border-radius:8px; background:var(--brand); color:#fff; border:0; cursor:pointer; transition:background .12s }
.sel-qty button:hover{ background:var(--brand-700); }
.sel-qty .num{ min-width:24px; text-align:center; font-weight:700; }

/* buttons */
.btn-primary{ width:100%; padding:12px; border-radius:12px; background:var(--brand); color:#fff; font-weight:800; border:0; margin-top:8px; cursor:pointer; transition:transform .06s, background .12s; }
.btn-primary:hover{ background:var(--brand-700); transform:translateY(-1px); }

.btn-action{ width:100%; padding:14px; border-radius:12px; background:#111; color:#fff; font-weight:800; border:0; margin-top:10px; opacity:.65; cursor:not-allowed; transition:opacity .12s; }
.btn-action.enabled{ opacity:1; cursor:pointer; }
.btn-action.enabled:hover{ transform:translateY(-1px); }

.link-like{ width:100%; background:transparent; border:0; color:var(--muted); text-decoration:underline; margin-top:8px; cursor:pointer; text-align:center;border-radius: 4px; }

/* mobile */
#mobile-addbar{ display:none; }
@media (max-width:980px){
  .bundle-main{ flex-direction: column-reverse; gap:18px; }
  .actions-panel{ position:relative; width:100%; min-width:auto; top:auto; }
}
@media (max-width:768px){
  #mobile-addbar{ display:flex; align-items:center; justify-content:space-between; gap:8px; position:fixed; left:12px; right:12px; bottom:12px; z-index:9999; background:rgba(255,255,255,0.98); border-radius:12px; padding:8px; box-shadow:0 8px 30px rgba(0,0,0,.15); }
  .mobile-summary #mobile-count{ font-weight:800; font-size:18px; background:var(--brand); color:#fff; width:40px; height:40px; border-radius:50%; display:grid; place-items:center; }
  .mobile-add-btn{ background:#111; border:0; padding:10px 14px; border-radius:10px; color:#fff; font-weight:800; opacity:.65; }
  .mobile-add-btn.enabled{ opacity:1; }
  .mobile-add-btn:disabled{ opacity:.5; cursor:not-allowed; }
}

/* small tweaks */
body .bundle-theme a { color: inherit; }

/* ========== OVERRIDES: Fix unwanted pink / force brand colours ========== */
#bundle-builder {
  --brand: #EA5B0C !important;
  --brand-700: #c44c0a !important;
  --ink: #111111 !important;
}

/* Force buttons/colors inside bundle only (fix selector spacing typo) */
#bundle-builder .bundle-btn,
#bundle-builder .btn-primary,
#bundle-builder .qty-btn,
#bundle-builder .sel-qty button,
#bundle-builder .btn-action,
#bundle-builder .step-dot {
  color: #fff !important;
  border-color: #FC7000 !important;
}

/* default bundle-btn non-active should be dark (not pink) */
#bundle-builder .bundle-btn {
  background: #fff !important;
  color: #111 !important;
}
#bundle-builder .bundle-btn.active {
  background: var(--brand) !important;
  color: #fff !important;
}

/* view-details must remain brand color and transparent background */
#bundle-builder .view-details {
  color: var(--brand) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#bundle-builder .view-details:hover,
#bundle-builder .view-details:focus {
  color: var(--brand-700) !important;
  background: transparent !important;
}

/* overlay background enforce */
#bundle-builder .info-overlay {
  background: rgba(20,20,20,0.9) !important;
  color: #fff !important;
}

/* Ensure add-to-cart button appearance locked */
#bundle-builder .btn-action {
  background: #111 !important;
  color: #fff !important;
}
#bundle-builder .btn-action.enabled {
  background: #111 !important;
  color: #fff !important;
}

/* Cart warning style */
#bundle-cart-warning { font-size:14px; }

/* remove outline/pink from focus anywhere inside bundle */
#bundle-builder *:focus { outline: none !important; }

/* end overrides */



/* === bundle: force step-dot appearance (append this block at EOF) === */

/* اطمینان از وجود رنگ برند */


/* همیشه دورِ دایره‌ها نارنجی باشه و وقتی "پر" شدن، توپر بشن */
#bundle-builder .step-dot {
  border: 2px solid #FC7000 !important;
  color: #FC7000 !important;
  background: transparent !important;
  transition: background .18s ease, color .18s;
}

/* دایره‌ای که کاربر به اون مرحله رسیده (یا دقیقا برابر با تعداد انتخاب شده) توپر بشه */
#bundle-builder .step-dot.filled {
  background: #FC7000 !important;
  color: #fff !important;
}

/* وقتی دکمهِ target انتخاب شده — می‌تونیم یه سایه یا استایل ملایم بدیم */
#bundle-builder .step-dot.active {
  box-shadow: 0 4px 14px rgba(234,91,12,0.12);
}

/* جلوگیری از overrideهای عجیب قالب */
#bundle-builder .step-dot,
#bundle-builder .step-dot * {
  outline: none !important;
}

.bundle-controls {
    order: 0 !important;
}

.product-grid {
    order: 1 !important;
}

.flex-container, .bundle-wrapper, .whatever-parent {
    display: flex;
    flex-direction: column;
}
#bundle-builder .view-details{
  display:inline-block;
  margin-top:8px;
  padding:6px 10px;
  border-radius:8px;
  border:1px solid var(--brand);
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}
