/* ============================================================
   Targa Ime – Customizer CSS  v3
   ============================================================ */

/* ── ALTARGA license-plate font ────────────────────────────── */
@font-face {
  font-family: 'ALTARGA';
  src: url('/assets/fonts/ALTARGA.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --c-bg:      #0a0a0c;
  --c-panel:   #141418;
  --c-line:    #26262e;
  --c-ink:     #f5f5f7;
  --c-muted:   #8b8b95;
  --c-muted2:  #6a6a74;
  --c-accent:  #ff1f1f;
  --c-acc-soft:rgba(255,31,31,.14);
  --c-field:   #0c0c10;
  --c-radius:  16px;
}

/* ── Page Layout ────────────────────────────────────────────── */
.cust-page {
  background: var(--c-bg);
  min-height: calc(100vh - 70px);
  padding: 3.5rem 1.5rem 5rem;
}

.cust-grid {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 960px) {
  .cust-grid { grid-template-columns: 1fr; }
}

/* ── Section titles ─────────────────────────────────────────── */
.cust-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -.01em;
  color: var(--c-ink);
}

.cust-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--c-accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.cust-dot::after {
  content: "";
  width: 7px; height: 4px;
  border-left: 2.5px solid var(--c-accent);
  border-bottom: 2.5px solid var(--c-accent);
  transform: rotate(-45deg);
  margin-top: -2px;
}
.cust-gear { color: var(--c-accent); font-size: 1.2rem; line-height: 1; }

/* ── Stage / Preview card ───────────────────────────────────── */
.stage-card {
  background: #f4f4f6;
  border-radius: 22px;
  min-height: 420px;
  position: relative;
  display: grid;
  place-items: center;
  padding: 40px 40px 52px; /* extra bottom for portotarga chin */
  overflow: visible;       /* allow portotarga chin to show */
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.65);
}

.stage-inner {
  transform-origin: center;
  transition: transform .2s ease;
}

