/* ==========================================================================
   Dr. Roosvelt Rojas - Holiday Gift Cards Print & Presentation Stylesheet
   Dimensions: Trim 85x55mm, Bleed 3mm (91x61mm total), Safe Zone 3mm (79x49mm)
   Export Resolution: 1004 x 650 px @ 300 DPI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,400&family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400&family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Concept 1: Botanical */
  --c1-primary: #2D5A43;
  --c1-secondary: #789262;
  --c1-secondary-text: #627750;
  --c1-accent: #D4A373;
  --c1-accent-light-text: #9C6530;
  --c1-dark: #1A2E23;
  --c1-light: #F8F6F0;
  --c1-font-heading: 'Fraunces', Georgia, serif;
  --c1-font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Concept 2: Clinical */
  --c2-primary: #0E3B43;
  --c2-secondary: #357279;
  --c2-accent: #E0A96D;
  --c2-accent-light-text: #9F6322;
  --c2-dark: #0A2328;
  --c2-light: #F4F7F6;
  --c2-font-heading: 'Cormorant Garamond', Garamond, serif;
  --c2-font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Concept 3: Vitality */
  --c3-primary: #9E3E26;
  --c3-secondary: #BC6C25;
  --c3-secondary-text: #A86021;
  --c3-accent: #DDA15E;
  --c3-dark: #26140E;
  --c3-light: #FAF7F2;
  --c3-font-heading: 'Playfair Display', Georgia, serif;
  --c3-font-body: 'Outfit', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Pending Placeholders Badge Styling
   -------------------------------------------------------------------------- */
