/* ============================================================
   MIRA HOME — Interactive Product Customizer styles
   File: public/css/product-customizer.css
   ============================================================ */

.mc-dialog { max-width: 760px; }

.mc-content {
  border-radius: 16px;
  border: none;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.mc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  background: var(--bg-section, #faf6f0);
  border-bottom: 1px solid var(--border-light, #e8ddd0);
}
.mc-eyebrow {
  margin: 0 0 .15rem;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-brown-light, #9c8064);
}
.mc-title { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--color-charcoal, #2c1810); }
.mc-close {
  background: none; border: none; font-size: 1.1rem;
  color: var(--color-brown-light, #9c8064); cursor: pointer; line-height: 1;
}

/* overflow-x: hidden is a defensive backstop on small viewports — the
   canvas itself is sized in JS to exactly match its wrapper (see
   sizeCanvasToContainer() in product-customizer.js), but this keeps any
   stray wide child from ever pushing the modal body into horizontal
   scroll/overflow on a narrow phone. */
.mc-body { padding: 1.25rem 1.5rem; max-height: 72vh; overflow-y: auto; overflow-x: hidden; }

.mc-tabs {
  display: flex; gap: .5rem; overflow-x: auto; overflow-y: visible;
  /* FIX (issue: "X is being cropped on the small tile"): overflow-x:auto
     on its own forces overflow-y to auto too (CSS spec behaviour), which
     was clipping the .mc-tab-remove button's -6px top/right offset. Adding
     matching padding here gives that offset room to live inside the
     scroll container's padded box (so overflow-y:auto no longer needs to
     clip anything), and the negative margin cancels the padding back out
     visually so the row doesn't shift position on the page. */
  padding: 10px 14px .35rem 4px;
  margin: -10px -14px .5rem -4px;
  /* Session 06: a reference product now adds up to 8 photo tabs, so the row
     is often wider than the modal. It scrolls sideways INSIDE the modal (the
     body above hides horizontal overflow, so the page never widens); a thin
     scrollbar keeps it from eating into the tiles. */
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.mc-tab {
  flex: 0 0 auto;
  width: 64px; height: 64px;
  border-radius: 10px;
  border: 2px solid var(--border-light, #e8ddd0);
  padding: 0; overflow: hidden; position: relative;
  cursor: pointer; background: #fff;
}
.mc-tab.active { border-color: var(--color-primary-dark, #6b4226); }
.mc-tab img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-tab-badge {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: .55rem; text-align: center; padding: 1px 2px;
  background: rgba(0,0,0,.6); color: #fff;
}

.mc-tabs-actions { margin-bottom: .75rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.mc-upload-btn {
  border: 1.5px dashed var(--border-light, #e8ddd0);
  background: transparent; border-radius: 8px;
  padding: .45rem .9rem; font-size: .82rem; font-weight: 500;
  color: var(--color-primary-dark, #6b4226); cursor: pointer;
}
.mc-upload-btn:hover { background: var(--bg-section, #faf6f0); }

.mc-canvas-wrap {
  position: relative;
  background: repeating-conic-gradient(#f2ede4 0% 25%, #fff 0% 50%) 50% / 20px 20px;
  border-radius: 10px;
  border: 1px solid var(--border-light, #e8ddd0);
  min-height: 240px;
  margin-bottom: 1rem;
  overflow: hidden;
}
/* FIX: canvas is now full-bleed (fills .mc-canvas-wrap entirely) instead of
   being sized/centered to just the product image, so the checkered margin
   the customer sees really is canvas — drawable/writable, not just CSS
   background peeking out from behind a smaller canvas. Width/height are
   set directly as element attributes in JS (sizeCanvasToContainer), so no
   CSS width/height here — that would stretch the pixel buffer. */
#mcCanvas { display: block; touch-action: none; cursor: crosshair; }
.mc-empty-hint { padding: 2.5rem 1rem; text-align: center; color: var(--color-brown-light, #9c8064); font-size: .88rem; }

.mc-brush-cursor {
  position: absolute; top: 0; left: 0;
  border-radius: 50%; box-sizing: border-box;
  pointer-events: none; display: none;
  transform: translate(-9999px, -9999px);
}

.mc-saving-overlay {
  position: absolute; inset: 0; background: rgba(255,255,255,.85);
  display: flex; flex-direction: column; gap: .6rem;
  align-items: center; justify-content: center;
  font-size: .85rem; color: var(--color-charcoal, #2c1810); border-radius: 10px;
}
.mc-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--border-light, #e8ddd0);
  border-top-color: var(--color-primary-dark, #6b4226);
  animation: mc-spin .8s linear infinite;
}
@keyframes mc-spin { to { transform: rotate(360deg); } }

.mc-toolbar {
  display: flex; flex-wrap: wrap; gap: .9rem; align-items: center;
  padding: .65rem .75rem; background: var(--bg-section, #faf6f0);
  border-radius: 10px; margin-bottom: 1rem;
}
.mc-tool-group { display: flex; align-items: center; gap: .35rem; }
.mc-tool {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border-light, #e8ddd0);
  background: #fff; color: var(--color-charcoal, #2c1810); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.mc-tool.active { background: var(--color-primary-dark, #6b4226); color: #fff; border-color: var(--color-primary-dark, #6b4226); }
.mc-tool-text {
  border: none; background: transparent; font-size: .8rem; font-weight: 500;
  color: var(--color-charcoal, #2c1810); cursor: pointer; display: flex; align-items: center; gap: .3rem;
}
.mc-tool-danger { color: #c0392b; }
.mc-colors { padding-left: .5rem; border-left: 1px solid var(--border-light, #e8ddd0); }
.mc-color {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
}
.mc-color.active { border-color: var(--color-charcoal, #2c1810); }
#mcColorCustom { width: 26px; height: 26px; border: none; padding: 0; background: none; cursor: pointer; }
.mc-width-label { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--color-brown-light, #9c8064); }
.mc-tool[disabled] { opacity: .4; cursor: not-allowed; }

.mc-section-label { font-size: .8rem; font-weight: 600; color: var(--color-charcoal, #2c1810); margin-bottom: .4rem; display: block; }

.mc-comments { margin-bottom: 1rem; }
.mc-no-comments { font-size: .8rem; color: var(--color-brown-light, #9c8064); margin: 0; }
.mc-comment-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .5rem; border: 1px solid var(--border-light, #e8ddd0); border-radius: 8px; margin-bottom: .4rem;
}
.mc-comment-num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--color-charcoal, #2c1810); color: #fff;
  font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.mc-comment-text { flex: 1; font-size: .82rem; }
.mc-comment-del { border: none; background: none; color: var(--color-brown-light, #9c8064); cursor: pointer; }
.mc-comment-edit { border: none; background: none; color: var(--color-brown-light, #9c8064); cursor: pointer; }
.mc-comment-edit:hover, .mc-comment-del:hover { color: var(--color-primary-dark, #6b4423); }

.mc-note-section textarea {
  width: 100%; border: 1px solid var(--border-light, #e8ddd0); border-radius: 8px;
  padding: .6rem .75rem; font-size: .85rem; resize: vertical;
}
.mc-note-hint { font-size: .72rem; color: var(--color-brown-light, #9c8064); margin: .25rem 0 0; }

.mc-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border-light, #e8ddd0); background: #fff; gap: 1rem;
}
.mc-fee { font-size: .82rem; font-weight: 600; color: var(--color-primary-dark, #6b4226); }
.mc-footer-btns { display: flex; gap: .6rem; }
.mc-btn-cancel {
  border: 1px solid var(--border-light, #e8ddd0); background: #fff; border-radius: 8px;
  padding: .55rem 1.1rem; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.mc-btn-save {
  border: none; background: var(--color-primary-dark, #6b4226); color: #fff; border-radius: 8px;
  padding: .55rem 1.3rem; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.mc-btn-save:disabled { opacity: .6; cursor: not-allowed; }

.mc-preview-badge {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .7rem; border: 1px solid var(--border-light, #e8ddd0); border-radius: 10px;
  margin-top: .5rem; background: var(--bg-section, #faf6f0);
}
.mc-preview-badge img { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; }
.mc-preview-badge-text { font-size: .78rem; color: var(--color-charcoal, #2c1810); flex: 1; }
.mc-preview-badge-remove { border: none; background: none; color: #c0392b; cursor: pointer; font-size: .9rem; }

@media (max-width: 576px) {
  .mc-header { padding: 1rem 1.1rem .85rem; }
  .mc-body { padding: 1rem 1.1rem; }
  .mc-toolbar { gap: .5rem; padding: .55rem .6rem; }
  /* Session 06 (found while checking 320px): the first group holds 8 tool
     buttons, wider than a 320px phone's modal — the last one (Add image
     overlay) was cut off by the body's overflow-x:hidden. Letting a group
     wrap puts it on a second line instead. */
  .mc-tool-group { flex-wrap: wrap; }
  .mc-colors { padding-left: 0; border-left: none; }
  .mc-tool { width: 32px; height: 32px; font-size: .92rem; }
  /* FIX (direct user ask: "make the inside of the modal more nice to
     smaller devices"): the fee text + Cancel/Save buttons used to sit on
     one row (space-between), which on a narrow phone squeezed the two
     buttons down until their labels nearly touched. Stacking the fee
     above a full-width button row reads far more comfortably at this
     width. */
  .mc-footer {
    flex-direction: column;
    align-items: stretch;
    padding: .85rem 1.1rem;
    gap: .6rem;
  }
  .mc-fee { text-align: center; }
  .mc-footer-btns { width: 100%; }
  .mc-btn-cancel, .mc-btn-save { flex: 1 1 0; }
}

.mc-render-note {
  display: inline-block; font-size: .8rem; font-style: italic;
  color: var(--color-brown-light, #9c8064);
}
.mc-render-interactive {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; color: var(--color-brown-light, #9c8064);
}
.mc-render-thumb {
  width: 32px; height: 32px; border-radius: 6px; object-fit: cover;
  cursor: pointer; border: 1px solid var(--border-light, #e8ddd0);
}
.mc-render-label { font-style: italic; }
.mc-render-view {
  border: none; background: none; padding: 0; margin: 0;
  color: var(--color-primary-dark, #6b4226); font-weight: 600; cursor: pointer;
  text-decoration: underline; font-size: .8rem;
}

/* Uniform "clickable product image" affordance (Part F) — same class,
   same rule as admin-pages.css's .mira-clickable-img, applied to every
   customer-facing product thumbnail (My Orders, Track Order) so ordinary
   and customized-order photos behave identically and always signal
   they open a larger view via #mcLightbox (see customization-render.js). */
.mira-clickable-img {
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.mira-clickable-img:hover {
  transform: scale(1.04);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}

/* FIX (lightbox polish): this used to be a bare white box with no
   border/elevation and a plain "×" floating in the corner — it read as
   disconnected from the rest of the redesigned pages instead of like a
   proper card. Now: a real border + layered shadow for elevation, a
   softer backdrop with a slight blur, and a proper circular close
   button matching the icon-button treatment used elsewhere in the app. */
.mc-lightbox {
  display: none; position: fixed; inset: 0; background: rgba(24,18,12,.72);
  z-index: 3000; align-items: center; justify-content: center; padding: 2rem;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.mc-lightbox.open { display: flex; }
.mc-lightbox-inner {
  /* FIX (issue: "two customized images mixed together and overlapping,
     not showing properly"): this used to be sized for exactly one image.
     A customization can now include several customer-annotated images
     (see .mc-lightbox-gallery below), so it needs more room. */
  /* FIX (direct user ask: "I want customization preview to be bigger") —
     widened from 800px so the gallery tiles below (see .mc-lightbox-tile
     img) have room to render noticeably larger. */
  background: #fff; border-radius: 18px; max-width: 960px; width: 100%;
  max-height: 85vh; overflow-y: auto; padding: 1.5rem; position: relative;
  border: 1px solid var(--border-light, #e8ddd0);
  box-shadow: 0 24px 60px rgba(24,18,12,.32), 0 6px 18px rgba(24,18,12,.16);
}
/* A single plain product photo (no customization gallery, no meta/
   comments) doesn't need the full 800px canvas — without this, the box
   stayed wide while the image itself stayed small, leaving it "swimming"
   in excess whitespace. See .mc-lightbox-single below.
   FIX (direct user ask: "make it a bit smaller, since now they are
   scrollable, what I want is they will just fit") — pulled back down
   along with the full gallery width above and .mc-lightbox-single img's
   cap below, just enough that a plain product photo no longer needs the
   inner scrollbar on a typical viewport.
   FIX (direct user ask: "I want the before main image like with frame,
   all I wanted was to make it bigger") — this compact single-photo card
   (used for cart/checkout/product thumbnails and any other plain photo,
   see the plain-image branch in customization-render.js) was still
   noticeably smaller than the multi-image gallery card next to it.
   Widened back up so the frame itself has more room to grow, alongside
   .mc-lightbox-single img's taller cap below. */
.mc-lightbox-inner.mc-lightbox-inner--compact { max-width: 720px; }
.mc-lightbox-inner img { width: 100%; border-radius: 10px; display: block; margin-bottom: .9rem; }
.mc-lightbox-comments { font-size: .85rem; color: var(--color-charcoal, #2c1810); }
.mc-lightbox-comments > div { margin-bottom: .4rem; }
.mc-lightbox-comments-title { font-weight: 600; margin-bottom: .4rem; }
.mc-lightbox-note { color: var(--color-brown-light, #9c8064); }
/* FIX (correction round, item 4 — lightbox visual consistency): a real
   title bar, same "title bar + framed image + close X" layout as admin's
   image lightbox (viewOrderThumb()/#adminOrderImgModal — see
   views/admin/orders.ejs), instead of a bare "×" floating over the image.
   Built at runtime by customization-render.js#ensureHeaderEl, which
   relocates this exact .mc-lightbox-close button into it — same button,
   new position, no page HTML touched. Negative side/top margins bleed the
   bar to .mc-lightbox-inner's own edges so it reads as a real header row
   rather than more inset content. */
.mc-lightbox-header {
  display: flex; align-items: center; gap: .75rem;
  margin: -1.5rem -1.5rem 1.25rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light, #e8ddd0);
}
/* FIX (correction round: center the product name) — an invisible spacer
   the same size as the close button (see ensureHeaderEl in
   customization-render.js) balances it out, so flex:1 + text-align:center
   centers the title against the bar's full width, not just the space
   left over after the button. */
.mc-lightbox-header-spacer {
  width: 34px; flex-shrink: 0;
}
.mc-lightbox-title {
  flex: 1 1 auto; min-width: 0;
  margin: 0;
  font-size: 1.05rem; font-weight: 600; color: var(--color-charcoal, #2c1810);
  text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mc-lightbox-close {
  position: static; flex-shrink: 0;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: none; background: var(--bg-section, #faf6f0); border-radius: 50%;
  font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--color-charcoal, #2c1810);
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.mc-lightbox-close:hover {
  background: var(--color-primary, #c8956c); color: #fff; transform: scale(1.06);
}

/* Single plain-photo mode (see customization-render.js's plain-image
   fallback) — a centered image on its own light-gray "frame," same
   backdrop admin's lightbox sets behind its image, sized to its own
   content instead of stretched across a multi-column grid meant for
   customization galleries. The name lives in the title bar above now
   (see ensureHeaderEl), not a caption underneath. */
.mc-lightbox-single {
  display: flex; flex-direction: column; align-items: center;
  background: #f5f5f5; border-radius: 10px; padding: 1.25rem;
}
.mc-lightbox-single img {
  /* Bigger frame (direct user ask, see .mc-lightbox-inner--compact above)
     — raised from 62vh so the photo itself, not just the surrounding
     card, actually grows. */
  width: auto; max-width: 100%; max-height: 72vh; margin: 0;
  border-radius: 6px; object-fit: contain;
}

/* ── Multi-image customization gallery (cart, checkout, wishlist, shop,
   home, product-detail, order-confirmation — all share #mcLightbox and
   are populated dynamically by customization-render.js) ── */
.mc-lightbox-meta {
  font-size: .82rem; color: var(--color-brown-light, #9c8064);
  margin-bottom: .9rem; line-height: 1.5;
}
.mc-lightbox-gallery-title {
  font-weight: 600; font-size: .85rem; color: var(--color-charcoal, #2c1810);
  margin-bottom: .5rem; display: flex; align-items: center; gap: .4rem;
}
/* FIX (issue: "preview image stuck in the top-left corner of a mostly
   empty box"): auto-fill creates as many 170px+ tracks as fit the
   container's width REGARDLESS of how many tiles actually exist — with
   only one image (the common case), that leaves 3-4 empty phantom
   columns claiming the rest of the row, stranding the one real tile in
   the first cell. auto-fit collapses those empty tracks instead, so the
   single tile's 1fr share expands to fill the whole row; with several
   images it still wraps into a normal multi-column grid exactly as
   before, since auto-fit and auto-fill only differ when there ARE empty
   tracks to collapse. */
.mc-lightbox-grid {
  /* FIX (direct user ask: "I want customization preview to be bigger") —
     wider minimum tile so each design image (see .mc-lightbox-tile img
     below) renders larger, not just taller. */
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .65rem; margin-bottom: 1rem;
}
.mc-lightbox-grid--sm { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.mc-lightbox-item { display: block; }
.mc-lightbox-tile {
  display: block; border: 1px solid var(--border-light, #e8ddd0); border-radius: 8px;
  overflow: hidden; background: #fff;
}
.mc-lightbox-tile img {
  /* FIX (direct user ask: "image modals of customized items might be
     smaller??? ensure they are all the same") — this was a flat 420px
     regardless of viewport, noticeably smaller than the plain-photo
     path's 62vh (.mc-lightbox-single img below), which is what made a
     customized item's preview read as smaller than an ordinary product
     photo's. Now viewport-relative like that path, just scaled down a
     little to leave room for multiple tiles to sit side by side. */
  width: 100%; max-height: 55vh; object-fit: contain; display: block;
  margin-bottom: 0; /* override the generic .mc-lightbox-inner img rule above */
}
/* A gallery with only ONE customization image is the common case (most
   customized items carry a single annotated photo) — give it the exact
   same size treatment as the plain-photo path (.mc-lightbox-single img's
   62vh) instead of the smaller multi-tile cap above, since there's no
   grid of siblings it needs to share room with. */
.mc-lightbox-grid:not(.mc-lightbox-grid--sm) .mc-lightbox-item:only-child .mc-lightbox-tile img {
  max-height: 62vh;
}
.mc-lightbox-grid--sm .mc-lightbox-tile img { max-height: 96px; object-fit: cover; aspect-ratio: 1; }
.mc-lightbox-tile-label {
  font-size: .72rem; color: var(--color-brown-light, #9c8064);
  text-align: center; margin-top: .25rem;
}

/* ── Inline customization badge (cart, checkout, order summary) ── */
.mc-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; line-height: 1.4;
  background: var(--color-primary-xlight, #f5ede2);
  color: var(--color-primary-dark, #6b4226);
  border: 1px solid var(--color-primary-light, #d4b896);
  max-width: 100%;
}
/* FIX (issue: "in cart/checkout the word 'file' is visible but the last
   letter 'e' is cropped"): text-overflow:ellipsis used to sit on .mc-badge
   itself, which is an inline-flex box mixing a separate <i> icon element
   with a raw text node — ellipsis truncation doesn't reliably apply
   across sibling elements like that, so the container's edge just hard-
   clipped whichever pixel/letter happened to land there instead of
   showing "…". Giving the label its OWN element (see .mc-badge-label,
   inserted by customization-render.js) with `min-width: 0` (required for
   a flex child to actually be allowed to shrink and truncate at all) and
   its own overflow/ellipsis rules fixes this with a proper "…" instead
   of a chopped-off letter, and keeps the icon from ever being clipped. */
.mc-badge-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.mc-badge i { flex-shrink: 0; }
.mc-badge--note {
  background: var(--bg-section, #faf6f0);
  color: var(--color-brown-light, #9c8064);
  border-color: var(--border-light, #e8ddd0);
  font-style: italic;
  font-weight: 500;
}
.mc-badge--interactive { cursor: pointer; transition: background .2s, transform .1s; }
.mc-badge--interactive:hover { background: var(--color-primary-light, #d4b896); }
.mc-badge--interactive:active { transform: scale(0.97); }
.mc-badge i { font-size: .85em; }

.qa-customization-preview {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .65rem; background: var(--bg-section, #faf6f0);
  border: 1px solid var(--border-light, #e8ddd0); border-radius: 10px;
}
.qa-customization-preview-actions { display: flex; gap: .35rem; margin-left: auto; }
.qa-customization-preview-actions .btn { padding: .15rem .4rem; font-size: .78rem; }

/* Price Ideas — admin-authored rough cost examples shown in the Quick Add
   modal's Customization section, before the customer opens the customizer.
   Purely informational (see product-form.ejs's Price Idea editor / FIX
   comment) — styled as a quiet reference card, not another price line. */
.qa-price-ideas {
  padding: .55rem .7rem;
  background: var(--bg-section, #faf6f0);
  border: 1px solid var(--border-light, #e8ddd0);
  border-radius: 10px;
  margin-bottom: .5rem;
}
.qa-price-ideas-title {
  margin: 0 0 .35rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--color-brown-dark, #6b5642);
  display: flex;
  align-items: center;
  gap: .3rem;
}
.qa-price-ideas-list { display: flex; flex-direction: column; gap: .3rem; }
.qa-price-idea-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  font-size: .82rem;
}
.qa-price-idea-label { color: var(--color-brown-mid, #8a7660); }
.qa-price-idea-value {
  font-weight: 600;
  color: var(--color-primary-dark, #a9784f);
  white-space: nowrap;
}

/* "Open Interactive Customization" in the Quick Add window (user ask, 2026-11-16: it "is not highlighted or emphasized"). It was a
   grey 12px Bootstrap outline button, weaker even than the footer button, yet for Design Your Own it is the step the customer MUST
   do first (quick-add-modal.js validate() refuses without it). Now a full-width 44px brand-colour button: solid for Design Your Own
   (.is-required, set by the script), tinted where customizing is optional so Add to Cart never has a second solid button beside
   it. A standalone class on purpose, not .btn / .btn-outline-secondary: those are shared with other windows. */
.qa-customize-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; min-height: 44px; margin: 0 0 .5rem; padding: .55rem 1rem;
  font-family: inherit; font-size: .9rem; font-weight: 600; line-height: 1.3; text-align: center;
  color: var(--color-brown-dark, #4a3728);
  background: var(--color-primary-xlight, #f5ede0);
  border: 2px solid var(--color-primary-dark, #a8845e);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.qa-customize-btn i { flex-shrink: 0; font-size: 1.05em; color: var(--color-primary-dark, #a8845e); }
.qa-customize-btn:hover { background: var(--color-primary-light, #e8d5bc); }
.qa-customize-btn:focus-visible { outline: 3px solid rgba(200, 168, 130, 0.55); outline-offset: 2px; }
.qa-customize-btn.is-required { color: #fff; background: var(--color-primary-dark, #a8845e); box-shadow: 0 2px 8px rgba(168, 132, 94, 0.35); }
.qa-customize-btn.is-required i { color: #fff; }
.qa-customize-btn.is-required:hover { background: var(--color-brown-mid, #7a5c44); border-color: var(--color-brown-mid, #7a5c44); }
#qaCustomizePriceNote strong { font-weight: 700; color: var(--color-brown-dark, #4a3728); }

/* ── Modal stacking fix ──
   Two Bootstrap modals opened at once (Quick Add -> Interactive
   Customizer) previously fought for the same z-index and the customizer
   rendered *behind* the Quick Add dialog. quick-add-modal.js now hides
   the Quick Add modal before opening this one, but we still pin a
   higher z-index here as a defensive guard for any other flow. */
/* FIX (issue: "chat button blocking the modal / Save button"): the
   site-wide chat launcher (#chat-open-btn in chat-rooms.css) is pinned
   at bottom:24px/right:24px with z-index:9999 !important — well above
   this modal's old z-index:1090, so it rendered on top of .mc-footer's
   Save button in that same bottom-right corner. Pushing the modal (and
   its backdrop) above 9999 restores normal stacking without touching
   chat-rooms.css. */
#miraCustomizerModal { z-index: 10050; }
#miraCustomizerModal + .modal-backdrop,
.modal-backdrop ~ .modal-backdrop { z-index: 10049; }

/* ── Approval notice ── */
.mc-approval-notice {
  display: flex; align-items: flex-start; gap: .4rem;
  background: var(--color-primary-xlight, #f5ede2);
  border: 1px solid var(--color-primary-light, #d4b896);
  color: var(--color-primary-dark, #6b4226);
  border-radius: 10px; padding: .65rem .85rem;
  font-size: .82rem; line-height: 1.45; margin-bottom: 1rem;
}
.mc-approval-notice i { margin-top: .15rem; color: var(--color-primary, #8a5a35); flex-shrink: 0; }
/* FIX (issue 11): the notice text must be wrapped in ONE element (see
   HTML change below) so flexbox treats it as a single item and lets it
   wrap normally as one paragraph, instead of splitting every text run
   around the <strong> tag into its own flex column. */
.mc-approval-notice-text { flex: 1; }

/* ── Full custom order (reference product) section ── */
.mc-fullcustom-section {
  background: var(--bg-section, #faf6f0);
  border: 1px dashed var(--border-light, #e8ddd0);
  border-radius: 10px; padding: .85rem 1rem; margin-bottom: 1rem;
}
.mc-fullcustom-hint { font-size: .8rem; color: var(--color-brown-light, #9c8064); margin: .15rem 0 .65rem; line-height: 1.4; }
.mc-select {
  width: 100%; padding: .55rem .7rem; border-radius: 8px;
  border: 1px solid var(--border-light, #e8ddd0); background: #fff;
  font-size: .88rem; color: var(--color-charcoal, #2c1810);
  max-height: 260px; overflow-y: auto;
}
.mc-select:focus { outline: none; border-color: var(--color-primary, #8a5a35); }
.mc-field-label { display: block; font-size: .75rem; font-weight: 600; color: var(--color-charcoal, #2c1810); margin-bottom: .25rem; }

/* "Use an existing product as a starting point?" (user ask, 2026-11-16: the important text must be emphasized). It was a 12px
   label over a select with a faint border, easy to miss. Now a white callout with a brand-colour edge, a 14.7px bold label with
   an icon, and a 2px select at least 44px high. Scoped to #mcRefProductPicker: .mc-field-label and .mc-select are shared with
   the Size / Materials / Color fields, which stay as they were. The two <strong> phrases of the hint above it are styled by
   class, so the hint the script writes when the customizer opens from a product's own card matches the default one. */
.mc-fullcustom-hint strong { font-weight: 700; color: var(--color-brown-dark, #4a3728); }
#mcRefProductPicker {
  padding: .7rem .8rem;
  background: #fff;
  border: 1px solid var(--color-primary-light, #e8d5bc);
  border-left: 4px solid var(--color-primary-dark, #a8845e);
  border-radius: 8px;
}
#mcRefProductPicker .mc-field-label {
  display: flex; align-items: flex-start; gap: .45rem;
  margin-bottom: .5rem; font-size: .92rem; font-weight: 700; line-height: 1.35;
  color: var(--color-brown-dark, #4a3728);
}
#mcRefProductPicker .mc-field-label i { flex-shrink: 0; margin-top: .12em; color: var(--color-primary-dark, #a8845e); }
#mcRefProductPicker .mc-optional-tag { color: var(--color-brown-light, #b08060); }
#mcRefProductPicker .mc-select {
  min-height: 44px; border: 2px solid var(--color-primary-dark, #a8845e); font-size: .92rem;
}
#mcRefProductPicker .mc-select:focus { border-color: var(--color-brown-mid, #7a5c44); box-shadow: 0 0 0 3px rgba(200, 168, 130, 0.45); }

.mc-ref-note {
  margin: .5rem 0 0; padding: .55rem .75rem;
  background: var(--bg-section, #faf6f0); border-left: 3px solid var(--color-primary, #8a5a35);
  border-radius: 6px; font-size: .78rem; line-height: 1.4;
  color: var(--color-brown-mid, #6b4226);
}

/* ── FIX: X / remove button on customer-added image tabs (uploads and
   reference-product photos). Original product photo tabs never get this
   button — only images the customer added themselves are removable. ── */
/* flex: 0 0 auto — the wrap (not the button inside it) is the flex item of
   .mc-tabs, so this is what keeps a tile at its full 64px when the row is
   full, instead of squeezing every tile to make them all fit. */
.mc-tab-wrap { position: relative; display: inline-block; flex: 0 0 auto; }
.mc-tab-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #b3261e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.mc-tab-remove:hover { background: #8f1d17; }
.mc-tab-remove i { pointer-events: none; }

.mc-upload-hint { font-size: .72rem; color: var(--color-brown-light, #9c8064); margin: -0.4rem 0 .6rem; }

/* ── FIX (new feature): document upload list ── */
.mc-doc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: -0.25rem 0 0.75rem;
}
.mc-doc-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-light, #e8ddd0);
  border-radius: 8px;
  background: var(--bg-section, #faf6f0);
  font-size: 0.8rem;
  max-width: 220px;
}
.mc-doc-chip i.bi-file-earmark-text { color: var(--color-primary-dark, #6b4226); }
.mc-doc-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
  /* FIX (bug: "can't preview a document"): the name is now a real link
     to the file (see renderDocList()) — reset it to read as chip text,
     not a default blue/underlined browser link, with an underline only
     on hover/focus as the clickability hint. */
  color: inherit;
  text-decoration: none;
}
a.mc-doc-name:hover,
a.mc-doc-name:focus-visible {
  text-decoration: underline;
}
.mc-doc-size { color: #8a8a8a; font-size: 0.72rem; flex-shrink: 0; }
.mc-doc-remove {
  border: none;
  background: transparent;
  color: #b3261e;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0;
  margin-left: 0.15rem;
  flex-shrink: 0;
}
.mc-doc-remove:hover { color: #8f1d17; }

/* ── Size / Materials / Color fields ── */
.mc-detail-fields { margin-bottom: 1rem; }
.mc-optional-tag { font-weight: 400; color: #000; font-size: .75rem; }
.mc-fields-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem;
}
@media (max-width: 560px) { .mc-fields-grid { grid-template-columns: 1fr; } }
.mc-field input {
  width: 100%; padding: .5rem .65rem; border-radius: 8px;
  border: 1px solid var(--border-light, #e8ddd0); font-size: .85rem;
}
.mc-field input:focus { outline: none; border-color: var(--color-primary, #8a5a35); }