/* Zoom buttons */
.zoombar {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.zoombar button {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #222;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  font-family: inherit;
  transition: background .15s;
}
.zoombar button:hover { background: #eee; }

/* Legal note */
.legal-bubble {
  margin: 14px 2px 18px;
  color: var(--c-muted);
  font-style: italic;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bubble-dot { color: var(--c-accent); }

/* Action buttons */
.cust-actions {
  display: flex;
  gap: 14px;
}
.cust-actions button {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 17px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  transition: filter .15s, transform .15s;
  font-family: inherit;
}
.cust-actions button:hover { filter: brightness(1.15); transform: translateY(-1px); }

.btn-download     { background: #1b2230; }
.btn-whatsapp-order { background: #25D366; }

/* ── Settings Panel ─────────────────────────────────────────── */
.cust-panel {
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-radius: var(--c-radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Field labels */
.field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--c-muted);
  margin: 22px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  text-transform: uppercase;
}
.field-label:first-of-type { margin-top: 0; }

.field-hint {
  font-weight: 500;
  color: var(--c-muted2);
  letter-spacing: 0;
  font-size: 11px;
  text-transform: none;
}

/* Model select */
.cust-select {
  width: 100%;
  background: var(--c-field);
  border: 1.5px solid var(--c-accent);
  color: var(--c-ink);
  border-radius: 12px;
  padding: 16px 44px 16px 18px;
  font-size: 15px;
  font-weight: 700;
  outline: none;
  font-family: inherit;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23bbb' stroke-width='2'%3E%3Cpath d='M3 6l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

/* Text input */
.cust-text-input {
  width: 100%;
  background: var(--c-field);
  border: 1.5px solid var(--c-line);
  color: var(--c-ink);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color .2s;
}
.cust-text-input::placeholder { color: var(--c-muted2); }
.cust-text-input:focus { border-color: var(--c-accent); }

/* Control groups */
.control-group { display: none; }
.control-group.show { display: block; }

/* Option button grids */
.opt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.opt-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.opt-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }

.opt-btn {
  background: var(--c-field);
  border: 1.5px solid var(--c-line);
  color: var(--c-muted);
  border-radius: 12px;
  padding: 14px 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  font-family: inherit;
  line-height: 1.2;
}
.opt-btn:hover { border-color: #3a3a44; color: var(--c-ink); }
.opt-btn.active {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: var(--c-acc-soft);
}

/* Swatches */
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }

.swatch-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--c-field);
  border: 1.5px solid var(--c-line);
  border-radius: 999px;
  padding: 7px 13px 7px 7px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  color: var(--c-ink);
  transition: all .15s;
  font-family: inherit;
}
.swatch-btn:hover { border-color: #3a3a44; }
.swatch-btn.active { border-color: var(--c-accent); }

.swatch-dot {
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}

/* Share */
.share-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--c-field);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 14px;
}
.share-url-text {
  flex: 1;
  font-size: 11px;
  color: var(--c-muted2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-url-copy {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #aaa;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color .15s;
  font-family: inherit;
}
.share-url-copy:hover { color: #fff; }

.btn-share-link {
  margin-top: 12px;
  width: 100%;
  padding: 14px;
  background: none;
  border: 1.5px solid var(--c-line);
  border-radius: 12px;
  color: var(--c-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all .2s;
  font-family: inherit;
}
.btn-share-link:hover { border-color: var(--c-accent); color: var(--c-ink); }


/* ================================================================
   PLATE FONT CLASSES
   ================================================================ */
/* ALTARGA plate font – Albanian plates */
.font-altarga-plate {
  font-family: 'ALTARGA', 'Barlow Semi Condensed', sans-serif;
  font-weight: 900;       /* bold as requested */
  letter-spacing: .05em;
  line-height: 1;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}

.font-charles-wright {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 900;
  letter-spacing: .14em;
  line-height: 1;
  text-transform: uppercase;
}
.font-altarga {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.font-italian {
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.font-american {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.font-european {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.font-ethnocentric { font-family: 'Michroma', sans-serif; letter-spacing: -.01em; text-transform: uppercase; font-weight: 400; }
.font-montserrat   { font-family: 'Montserrat', sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.font-playfair     { font-family: 'Playfair Display', serif; font-weight: 900; text-transform: uppercase; }
.font-garamond     { font-family: 'Cormorant Garamond', serif; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }


/* ================================================================
   4D TEXT SHADOW EFFECTS
   ================================================================ */
.text-4d-kuqe {
  text-shadow:
    .8px  .8px  0 #AA0000,
    1.6px 1.6px 0 #CC0000,
    2.4px 2.4px 0 #EE0000,
    3.2px 3.2px 0 #FF0000,
    4px   4px   5px rgba(0,0,0,.4);
}
.text-4d-gjelber {
  text-shadow:
    .8px  .8px  0 #006400,
    1.6px 1.6px 0 #008000,
    2.4px 2.4px 0 #00A000,
    3.2px 3.2px 0 #00C000,
    4px   4px   5px rgba(0,0,0,.4);
}
.text-4d-blu {
  text-shadow:
    .8px  .8px  0 #00008B,
    1.6px 1.6px 0 #0000CD,
    2.4px 2.4px 0 #0000FF,
    3.2px 3.2px 0 #1E90FF,
    4px   4px   5px rgba(0,0,0,.4);
}
.text-4d-zeze {
  text-shadow:
    .8px  .8px  0 #000,
    1.6px 1.6px 0 #111,
    2.4px 2.4px 0 #222,
    3.2px 3.2px 0 #333,
    4px   4px   5px rgba(0,0,0,.4);
}


/* ── Eagle image (white filter) ─────────────────────────── */
.eagle-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 1px 3px rgba(0,0,0,.45));
  display: block;
  flex-shrink: 0;
}
.alb.amerikane .eagle-img {
  width: 30px;
  height: 30px;
}

/* ── Stage card — tilt cursor hint ──────────────────────── */
.stage-card {
  cursor: grab;
  perspective: 1200px;
}
.stage-card:active { cursor: grabbing; }
.stage-inner { transform-style: preserve-3d; }

/* ================================================================
   3D / 4D PLATE
   ================================================================ */
.plate-custom {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 540px;
  max-width: 78vw;
  height: 118px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 60px -12px rgba(0,0,0,.5);
  flex-shrink: 0;
}
.plate-custom h1 {
  margin: 0;
  font-size: 64px;
}
.plate-gloss {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.10), transparent 40%, rgba(0,0,0,.05));
  pointer-events: none;
}


/* ================================================================
   ALBANIAN PLATE  (accurate to real Albanian plate)
   ================================================================ */
.alb {
  position: relative;
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 8px;
  border: 2.5px solid rgba(0,0,0,.88);
  overflow: hidden;
  box-shadow:
    inset 0 1px 4px rgba(0,0,0,.18),
    0 12px 34px rgba(0,0,0,.38);
  /* European default size */
  width: 610px;
  max-width: 84vw;
  height: 125px;
  flex-shrink: 0;
}

/* Italian: same height, slightly narrower */
.alb.italiane {
  width: 460px;
  height: 125px;
}

/* American: squarish */
.alb.amerikane {
  width: 380px;
  height: 195px;
}

/* Corner screw bolts */
.alb .screw {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0e0e0, #909090, #606060);
  border: 1px solid rgba(0,0,0,.35);
  box-shadow: 1px 1px 2px rgba(0,0,0,.3);
  z-index: 40;
}
.alb .screw.tl { top:  7px; left:  7px; }
.alb .screw.tr { top:  7px; right: 7px; }
.alb .screw.bl { bottom: 7px; left:  7px; }
.alb .screw.br { bottom: 7px; right: 7px; }

/* Left blue strip (eagle + AL) */
.alb .strip-l {
  background: #003399;
  width: 13%;
  min-width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 10px;
  border-right: 1px solid rgba(0,0,0,.3);
  flex-shrink: 0;
  z-index: 5;
}

.alb.amerikane .strip-l {
  width: 16%;
  min-width: 52px;
  padding: 14px 4px 14px;
}

.alb .strip-l .eagle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
}

.alb .strip-l .eagle-wrap svg,
.alb .strip-l .eagle-wrap img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0,0,0,.4));
  display: block;
}

.alb.amerikane .strip-l .eagle-wrap svg,
.alb.amerikane .strip-l .eagle-wrap img {
  width: 32px;
  height: 32px;
}

.alb .strip-l .al {
  color: #fff;
  font-family: 'Arial', 'Helvetica', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .06em;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.alb.amerikane .strip-l .al { font-size: 16px; }

/* Center plate area */
.alb .center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  overflow: hidden;
}

.alb .center h1 {
  margin: 0;
  color: #111;
  white-space: nowrap;
  line-height: 1;
  text-shadow:
    1px 1px 1px rgba(0,0,0,.28),
    -1px -1px 1px rgba(255,255,255,.75),
    2px 2px 4px rgba(0,0,0,.15);
}

/* Right blue strip (registration ring) */
.alb .strip-r {
  background: #003399;
  width: 9%;
  min-width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 14px;
  border-left: 1px solid rgba(0,0,0,.3);
  flex-shrink: 0;
}

.alb.amerikane .strip-r {
  width: 12%;
  min-width: 38px;
  padding-bottom: 18px;
}

.alb .strip-r .ring {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.85);
  background: transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.alb.amerikane .strip-r .ring {
  width: 26px;
  height: 26px;
}


/* ================================================================
   PORTOTARGA (Plate Holder)
   ================================================================ */
.holder {
  position: relative;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.5));
  flex-shrink: 0;
}

.holder .body {
  position: relative;
  background: #101010;
  border: 1px solid rgba(255,255,255,.09);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
}

/* Car holder */
.holder.car .body {
  width: 540px;
  max-width: 78vw;
  height: 140px;
  border-radius: 10px;
}

/* Moto holder */
.holder.moto .body {
  width: 300px;
  max-width: 62vw;
  height: 280px;
  border-radius: 15px;
}

/* Side ears on car holder */
.holder .ear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 46px;
  background: #101010;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.06);
}
.holder .ear.l { left: -8px; }
.holder .ear.r { right: -8px; }

