/*
 * Vietnam Jewellery & Gem Fair — interactive floor plan
 *
 * Every rule is scoped under .vws-fp and every class carries a vwsp- prefix,
 * so nothing here can collide with the theme or with Elementor's own classes
 * (.card, .btn, .legend and friends are all taken on a live WordPress site).
 */

.vws-fp{
  --vwsp-ink:#1c1a15;
  --vwsp-ink-soft:#57534a;
  --vwsp-ink-faint:#8c877c;
  --vwsp-gold:#8d2231;
  --vwsp-gold-deep:#6a1623;
  --vwsp-gold-tint:#f3e2e4;
  /* Brass for the visitor's own picks: it has to read clearly against both
     the wine tint of a booked booth and the white of a free one. */
  --vwsp-select:#9a7430;
  --vwsp-paper:#eae7df;
  --vwsp-surface:#fff;
  --vwsp-line:#cbc6bb;
  --vwsp-line-soft:#e3dfd5;
  --vwsp-green:#2f6b4f;
  --vwsp-amber:#8a6410;
  --vwsp-shadow:0 1px 2px rgba(28,26,21,.06),0 8px 24px -16px rgba(28,26,21,.28);

  font-family:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:15px;
  line-height:1.55;
  color:var(--vwsp-ink);
  -webkit-font-smoothing:antialiased;
}
.vws-fp,.vws-fp *,.vws-fp *::before,.vws-fp *::after{box-sizing:border-box}

/* Full-bleed mode. The left offset and width are measured in JS; this only
   lifts the theme's own width cap and keeps a gutter at the page edges. */
.vws-fp.vwsp-full{
  max-width:none;padding-left:clamp(16px,2.5vw,40px);padding-right:clamp(16px,2.5vw,40px);
  /* Breaking out of the content column puts the plan underneath whatever the
     theme has beside it. A sidebar that comes later in the markup then sits on
     top and swallows every click in that strip, even when it is empty and
     invisible. Raising the plan one level fixes that; z-index 1 is low enough
     not to climb over a sticky header. Use layout="contained" instead when the
     theme's sidebar actually has content worth seeing. */
  position:relative;z-index:1
}

/* Neutralise theme styling on the elements we control. */
.vws-fp p,.vws-fp h2,.vws-fp h3,.vws-fp dl,.vws-fp dd,.vws-fp dt{margin:0;padding:0}
.vws-fp button{
  font:inherit;color:inherit;cursor:pointer;margin:0;
  border-radius:2px;text-transform:none;letter-spacing:normal;box-shadow:none;
}
.vws-fp input{font:inherit;color:inherit;margin:0}
.vws-fp button:focus-visible,.vws-fp input:focus-visible,.vws-fp [tabindex]:focus-visible{
  outline:2px solid var(--vwsp-gold);outline-offset:2px
}
.vws-fp .screen-reader-text{
  position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap
}

/* ---------- Heading ---------- */
.vwsp-head{text-align:center;margin-bottom:22px}
.vwsp-title{
  font-family:"Poppins",system-ui,-apple-system,sans-serif;font-weight:700;
  font-size:clamp(1.5rem,4vw,2.4rem);line-height:1.1;color:var(--vwsp-gold-deep);
}
.vwsp-when{
  display:inline-block;margin-top:12px!important;background:var(--vwsp-gold);color:#fff;
  padding:6px 18px;font-size:clamp(.78rem,2.2vw,.9rem);font-weight:500
}

/* ---------- Layout ---------- */
.vwsp-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;align-items:start}
.vws-fp.vwsp-no-rail .vwsp-layout{grid-template-columns:minmax(0,1fr)}
@media (max-width:1080px){ .vwsp-layout{grid-template-columns:minmax(0,1fr)} }
/* Set from the element's measured width, so a narrow theme column collapses
   the rail even on a wide screen. */
.vws-fp.vwsp-narrow .vwsp-layout{grid-template-columns:minmax(0,1fr)}

