/* ==========================================================================
   The wardrobe — makes the shop match the home "Now hanging" rail:
   product page stage, Front / Back, product cards that turn round, colour
   dots, category buttons, and the garment carrying over from page to page.
   Markup comes from inc/wardrobe.php, parts/product-card.php and
   woocommerce/single-product/product-image.php.
   ========================================================================== */

:root { --cvm-ease: cubic-bezier(.2, .8, .2, 1); }

/* --- the taka sign (৳) in prices: a 740-byte font with just that sign, instead
       of the 39 KB Bengali subset (same family name, declared later, so it wins) --- */
@font-face {
  font-family: 'Bengali Taka';
  src: url('../fonts/taka.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0980-09FF, U+200C-200D;
}

/* --- WhatsApp button: pulses three times to be noticed, then rests (a pulse
       that never stops keeps the whole screen redrawing); out of the way while
       the menu is open --- */
.wa::after { animation-iteration-count: 3; }
body:has(#drawer.is-open) .wa { opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
/* checkout on phones: the bubble sat on top of the form (District arrow, phone
   number, Place order) — the footer still has WhatsApp (7 Nov 2026) */
@media (max-width: 860px) { body.woocommerce-checkout .wa { display: none; } }

/* --- limited-run dot pulses only while the panel is on screen (wardrobe.js) --- */
.cvm-limited__pulse::after { animation-play-state: paused; }
.cvm-limited.is-live .cvm-limited__pulse::after { animation-play-state: running; }

/* --- Front / Back switch on the product page stage ------------------------ */
.cvm-sides {
  display: inline-flex; gap: 4px; padding: 4px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper);
}
.cvm-sides button {
  border: 0; background: none; margin: 0; padding: 8px 18px; border-radius: 999px;
  font: inherit; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; line-height: 1.2;
  color: var(--muted); cursor: pointer; transition: background .3s, color .3s;
}
.cvm-sides button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* --- the home rail ("Now hanging", parts/showroom.php): round arrows, the
       counter and the drawn garments --- */
.cvmr-round {
  width: 42px; height: 42px; margin: 0; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: border-color .3s, background .3s;
}
.cvmr-round:hover { border-color: var(--ink); }
.cvmr-count { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 15px; color: var(--muted); }
.cvmr-count b { color: var(--ink); font-weight: 400; font-size: 18px; }
.cvmr-count i { width: 26px; height: 1px; background: var(--gold); }
.cvmr-svg { display: block; width: 100%; height: auto; overflow: visible; }

/* --- the owner's own photos: the drawings are only a placeholder. Once a
       product has photos they are used on the rail and the cards, with the
       same movements --- */
.cvmr-photo { display: block; width: 100%; height: auto; }
.cvmr-fig .cvmr-hanger { display: block; }
.cvmr-fig .cvmr-hanger svg { display: block; width: 100%; height: auto; overflow: visible; }
.cvmr-fig .cvmr-photo { object-fit: cover; margin-top: -3px; background: var(--paper-2); }
.cvm .card__drawn {
  display: grid; place-items: center; aspect-ratio: 4 / 5;
  background: radial-gradient(60% 50% at 50% 42%, #fff 0%, rgba(255, 255, 255, 0) 100%), #F7F4EF;
}
.cvm .card__svg { display: block; width: 80%; height: auto; margin-top: -6%; overflow: visible; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .12)); }
.cvm .card.no-back .card__face--back { opacity: 0 !important; }
html.cvm-handoff .woocommerce-product-gallery { visibility: hidden; } /* the arriving photo lands on it */