.pending {
  display: inline-block;
  background-color: rgba(221, 161, 94, 0.16);
  color: #DDA15E;
  border: 1px dashed #DDA15E;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Screen View Layout & Luxury Preview
   -------------------------------------------------------------------------- */
body {
  background-color: #0F1312;
  color: #E8ECE9;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

/* Screen Header Bar */
.card-header-bar {
  background-color: #171D1A;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-info h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.header-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
  color: #9AA7A0;
}

.badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  color: #E0E7E3;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-print {
  background: linear-gradient(135deg, #2D5A43, #3B7558);
  color: #FFFFFF;
  border: 1px solid #4D9670;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-print:hover {
  background: linear-gradient(135deg, #3B7558, #4D9670);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.btn-nav {
  color: #9AA7A0;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.btn-nav:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

/* Card Showcase Screen Container */
.card-showcase {
  max-width: 1280px;
  margin: 40px auto;
  padding: 0 24px;
}

.card-instructions {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 36px;
  font-size: 0.9rem;
  color: #B4C2BA;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 40px;
  justify-content: center;
  align-items: start;
}

.card-preview-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-face-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8C9E95;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Card Face Structure (Screen Base & Print)
   -------------------------------------------------------------------------- */
.card-unit {
  position: relative;
  width: 100%;
  aspect-ratio: 85 / 55;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-unit:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.7), 0 4px 10px rgba(0, 0, 0, 0.5);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 5.5%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* Luxury Card Metallic Border Inset */
.card-inner::before {
  content: '';
  position: absolute;
  inset: 3.5%;
  border: 1px solid var(--accent-stroke, rgba(212, 163, 115, 0.45));
  border-radius: 6px;
  pointer-events: none;
  z-index: 2;
}

.card-inner::after {
  content: '';
  position: absolute;
  inset: 4.5%;
  border: 0.5px dashed var(--accent-stroke, rgba(212, 163, 115, 0.3));
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}

/* Holiday Background Atmosphere & Ornaments */
.card-bg-ornament {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Front Face Elements */
.card-front-top {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge img.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
}

.brand-names {
  display: flex;
  flex-direction: column;
}

.brand-doctor {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-light);
  font-family: var(--font-heading);
}

.brand-sub {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-top: 2px;
}

.holiday-greeting-tag {
  text-align: right;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.8rem;
  color: var(--accent-color);
  line-height: 1.25;
}

.card-front-center {
  position: relative;
  z-index: 3;
  text-align: center;
  margin: auto 0;
  padding: 6px 0;
}

.card-title-holiday {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.card-value-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 4px;
}

.card-value-amount {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.card-service-desc {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.card-service-sub {
  font-size: 0.62rem;
  color: var(--accent-color);
  opacity: 0.9;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.card-front-bottom {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

.card-gift-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.gift-line {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-color);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.gift-line-fill {
  flex: 1;
  border-bottom: 1px dotted var(--accent-color);
  height: 1px;
}

.card-validity-front {
  font-size: 0.65rem;
  color: var(--text-light);
  opacity: 0.85;
  text-align: right;
  white-space: nowrap;
}

/* Back Face Elements */
.card-back-header {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 6px;
}

.back-brand-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-light);
}

.back-location-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-color);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-back-body {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  margin: auto 0;
}

.redemption-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.redemption-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-color);
}

.redemption-step {
  font-size: 0.72rem;
  color: var(--text-light);
  line-height: 1.35;
}

.redemption-whatsapp {
  font-size: 0.85rem;
  font-weight: 700;
  color: #25D366;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.redemption-whatsapp:hover {
  text-decoration: underline;
}

/* Reserved 20 x 20 mm QR Code Slot */
.qr-slot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.qr-box {
  width: 76px;
  height: 76px;
  border: 1.5px dashed var(--accent-color);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
}

.qr-code-text {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-color);
  letter-spacing: 0.05em;
}

.qr-placeholder-sub {
  font-size: 0.52rem;
  color: var(--text-light);
  opacity: 0.8;
  margin-top: 2px;
  line-height: 1.1;
}

.card-back-footer {
  position: relative;
  z-index: 3;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
}

.card-serial {
  font-weight: 700;
  font-family: monospace;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

.card-expiry {
  color: var(--accent-color);
  font-weight: 600;
}

.card-legal-disclaimer {
  font-size: 0.54rem;
  color: var(--text-light);
  opacity: 0.72;
  line-height: 1.25;
}

/* --------------------------------------------------------------------------
   Metric Print Rules (@media print)
   Page: 91 x 61 mm (3mm bleed on each side of 85x55mm trim)
   -------------------------------------------------------------------------- */
@page {
  size: 91mm 61mm;
  margin: 0;
}

@media print {
  html, body {
    width: 91mm;
    height: 61mm;
    margin: 0;
    padding: 0;
    background: transparent;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .card-header-bar,
  .card-instructions,
  .card-face-label {
    display: none !important;
  }

  .card-showcase {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .cards-grid {
    display: block !important;
  }

  .card-preview-block {
    width: 91mm !important;
    height: 61mm !important;
    page-break-after: always;
    break-after: page;
    position: relative;
    overflow: hidden;
  }

  /* Full Bleed Canvas (91 x 61 mm) */
  .card-unit {
    width: 91mm !important;
    height: 61mm !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    position: absolute;
    top: 0;
    left: 0;
  }

  /* Trim Zone: 85 x 55 mm inside 3mm bleed */
  .card-inner {
    position: absolute;
    top: 3mm;
    left: 3mm;
    width: 85mm;
    height: 55mm;
    padding: 3mm; /* Safe zone is 3mm inside trim = 6mm from edge */
  }

  /* Print Crop Marks at 4 corners in the 3mm bleed area */
  .crop-mark {
    display: block !important;
    position: absolute;
    pointer-events: none;
    z-index: 10;
  }

  /* Crop mark coordinates: trim edges are at x=3mm, 88mm; y=3mm, 58mm */
  .crop-tl-v { top: 0; left: 3mm; width: 0.15mm; height: 2mm; background: #E0E0E0; }
  .crop-tl-h { top: 3mm; left: 0; width: 2mm; height: 0.15mm; background: #E0E0E0; }

  .crop-tr-v { top: 0; left: 88mm; width: 0.15mm; height: 2mm; background: #E0E0E0; }
  .crop-tr-h { top: 3mm; left: 89mm; width: 2mm; height: 0.15mm; background: #E0E0E0; }

  .crop-bl-v { top: 59mm; left: 3mm; width: 0.15mm; height: 2mm; background: #E0E0E0; }
  .crop-bl-h { top: 58mm; left: 0; width: 2mm; height: 0.15mm; background: #E0E0E0; }

  .crop-br-v { top: 59mm; left: 88mm; width: 0.15mm; height: 2mm; background: #E0E0E0; }
  .crop-br-h { top: 58mm; left: 89mm; width: 2mm; height: 0.15mm; background: #E0E0E0; }
}

/* --------------------------------------------------------------------------
   Export Mode: Headless Screenshot (1004 x 650 px @ 300 DPI trim)
   -------------------------------------------------------------------------- */
html.export-mode,
body.export-mode {
  width: 1004px !important;
  height: 650px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
}

html.export-mode .card-header-bar,
html.export-mode .card-instructions,
html.export-mode .card-face-label,
html.export-mode .crop-mark {
  display: none !important;
}

html.export-mode .card-showcase {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}

html.export-mode .cards-grid {
  display: block !important;
}

/* When rendering FRONT face */
html.export-front .card-preview-block:last-child {
  display: none !important;
}
html.export-front .card-preview-block:first-child .card-unit {
  width: 1004px !important;
  height: 650px !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

/* When rendering BACK face */
html.export-back .card-preview-block:first-child {
  display: none !important;
}
html.export-back .card-preview-block:last-child .card-unit {
  width: 1004px !important;
  height: 650px !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

/* Scaled Typography for 1004x650 Export */
html.export-mode .card-inner {
  padding: 42px 48px !important;
}
html.export-mode .brand-badge img.card-icon {
  width: 68px !important;
  height: 68px !important;
}
html.export-mode .brand-doctor {
  font-size: 1.85rem !important;
}
html.export-mode .brand-sub {
  font-size: 0.85rem !important;
}
html.export-mode .holiday-greeting-tag {
  font-size: 1.2rem !important;
}
html.export-mode .card-title-holiday {
  font-size: 2.25rem !important;
}
html.export-mode .card-value-amount {
  font-size: 3.8rem !important;
}
html.export-mode .card-service-desc {
  font-size: 1.25rem !important;
}
html.export-mode .card-service-sub {
  font-size: 0.95rem !important;
}
html.export-mode .gift-line {
  font-size: 1.1rem !important;
}
html.export-mode .card-validity-front {
  font-size: 0.95rem !important;
}
html.export-mode .back-brand-title {
  font-size: 1.5rem !important;
}
html.export-mode .back-location-badge {
  font-size: 1.0rem !important;
}
html.export-mode .redemption-title {
  font-size: 1.15rem !important;
}
html.export-mode .redemption-step {
  font-size: 1.05rem !important;
}
html.export-mode .redemption-whatsapp {
  font-size: 1.25rem !important;
}
html.export-mode .qr-box {
  width: 120px !important;
  height: 120px !important;
}
html.export-mode .qr-code-text {
  font-size: 1.5rem !important;
}
html.export-mode .qr-placeholder-sub {
  font-size: 0.78rem !important;
}
html.export-mode .card-meta-row {
  font-size: 1.05rem !important;
}
html.export-mode .card-legal-disclaimer {
  font-size: 0.78rem !important;
}