/* Inner padding */
.holder .pad {
  flex: 1;
  padding: 8px;
}
.holder.car  .pad { padding-bottom: 30px; }
.holder.moto .pad { padding-bottom: 40px; }

/* White backing / inner plate area */
.holder .backing {
  width: 100%;
  height: 100%;
  background: #f8f8f8;
  border-radius: 5px;
  border: 1px solid #d4d4d4;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.1);
  position: relative;
  overflow: hidden;
}

/* Inner holder screws */
.holder .hscrew {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e8e8e8;
  border: 1px solid #bbb;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,.15);
  z-index: 5;
}
.holder .hscrew.tl { top:  7px; left:  7px; }
.holder .hscrew.tr { top:  7px; right: 7px; }
.holder .hscrew.bl { bottom: 7px; left:  7px; }
.holder .hscrew.br { bottom: 7px; right: 7px; }

/* Decorative oval marks */
.holder .marks {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: .2;
  pointer-events: none;
}
.holder .marks.l { left: 18%; }
.holder .marks.r { right: 18%; }
.holder .marks .h { width: 64px; height: 9px; border-radius: 99px; border: 1.5px solid #000; }
.holder .marks .v { width: 9px; height: 72px; border-radius: 99px; border: 1.5px solid #000; }

/* Bottom chin / text bar */
.holder .chin {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}
.holder.car  .chin { bottom: -10px; width: 300px; height: 42px; }
.holder.moto .chin { bottom: -10px; width: 220px; height: 48px; }

.holder .chin .bg {
  position: absolute;
  inset: 0;
  background: #101010;
  /* No clip-path: html2canvas compatibility */
  border-radius: 0 0 8px 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.holder .chin span {
  position: relative;
  z-index: 5;
  color: #fff;
  text-align: center;
  padding: 4px 12px 0;
  white-space: nowrap;
  text-transform: uppercase;
}
.holder.car  .chin span { font-size: 28px; }
.holder.moto .chin span { font-size: 15px; }


/* ── Toast ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.toast {
  padding: .65rem 1rem;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .5rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s, transform .25s;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  cursor: pointer;
  max-width: 280px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #14532d; color: #4ADE80; border: 1px solid #166534; }
.toast-error   { background: #450a0a; color: #FC8181; border: 1px solid #7f1d1d; }
.toast-info    { background: #0c2340; color: #93C5FD; border: 1px solid #1e3a5f; }


/* ================================================================
   MOBILE RESPONSIVE  (< 768px)
   ================================================================ */
@media (max-width: 768px) {

  .cust-page {
    padding: 1rem 0.75rem 4rem;
  }

  .cust-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  /* Stage card – taller on mobile so scaled plates breathe */
  .stage-card {
    min-height: 260px;
    padding: 24px 12px;
    border-radius: 16px;
    cursor: default;       /* no tilt on touch */
  }

  /* Auto-scale is handled by JS, but belt-and-suspenders: */
  .stage-inner {
    transform-origin: center center;
  }

  /* Panel comes below preview on mobile */
  .cust-panel {
    border-radius: 16px;
    padding: 18px;
  }

  /* Action buttons stack */
  .cust-actions {
    flex-direction: column;
    gap: 10px;
  }

  /* Opt grids: 2 cols max on mobile */
  .opt-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Plate shells: override max-widths to fill stage */
  .alb,
  .alb.italiane,
  .alb.amerikane {
    max-width: none !important;
    width: auto;
  }

  .plate-custom {
    max-width: none !important;
    width: auto;
  }

  .holder.car .body,
  .holder.moto .body {
    max-width: none !important;
    width: auto;
  }

  /* Swatch buttons wrap */
  .swatch-row { gap: 6px; }
  .swatch-btn { font-size: 11px; padding: 6px 10px 6px 6px; }

  /* Zoom bar inside stage card */
  .zoombar {
    right: 8px;
    bottom: 8px;
  }
  .zoombar button {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* ── Very small screens (< 400px) ────────────────────────── */
@media (max-width: 400px) {
  .stage-card { min-height: 220px; padding: 16px 8px; }
  .cust-panel { padding: 14px; }
  .opt-btn    { font-size: 12px; padding: 12px 6px; }
}