/* --- product page: the stage ------------------------------------------------ */
.cvm-stage {
  position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; overflow: hidden;
  background: radial-gradient(60% 50% at 50% 42%, #fff 0%, rgba(255, 255, 255, 0) 100%), var(--paper-2);
  touch-action: pan-y; -webkit-user-select: none; user-select: none;
}
.cvm-stage__hang { position: relative; width: min(70%, 460px); margin-top: -8%; }
/* the rod: drawn at the hook, as wide as the stage */
.cvm-stage__hang::before {
  content: ""; position: absolute; left: -100vw; right: -100vw; top: 3.4%; height: 4px; margin-top: -2px; border-radius: 3px;
  background: linear-gradient(180deg, #ECE1C4, var(--gold) 55%, #7d6a45);
  box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .35);
}
.cvm-stage__swing { position: relative; transform-origin: 50% 3.4%; perspective: 1600px; }
.cvm-stage__swing.is-swing { animation: cvmStageSwing 1.5s cubic-bezier(.3, .7, .4, 1); }
@keyframes cvmStageSwing {
  0% { transform: rotate(0); } 18% { transform: rotate(2.2deg); } 40% { transform: rotate(-1.4deg); }
  62% { transform: rotate(.7deg); } 82% { transform: rotate(-.25deg); } 100% { transform: rotate(0); }
}
.cvm-stage__card { position: relative; transform-style: preserve-3d; }
.cvm-stage__face { backface-visibility: hidden; -webkit-backface-visibility: hidden; filter: drop-shadow(0 34px 30px rgba(0, 0, 0, .16)); }
.cvm-stage__face--back { position: absolute; inset: 0; transform: rotateY(180deg); }
.cvm-stage__svg { display: block; width: 100%; height: auto; overflow: visible; }
.cvm-stage .cvm-sides { position: absolute; left: 50%; bottom: clamp(16px, 3vw, 28px); transform: translateX(-50%); }
.cvm-stage__count {
  position: absolute; top: clamp(14px, 2vw, 22px); left: clamp(16px, 2.4vw, 26px); margin: 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 15px; color: var(--muted);
}
.cvm-stage__count b { color: var(--ink); font-weight: 400; font-size: 18px; }
.cvm-stage__count i { width: 26px; height: 1px; background: var(--gold); }

/* --- product page: the stage with the owner's photos (one photo at a time,
       Front / Back, the magnifier). The stage is painted in the photos' own
       backdrop colour (wardrobe.js reads it from the photo), so a turn shows
       the garment turning, not the edge of a picture --- */
.cvm-stage--photo {
  --stage-bg: #F1ECE5;
  display: block; place-items: normal; aspect-ratio: auto; overflow: visible; background: none; -webkit-touch-callout: none;
}
.cvm-stage__frame {
  position: relative; overflow: hidden; aspect-ratio: 1; background: var(--stage-bg);
  border-radius: var(--r-md, 6px); cursor: zoom-in;
}
.cvm-stage--photo .cvm-stage__hang { width: 100%; height: 100%; margin: 0; }
.cvm-stage--photo .cvm-stage__hang::before { content: none; }
.cvm-stage--photo .cvm-stage__swing { height: 100%; perspective: 2400px; }
.cvm-stage--photo .cvm-stage__card { height: 100%; }
.cvm-stage--photo .cvm-stage__face { position: absolute; inset: 0; filter: none; }
/* the photo's own edge fades into the backdrop (no seam while it turns, or
   around it full size) */
.cvm-stage__img, .cvm-zoom__img {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
  mask-composite: intersect;
}
.cvm-stage__img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none; user-select: none;
}
.cvm-stage--photo .cvm-stage__count { z-index: 2; }
/* Front / Back under the photo (over it, it hid the hem) */
.cvm-stage--photo .cvm-sides { position: static; transform: none; display: flex; width: max-content; margin: 14px auto 0; }
.cvm-sides button:disabled { opacity: .35; cursor: default; }
.cvm-stage__zoom {
  position: absolute; top: clamp(12px, 2vw, 18px); right: clamp(12px, 2vw, 18px); z-index: 2;
  width: 42px; height: 42px; margin: 0; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--ink);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .25); cursor: zoom-in; transition: transform .25s var(--cvm-ease);
}
.cvm-stage__zoom:hover { transform: scale(1.06); }
.cvm-stage__zoom:focus-visible, .cvm-zoom__close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* the photo full size (wardrobe.js) */
html.cvm-zoom-open { overflow: hidden; }
.cvm-zoom {
  --stage-bg: #F1ECE5;
  position: fixed; inset: 0; z-index: 2147482000; background: var(--stage-bg);
  animation: cvmZoomIn .25s ease both;
}
.cvm-zoom.is-out { animation: cvmZoomOut .2s ease both; }
@keyframes cvmZoomIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cvmZoomOut { from { opacity: 1; } to { opacity: 0; } }
.cvm-zoom__pane {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  padding: calc(64px + env(safe-area-inset-top, 0px)) 16px calc(64px + env(safe-area-inset-bottom, 0px));
  cursor: zoom-in; overscroll-behavior: contain; scrollbar-width: none;
}
.cvm-zoom__pane::-webkit-scrollbar { display: none; }
.cvm-zoom__img { display: block; flex: none; max-width: 100%; max-height: 100%; width: auto; height: auto; -webkit-user-drag: none; user-select: none; }
.cvm-zoom.is-zoomed .cvm-zoom__pane { display: block; padding: 0; overflow: auto; cursor: zoom-out; }
.cvm-zoom.is-zoomed .cvm-zoom__img { max-width: none; max-height: none; -webkit-mask-image: none; mask-image: none; }
.cvm-zoom__close {
  position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 16px; z-index: 1;
  width: 46px; height: 46px; margin: 0; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--ink); cursor: pointer;
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .3);
}
.cvm-zoom__hint {
  position: absolute; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); margin: 0; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); pointer-events: none;
  transition: opacity .3s;
}
.cvm-zoom.is-zoomed .cvm-zoom__hint { opacity: 0; }