.vwsp-card{
  background:var(--vwsp-surface);border:1px solid var(--vwsp-line);
  border-radius:3px;box-shadow:var(--vwsp-shadow)
}
.vwsp-pad{padding:16px}
.vwsp-h{font-family:"Poppins",system-ui,-apple-system,sans-serif;font-size:19px;font-weight:500;line-height:1.3}
.vwsp-muted{color:var(--vwsp-ink-faint);font-size:13.5px}
.vwsp-small{font-size:12.5px}
.vwsp-row-between{display:flex;justify-content:space-between;align-items:baseline;gap:10px}

/* ---------- Toolbar ---------- */
.vwsp-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:12px;border-bottom:1px solid var(--vwsp-line-soft)}
.vwsp-search{position:relative;flex:1 1 190px;min-width:0}
.vwsp-search input{
  width:100%;padding:9px 34px 9px 12px;border:1px solid var(--vwsp-line);
  border-radius:2px;background:#fdfcfa;box-shadow:none
}
.vwsp-search button{position:absolute;right:4px;top:50%;transform:translateY(-50%);border:0;background:none;padding:5px 7px;color:var(--vwsp-ink-faint);font-size:13px}
.vwsp-seg{display:flex;border:1px solid var(--vwsp-line);border-radius:2px;overflow:hidden;flex:none}
.vwsp-seg button{border:0;background:#fdfcfa;padding:9px 13px;font-size:13.5px;color:var(--vwsp-ink-soft);border-left:1px solid var(--vwsp-line-soft);white-space:nowrap;border-radius:0}
.vwsp-seg button:first-child{border-left:0}
.vwsp-seg button[aria-pressed="true"]{background:var(--vwsp-gold);color:#fff}
.vwsp-zoomers{display:flex;gap:6px;margin-left:auto}
.vwsp-icon{width:36px;height:36px;border:1px solid var(--vwsp-line);background:#fdfcfa;display:grid;place-items:center;font-size:15px;color:var(--vwsp-ink-soft);flex:none;padding:0}
.vwsp-icon:hover{border-color:var(--vwsp-gold);color:var(--vwsp-gold)}
.vwsp-icon-wide{width:auto;padding:0 12px;font-size:13.5px}

/* ---------- Plan ---------- */
.vwsp-stage{position:relative;background:#fbf9f3;overflow:hidden}
.vwsp-stage::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background-image:linear-gradient(var(--vwsp-line-soft) 1px,transparent 1px),
                   linear-gradient(90deg,var(--vwsp-line-soft) 1px,transparent 1px);
  background-size:28px 28px;opacity:.5
}
/* Height is set directly. aspect-ratio combined with max-height makes the
   browser derive the width back from the clamped height, which shrinks the
   box and leaves a white gap beside it inside the card. */
.vwsp-box{width:100%;height:clamp(420px,72vh,780px)}
@media (max-width:640px){ .vwsp-box{height:clamp(360px,62vh,560px)} }
/* One-column layout: size the plan box from the drawing's own proportions so
   it hugs the image. A fixed height here left a third of the box empty above
   and below the plan on a phone. No max-height, which is what made an earlier
   aspect-ratio attempt shrink the box sideways. */
.vws-fp.vwsp-narrow .vwsp-box{height:auto;aspect-ratio:1536/1024}

#vwsp-plan{display:block;width:100%;height:100%;touch-action:none;cursor:grab;position:relative}
#vwsp-plan.vwsp-dragging{cursor:grabbing}

/* Full screen. The card is a flex column and the plan box takes whatever is
   left after the toolbar and legend, which is the only way to get this right
   when the toolbar wraps to two or three rows on a narrow screen. Subtracting
   a fixed height instead pushed the plan off the bottom of a phone. */
.vws-fp.vwsp-fs .vwsp-plan-card{
  position:fixed;inset:0;z-index:99999;border:0;border-radius:0;margin:0;
  display:flex;flex-direction:column
}
.vws-fp.vwsp-fs .vwsp-box,
.vws-fp.vwsp-fs.vwsp-narrow .vwsp-box{flex:1 1 auto;height:auto;min-height:0;aspect-ratio:auto}
.vws-fp.vwsp-fs .vwsp-toolbar,.vws-fp.vwsp-fs .vwsp-legend{flex:none}

/* booths */
.vwsp-booth rect{stroke:#4a443c;stroke-width:1.1;fill:#fff;transition:fill .12s ease}
.vwsp-booth text{font-family:"Inter",sans-serif;font-size:15px;font-weight:600;fill:var(--vwsp-gold);text-anchor:middle;dominant-baseline:central;pointer-events:none}
.vwsp-booth{cursor:pointer}

/* Product zones are told apart by the colour of the booth code only; the cell
   itself stays white so the fill is free to carry status (booked, on hold,
   selected) without the two readings fighting each other. */
.vwsp-booth.vwsp-z-spirits text{fill:#15548f}

.vwsp-booth:hover rect{fill:#fdf2d9}
.vwsp-booth.vwsp-taken rect{fill:#f3e2e4}
.vwsp-booth.vwsp-taken .vwsp-x{stroke:#6a645a;stroke-width:1.1}
.vwsp-booth.vwsp-taken{cursor:not-allowed}
.vwsp-booth.vwsp-taken:hover rect{fill:#ead0d3}
.vwsp-booth.vwsp-pending rect{fill:#e6efe9}
.vwsp-booth.vwsp-pending .vwsp-x{stroke:var(--vwsp-amber)}
.vwsp-booth.vwsp-picked rect{fill:var(--vwsp-select);stroke:#60491c;stroke-width:1.2}
.vwsp-booth.vwsp-picked text{fill:#fff;font-weight:600}
.vwsp-booth.vwsp-active rect{stroke:var(--vwsp-gold);stroke-width:1.6}
.vwsp-booth.vwsp-dim{opacity:.2}
.vwsp-booth.vwsp-flash rect{fill:#ffe6a8}

/* Zoomed far enough out that a code would be unreadable: drop the text and let
   the cell carry its zone as a tint, so the overview still says something. */
.vws-fp.vwsp-tiny .vwsp-booth text{display:none}
.vws-fp.vwsp-tiny .vwsp-booth.vwsp-z-spirits rect{fill:#e7effa}
.vws-fp.vwsp-tiny .vwsp-booth.vwsp-z-wine rect{fill:#faeef0}
.vws-fp.vwsp-tiny .vwsp-booth.vwsp-taken rect{fill:#e2d4d6}
.vws-fp.vwsp-tiny .vwsp-booth.vwsp-picked rect{fill:var(--vwsp-select)}

.vwsp-arrow{fill:none;stroke:#6a645a;stroke-width:.9}
/* Label sizes are matched to the captions painted out of the drawing, so the
   English ones sit at the same optical weight as the architect's lettering. */
.vwsp-lab{font-family:"Inter",sans-serif;font-weight:700;fill:#1c1a15;letter-spacing:.01em}
.vwsp-lab.vwsp-lab-lg{font-size:23px}
.vwsp-lab.vwsp-lab-md{font-size:16px}
.vwsp-lab.vwsp-lab-sm{font-size:14px;font-weight:400}
/* Declared after .vwsp-lab, and doubled up, so the zone colour wins over the
   generic label colour whatever order the two classes appear in. */
.vwsp-lab.vwsp-zone-lab{fill:#1b7a46;font-weight:700;font-size:13.5px;letter-spacing:.16em}
.vwsp-zone-rule{fill:none;stroke:#1b7a46;stroke-width:1.6;stroke-dasharray:9 6;opacity:.8}


.vwsp-tip{
  position:absolute;pointer-events:none;z-index:5;background:var(--vwsp-ink);color:#fff;
  padding:5px 9px;border-radius:2px;font-size:12.5px;white-space:nowrap;
  opacity:0;transform:translate(-50%,-140%);transition:opacity .1s
}
.vwsp-tip.vwsp-on{opacity:1}

.vwsp-legend{display:flex;flex-wrap:wrap;gap:8px 22px;align-items:center;padding:11px 14px;border-top:1px solid var(--vwsp-line-soft);font-size:13px;color:var(--vwsp-ink-soft)}
.vwsp-legend span{display:inline-flex;align-items:center;gap:8px}
.vwsp-legend .vwsp-hint{color:var(--vwsp-ink-faint)}
.vwsp-legend .vwsp-note{
  padding:2px 10px;border:1px solid var(--vwsp-line);border-radius:99px;
  font-size:12px;color:var(--vwsp-ink-soft)
}
.vwsp-swatch{width:17px;height:17px;border:1px solid #6f6a70;background:#fff;flex:none;position:relative}
/* Both zone swatches stay white, like the cells; the letter inside carries the
   colour, so the key shows exactly what the map shows. */
.vwsp-swatch-spirits,.vwsp-swatch-wine{background:#fff}
.vwsp-swatch-spirits::after,.vwsp-swatch-wine::after{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:700;line-height:1
}
.vwsp-swatch-spirits::after{content:"S";color:#15548f}
.vwsp-swatch-wine::after{content:"W";color:var(--vwsp-gold)}
/* Matches the booked cell fill on the map, which is the wine tint. */
.vwsp-swatch-booked{background:#f3e2e4}
.vwsp-swatch-booked::before,.vwsp-swatch-booked::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(to top right,transparent 46%,#6f6a70 46%,#6f6a70 54%,transparent 54%)
}
.vwsp-swatch-booked::before{transform:scaleX(-1)}
.vwsp-swatch-sel{background:var(--vwsp-select);border-color:#60491c}

/* ---------- Rail ---------- */
.vwsp-rail{display:flex;flex-direction:column;gap:14px}
.vwsp-counts{display:grid;grid-template-columns:repeat(3,1fr);text-align:center}
.vwsp-counts>div{padding:14px 6px;border-left:1px solid var(--vwsp-line-soft)}
.vwsp-counts>div:first-child{border-left:0}
.vwsp-counts b{display:block;font-family:"Poppins",system-ui,-apple-system,sans-serif;font-size:27px;font-weight:500;line-height:1.1}
.vwsp-counts small{font-size:12px;color:var(--vwsp-ink-faint)}
.vwsp-counts .vwsp-ok b{color:var(--vwsp-green)}
.vwsp-counts .vwsp-no b{color:var(--vwsp-gold)}
.vwsp-meter{height:5px;background:var(--vwsp-line-soft);border-radius:99px;overflow:hidden;margin:0 16px 16px}
.vwsp-meter i{display:block;height:100%;background:var(--vwsp-gold)}

.vwsp-detail-id{font-family:"Poppins",system-ui,-apple-system,sans-serif;font-size:34px;line-height:1.05;margin:2px 0 6px}
.vwsp-rows{margin-top:12px;font-size:13.5px}
.vwsp-rows>div{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-top:1px solid var(--vwsp-line-soft)}
.vwsp-rows dt{color:var(--vwsp-ink-faint)}
.vwsp-rows dd{margin:0;text-align:right}
.vwsp-pill{display:inline-block;padding:2px 9px;border-radius:99px;font-size:12px;font-weight:500}
.vwsp-pill-ok{background:#e4efe8;color:var(--vwsp-green)}
.vwsp-pill-no{background:var(--vwsp-gold-tint);color:var(--vwsp-gold)}
.vwsp-pill-hold{background:#e6efe9;color:#2f6b4f}

.vwsp-btn{
  display:block;width:100%;margin-top:14px;padding:11px 14px;
  border:1px solid var(--vwsp-gold);background:var(--vwsp-gold);color:#fff;
  font-weight:500;text-align:center;line-height:1.4
}
.vwsp-btn:hover{background:var(--vwsp-gold-deep);border-color:var(--vwsp-gold-deep)}
.vwsp-btn-ghost{background:transparent;color:var(--vwsp-gold)}
.vwsp-btn-ghost:hover{background:var(--vwsp-gold-tint);color:var(--vwsp-gold-deep)}
.vwsp-btn[disabled]{opacity:.5;cursor:not-allowed}
.vwsp-link{background:none;border:0;padding:0;color:var(--vwsp-gold);font-size:13px;text-decoration:underline;text-underline-offset:2px}

.vwsp-chips{margin-top:12px;max-height:300px;overflow:auto}
.vwsp-chip-group + .vwsp-chip-group{margin-top:14px}
.vwsp-chip-head{
  margin:0 0 7px;font-family:"Inter",sans-serif;font-size:12px;font-weight:600;
  color:var(--vwsp-ink-faint);display:flex;justify-content:space-between;align-items:baseline
}
.vwsp-chip-head span{font-weight:500}
.vwsp-chip-row{display:flex;flex-wrap:wrap;gap:6px}
.vwsp-chip{
  border:1px solid var(--vwsp-line);background:#fdfcfa;
  padding:6px 9px;font-size:12.5px;font-weight:600;color:var(--vwsp-ink-soft);
  min-width:46px;text-align:center
}
.vwsp-chip.vwsp-z-spirits{color:#15548f}
.vwsp-chip.vwsp-z-wine{color:var(--vwsp-gold)}
/* Comfortable tap targets once the plan itself is too small to tap precisely. */
.vws-fp.vwsp-narrow .vwsp-chips{max-height:none}
.vws-fp.vwsp-narrow .vwsp-chip{min-width:56px;padding:11px 10px;font-size:14px}
.vwsp-chip:hover{border-color:var(--vwsp-gold);color:var(--vwsp-gold)}
.vwsp-chip.vwsp-on,.vwsp-chip.vwsp-z-spirits.vwsp-on,.vwsp-chip.vwsp-z-wine.vwsp-on{background:var(--vwsp-select);border-color:#60491c;color:#fff}

/* ---------- Modal ---------- */
.vwsp-modal{position:fixed;inset:0;z-index:100000;display:grid;place-items:center;padding:20px}
.vwsp-modal[hidden]{display:none}
.vwsp-modal-backdrop{position:absolute;inset:0;background:rgba(25,19,25,.55);backdrop-filter:blur(2px)}
.vwsp-modal-card{
  position:relative;width:min(460px,100%);max-height:90vh;overflow:auto;
  background:var(--vwsp-surface);border-radius:4px;padding:26px;
  box-shadow:0 24px 60px -20px rgba(25,19,25,.5);
  animation:vwsp-rise .18s ease-out
}
@keyframes vwsp-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.vwsp-modal-x{position:absolute;top:10px;right:12px;border:0;background:none;font-size:24px;line-height:1;color:var(--vwsp-ink-faint);padding:4px 8px}
.vwsp-modal-x:hover{color:var(--vwsp-ink)}
.vwsp-modal-h{font-size:23px;margin-bottom:6px}
.vwsp-modal-booths{
  margin:14px 0 4px;padding:10px 12px;background:#faf7f2;border:1px solid var(--vwsp-line-soft);
  font-size:13.5px;color:var(--vwsp-ink-soft)
}
.vwsp-modal-booths b{color:var(--vwsp-ink);font-weight:600}
.vwsp-field{margin-top:12px}
.vwsp-field label{display:block;font-size:13px;color:var(--vwsp-ink-soft);margin-bottom:5px}
.vwsp-field input{width:100%;padding:10px 12px;border:1px solid var(--vwsp-line);border-radius:2px;background:#fdfcfa}
.vwsp-field input:focus{border-color:var(--vwsp-gold)}
.vwsp-field-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:420px){ .vwsp-field-pair{grid-template-columns:1fr} }
.vwsp-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.vwsp-error{margin-top:12px!important;padding:9px 12px;background:var(--vwsp-gold-tint);color:var(--vwsp-gold-deep);font-size:13px}
.vwsp-error[hidden]{display:none}
.vwsp-consent{margin-top:10px!important}
.vwsp-done-mark{
  width:46px;height:46px;border-radius:50%;background:#e4efe8;color:var(--vwsp-green);
  display:grid;place-items:center;font-size:24px;margin-bottom:14px
}
#vwsp-modal-done[hidden]{display:none}

@media (prefers-reduced-motion:reduce){
  .vws-fp *,.vwsp-modal-card{transition:none!important;animation:none!important}
}

/* ---------- Access gate ---------- */
.vwsp-gate{max-width:520px;margin:0 auto;padding:34px 30px;text-align:center}
.vwsp-gate-h{font-size:24px;margin-bottom:8px}
.vwsp-gate-form{display:flex;gap:8px;margin:18px 0 14px;flex-wrap:wrap}
.vwsp-gate-form input{
  flex:1 1 200px;min-width:0;padding:11px 13px;
  border:1px solid var(--vwsp-line);border-radius:2px;background:#fdfcfa;
  letter-spacing:.05em
}
.vwsp-gate-form input:focus{border-color:var(--vwsp-gold)}
.vwsp-gate-btn{width:auto;margin-top:0;flex:0 0 auto;padding:11px 20px}
.vwsp-gate .vwsp-error{text-align:left}
