/* ─────────────────────────────────────────────────────────────────────
   PromoHaus Core — theme-independent shop component styles.
   Brand tokens fall back to hardcoded values so the plugin renders
   correctly under ANY theme; themes may override the custom properties.
───────────────────────────────────────────────────────────────────── */
:root {
  --ph-navy:   var(--color-navy, #2D3561);
  --ph-coral:  var(--color-coral, #EF5B4B);
  --ph-white:  var(--color-white, #FFFFFF);
  --ph-bg:     var(--color-bg, #F7F8FA);
  --ph-text:   var(--color-text, #1A1A2E);
  --ph-muted:  var(--color-text-muted, #6B7280);
  --ph-border: var(--color-border, #E2E4EA);
}

/* ── Pricing: excl. VAT prominent, incl. VAT beneath ───────────────── */
.ph-price { display: block; line-height: 1.35; }
.ph-price--excl { color: var(--ph-navy); font-weight: 700; }
.ph-price--incl { color: var(--ph-muted); font-size: 0.875rem; font-weight: 400; }
.ph-price--incl .woocommerce-Price-amount { font-weight: 500; }
.ph-price__label { font-size: 0.75rem; font-weight: 400; color: var(--ph-muted); text-transform: none; }

/* ── Volume Pricing Trigger + Popover ──────────────────────────────── */
.ph-volume-trigger { position: relative; display: inline-block; margin-left: 0.5rem; vertical-align: middle; }
.ph-volume-trigger__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ph-coral);
  cursor: help;
  border-bottom: 1px dotted var(--ph-coral);
  white-space: nowrap;
}
.ph-volume-trigger__popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  width: 20rem;
  max-width: 80vw;
  background: var(--ph-white);
  border: 1px solid var(--ph-border);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(26,26,46,0.18);
  padding: 0.75rem;
}
.ph-volume-trigger:hover .ph-volume-trigger__popover,
.ph-volume-trigger:focus-within .ph-volume-trigger__popover { display: block; }
.ph-volume-pricing__table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.ph-volume-pricing__table th,
.ph-volume-pricing__table td { padding: 0.35rem 0.5rem; text-align: left; border-bottom: 1px solid var(--ph-border); }
.ph-volume-pricing__table th { color: var(--ph-muted); font-weight: 600; }
.ph-volume-pricing__table tr:last-child td { border-bottom: none; font-weight: 600; color: var(--ph-navy); }
.ph-volume-pricing__note { display: block; margin-top: 0.5rem; font-size: 0.75rem; color: var(--ph-muted); }

/* ── Branding Options Panel ────────────────────────────────────────── */
.ph-branding { margin: 1.25rem 0; max-width: 34rem; }
.ph-branding__toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--ph-navy);
  padding: 0.75rem 1rem;
  border: 1px solid var(--ph-border);
  border-radius: 6px;
  background: var(--ph-bg);
  transition: border-color 0.2s ease;
}
.ph-branding__toggle:hover { border-color: var(--ph-navy); }
.ph-branding__toggle input { accent-color: var(--ph-coral); width: 18px; height: 18px; }
.ph-branding__panel {
  border: 1px solid var(--ph-border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 1rem;
  background: var(--ph-white);
}
.ph-branding__hint { margin: 0 0 0.75rem; color: var(--ph-muted); font-size: 0.875rem; }
.ph-branding__position { border: none; border-top: 1px solid var(--ph-border); margin: 0; padding: 0.75rem 0; }
.ph-branding__position legend { font-weight: 700; color: var(--ph-navy); font-size: 0.875rem; padding-right: 0.5rem; }
.ph-branding__flag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}
.ph-branding__flag--required { background: var(--ph-coral); color: var(--ph-white); }
.ph-branding__flag--fixed    { background: var(--ph-border); color: var(--ph-text); }
.ph-branding__method { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; padding: 0.3rem 0; cursor: pointer; }
.ph-branding__method input { accent-color: var(--ph-coral); }
.ph-branding__method-name { font-weight: 500; color: var(--ph-text); }
.ph-branding__method-meta { font-size: 0.75rem; color: var(--ph-muted); background: var(--ph-bg); border-radius: 4px; padding: 1px 6px; }
.ph-branding__method-meta--warn { color: #B45309; background: #FEF3C7; }
.ph-branding__text,
.ph-branding__artwork { display: block; margin-top: 0.75rem; }
.ph-branding__text span,
.ph-branding__artwork span { display: block; font-size: 0.875rem; font-weight: 600; color: var(--ph-navy); margin-bottom: 0.3rem; }
.ph-branding__text textarea {
  width: 100%;
  border: 1px solid var(--ph-border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
}
.ph-branding__text textarea:focus { outline: none; border-color: var(--ph-navy); }
.ph-branding__artwork input[type="file"] { font-size: 0.875rem; }
.ph-branding__estimate {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.75rem;
  background: var(--ph-bg);
  border-left: 3px solid var(--ph-coral);
  border-radius: 0 6px 6px 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ph-navy);
}
.ph-branding__guide-btn { margin-top: 0.75rem; }

/* ── Modal (branding guide PDF) ────────────────────────────────────── */
.ph-modal { position: fixed; inset: 0; z-index: 100000; }
.ph-modal__backdrop { position: absolute; inset: 0; background: rgba(26,26,46,0.65); }
.ph-modal__dialog {
  position: absolute;
  inset: 4vh 4vw;
  background: var(--ph-white);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(26,26,46,0.35);
}
.ph-modal__bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--ph-navy);
}
.ph-modal__external { color: var(--ph-white); font-size: 0.875rem; font-weight: 600; }
.ph-modal__external:hover { color: var(--ph-coral); }
.ph-modal__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: var(--ph-white);
  font-size: 20px;
  cursor: pointer;
}
.ph-modal__close:hover { background: var(--ph-coral); }
.ph-modal__frame { flex: 1; width: 100%; border: none; }
body.ph-modal-open { overflow: hidden; }

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .ph-modal__dialog { inset: 0; border-radius: 0; }
  .ph-modal__close { width: 44px; height: 44px; font-size: 24px; }
  .ph-volume-trigger__popover {
    position: fixed;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(92vw, 22rem);
    max-height: 80dvh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(26,26,46,0.35);
  }
  .ph-branding { max-width: none; }
}