/* --- product page: arriving from a product card, the home rail or the
       limited panel. The head script (inc/wardrobe.php) puts the paper
       background and the garment (#cvmHandoff, inline styles) exactly where they
       were; wardrobe.js then glides the garment onto the rod while the page fades
       in around it. Works in every browser. The real garment waits underneath. --- */
html.cvm-handoff .cvm-stage__card { visibility: hidden; }

/* --- product page: information column ------------------------------------ */
.cvm.single-product .cv-product__info > .cv-eyebrow {
  display: block; font-size: 11px; font-weight: 500; letter-spacing: .24em; color: var(--gold-text);
}
.cvm.single-product .cv-product__info > .cv-eyebrow::before {
  content: ""; display: inline-block; width: 28px; height: 1px; margin-right: 12px;
  vertical-align: middle; background: currentColor; opacity: .7;
}
.cvm.single-product .cv-product__title { font-size: clamp(32px, 3.4vw, 50px); line-height: 1.05; }
.cvm.single-product .cv-product .cv-swatches { gap: 12px; }
/* the colour is painted inside a 3px gap only (content-box), never under the
   ring: painting it under the ring and covering it with an inset shadow let the
   colour leak through at the rounded edge (dirty, uneven ring on dark colours) */
.cvm.single-product .cv-product .cv-swatch {
  width: 34px; height: 34px; padding: 3px; border: 1px solid var(--line-strong); outline: 0;
  background: var(--swatch, #757575) content-box; background-clip: content-box;
  box-shadow: none; transition: box-shadow .25s, border-color .25s, transform .2s;
}
.cvm.single-product .cv-product .cv-swatch[aria-checked="true"] {
  border-color: var(--ink); outline: 0;
  box-shadow: 0 0 0 1px var(--ink);
}

/* --- product cards: drawn garments turn round, photos cross-fade ------------- */
.cvm .card__flags, .cvm .card__quick { z-index: 4; }
/* no blue tap flash on phones: it is drawn over everything, even the garment
   carried to the product page */
.cvm .card a, .cvm-limited a, .cvmr-btn, .cvmr-open { -webkit-tap-highlight-color: transparent; }
.cvm .card__link { display: block; perspective: 1400px; }
.cvm .card__turn { position: relative; display: block; transform-style: preserve-3d; transition: transform .7s var(--cvm-ease); }
.cvm .card__face { display: block; }
/* a drawn face stays a grid: as a block, its drawing's negative top margin leaked out
   of the card (picture 20px short, top cut off, back drawn higher than the front) */
.cvm .card__face.card__drawn { display: grid; }
.cvm .card__face--back { position: absolute; inset: 0; }
.cvm .card--garment .card__face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cvm .card--garment .card__face--back { transform: rotateY(180deg); }
.cvm .card--has-back:not(.card--garment) .card__face--back { opacity: 0; transition: opacity .6s var(--cvm-ease); }
/* only the picture itself turns to the back: hovering the colour dots, the name
   or the price keeps the front, so a colour dot shows that colour's front */
@media (hover: hover) {
  .cvm .card--garment.card--has-back .card__media:hover .card__turn { transform: rotateY(180deg); }
  .cvm .card--garment:hover .card__img { transform: none; }
  .cvm .card--has-back:not(.card--garment) .card__media:hover .card__face--back { opacity: 1; }
}
/* phones: touch and hold shows the back the same way (wardrobe.js adds .is-peek);
   no callout menu, text selection or image dragging over the picture meanwhile */
.cvm .card--garment.card--has-back.is-peek .card__turn { transform: rotateY(180deg); }
.cvm .card--has-back:not(.card--garment).is-peek .card__face--back { opacity: 1; }
.cvm .card__media { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.cvm .card__media img { -webkit-user-drag: none; }

/* colour dots under the price */
.cvm .card__dots { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0 -4px; }
.cvm .card__dot {
  position: relative; width: 24px; height: 24px; margin: 0; padding: 0;
  border: 1px solid transparent; border-radius: 50%; background: none; cursor: pointer;
  transition: border-color .25s;
}
.cvm .card__dot::before {
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  background: var(--dot); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .16);
  transition: transform .2s;
}
.cvm .card__dot:hover::before { transform: scale(1.1); }
.cvm .card__dot[aria-pressed="true"] { border-color: var(--ink); }

/* --- category buttons on the shop and category pages ------------------------ */
.cvm .cvm-tabs {
  position: relative; display: flex; flex-wrap: nowrap; gap: clamp(20px, 3vw, 40px);
  width: max-content; max-width: 100%; margin: 6px 0 clamp(22px, 3vw, 34px);
  overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line);
}
.cvm .cvm-tabs::-webkit-scrollbar { display: none; }
.cvm .cvm-tab {
  position: relative; flex: 0 0 auto; padding: 12px 2px 13px;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; line-height: 1;
  color: var(--muted); text-decoration: none; transition: color .3s;
}
.cvm .cvm-tab sup {
  position: relative; top: -.55em; vertical-align: baseline; margin-left: 6px;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0; color: var(--gold-text);
}
.cvm .cvm-tab:hover, .cvm .cvm-tab[aria-current="page"] { color: var(--ink); }
.cvm .cvm-tabs__bar {
  position: absolute; left: 0; bottom: 0; width: 0; height: 1px; background: var(--ink);
  pointer-events: none;
}
.cvm .cvm-tabs.is-ready .cvm-tabs__bar { transition: transform .6s var(--cvm-ease), width .6s var(--cvm-ease); }

@media (max-width: 860px) {
  .cvm-stage__hang { width: min(66%, 340px); }
  .cvm-sides button { padding: 8px 16px; }
}

/* --- checkout with an empty bag (WooCommerce's block): centred, in the site's style --- */
.cvm .wc-block-checkout-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(40px, 7vw, 96px) 16px clamp(48px, 8vw, 110px);
}
.cvm .wc-block-checkout-empty__image { width: 52px; height: 52px; max-width: none; margin: 0 0 22px; fill: var(--gold); color: var(--gold); }
.cvm .wc-block-checkout-empty__title {
  display: block; margin: 0 0 12px; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(26px, 3vw, 36px); line-height: 1.15; color: var(--ink);
}
.cvm .wc-block-checkout-empty__description { max-width: 46ch; margin: 0 auto 30px; color: var(--ink-soft); line-height: 1.7; }
.cvm .wc-block-checkout-empty .wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; padding: 16px 36px;
  border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: #fff; text-decoration: none;
  font-size: 11.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; line-height: 1;
  transition: background .25s, border-color .25s, color .25s;
}
.cvm .wc-block-checkout-empty .wp-block-button__link:hover { background: var(--gold); border-color: var(--gold); color: var(--night); }
