/* ========================================
   VCG QLD v2 — Contact Page Styles
   Styles specific to contact.html
   ======================================== */

/* ========================================
   1. HERO
   ======================================== */
.contact-hero {
  position: relative;
  padding: var(--lg-hero-pad-top) var(--lg-hero-pad-x) var(--lg-hero-pad-bottom);
  background: var(--lg-hero-bg);
  text-align: center;
  overflow: hidden;
}

.contact-hero-content {
  position: relative;
  z-index: var(--z-raised);
  max-width: 700px;
  margin: 0 auto;
}

.contact-hero-sub {
  font-size: var(--text-body-lg);
  color: var(--lg-hero-text-sub);
  line-height: var(--lh-prose);
  max-width: 520px;
  margin: 0 auto;
}

/* ========================================
   2. CONTACT SECTION LAYOUTS
   Top: map + info cards (2-col). Bottom: form (full-width).
   ======================================== */
.contact-details-section {
  background: var(--color-bg);
  padding: var(--space-section-y) var(--space-page-x);
}

.contact-details-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--gap-xl);
  align-items: stretch;
}

.contact-form-section {
  background: var(--color-bg-pool);
  padding: var(--space-section-y) var(--space-page-x);
}

.contact-form-container {
  max-width: 960px;
}

.contact-form-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}
.contact-form-header .section-title {
  margin-bottom: var(--space-2xs);
}

/* ========================================
   3. CONTACT FORM — GLASS PANEL
   Inputs, selects, textareas pick up their glass styling from
   primitives.css. Only the panel wrapper and page-specific layout
   live here.
   ======================================== */
.contact-form {
  /* Form panel — translucent fill only; blur removed (flat section behind,
     so it rendered identically while costing GPU every scroll frame). */
  background: var(--glass-panel-strong);
  border-top:    var(--glass-edge-top);
  border-left:   var(--glass-edge-left);
  border-right:  var(--glass-edge-right);
  border-bottom: var(--glass-edge-bottom);
  border-radius: var(--r-sheet);
  box-shadow: var(--shadow-glass);
  padding: var(--space-xl);
}

.form-group {
  margin-bottom: var(--space-1-4);
}

.form-group label {
  display: block;
  font-size: var(--text-sm-plus);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2xs);
  letter-spacing: 0.01em;
}

.form-group label .required {
  color: var(--color-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Error states — override the glass border from primitives */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: var(--color-error);
  box-shadow: var(--shadow-error);
}

.form-error {
  font-size: var(--text-xs-plus);
  color: var(--color-error);
  margin-top: var(--space-2xs);
  min-height: 1.1em;
}

/* Radio group — pill-shaped glass swatches, aligned to a 44px row
   so a radio row sits flush with a select input in the same stack. */
.radio-group {
  display: flex;
  align-items: center;
  gap: var(--gap-card);
  min-height: 44px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: var(--text-body-sm);
  line-height: 1;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--ease-fast);
}

.radio-label:hover {
  color: var(--color-text);
}

.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-custom {
  display: inline-block;
  width: var(--icon-sm);
  height: var(--icon-sm);
  border-radius: 50%;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur-sm);
          backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--border-medium);
  position: relative;
  /* Optical nudge: with a 20px dot beside 14px text, align-items:center leaves
     the dot sitting ~5px above the text's visual centre — pull it back down. */
  top: 4px;
  transition: border-color var(--ease-fast), background var(--ease-fast);
  flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-white);
}

.radio-label input[type="radio"]:focus-visible + .radio-custom {
  box-shadow: 0 0 0 3px var(--color-primary-ring-subtle);
}

/* Submit */
.form-submit {
  margin-top: var(--space-xs);
}

.form-submit .btn-primary {
  width: 100%;
  justify-content: center;
}

.form-submit .btn-primary.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Form result message */
.form-result {
  text-align: center;
  margin-top: var(--space-md);
  font-size: var(--text-body-sm);
  font-weight: 600;
  min-height: 1.4em;
}

.form-result.success {
  color: var(--color-success);
}

.form-result.error {
  color: var(--color-error);
}

/* reCAPTCHA notice */
.recaptcha-notice {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-md);
  line-height: var(--lh-normal-5);
}

.recaptcha-notice a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ========================================
   4. FORM 2-COL GRID + PRODUCT PREVIEW
   Preview lives in col 2, spanning the first 3 field rows on desktop.
   On mobile the grid collapses to a single column and order places
   the preview directly under the Model select.
   ======================================== */
/* Top block — col A is a tight vertical stack of Name/Email/Location,
   col B is the Preview sized to match col A's height (top aligns
   with Name top, bottom aligns with Location bottom). */
.form-top-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--space-xl);
  align-items: stretch;
  margin-bottom: var(--space-md);
}

.form-col-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.form-col-stack > .form-group { margin-bottom: 0; }

.form-preview-cell {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  min-height: 0;
}
/* Position:relative wrapper so the placeholder/image can be absolute.
   Flex:1 + min-height:0 lets this cell fill the grid row without the
   image's intrinsic size pushing the row taller. */
.form-preview-cell .product-preview {
  position: relative;
  flex: 1;
  margin-top: 0;
  min-height: 0;
}
.form-preview-cell .product-preview-placeholder,
.form-preview-cell .product-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Fill the preview box exactly — overrides the responsive max-height
     cap on .product-preview img that would otherwise leave a gap. */
  max-height: none;
}

@media (max-width: 768px) {
  /* Collapse to single column; preview drops below the fields */
  .form-top-block {
    grid-template-columns: 1fr;
    row-gap: var(--space-md);
  }
  .form-preview-cell {
    grid-row: auto;
    margin-top: 0;
  }
  /* Single-column: the preview no longer fills a grid row, so give it an
     explicit height — its placeholder/image are absolutely positioned and
     would otherwise collapse the box to zero height (preview invisible). */
  .form-preview-cell .product-preview {
    flex: none;
    height: 280px;
  }
}

.product-preview {
  margin-top: var(--space-md);
  background: var(--color-bg-lighter);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.product-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  background: linear-gradient(135deg, var(--color-bg-pool) 0%, var(--color-bg-lighter) 100%);
  color: var(--color-text-muted);
  gap: var(--space-sm);
}

.product-preview-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.4;
}

.product-preview-placeholder span {
  font-size: var(--text-sm-plus);
  font-weight: 500;
}

.product-preview img {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: contain;
  padding: var(--space-lg);
  background: var(--color-bg);
  box-sizing: border-box;
}


/* ========================================
   5. MAP CONTAINER — sits in the details grid, matches info-cards column height
   ======================================== */
.map-container {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  align-self: stretch;
}

.map-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ========================================
   6. CONTACT INFO CARDS
   ======================================== */
.contact-info-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Static info card (contains tel:/mailto: links, but the card itself is
   not clickable) — no whole-card hover affordance. */
.contact-info-card {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-1-4) var(--space-1-5);
  display: flex;
  gap: var(--space-1);
  align-items: center;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
}

.contact-info-icon {
  width: var(--icon-box-sm);
  height: var(--icon-box-sm);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-bg-pool), var(--color-bg-lighter));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-icon svg {
  width: 22px;
  height: 22px;
  color: var(--color-deep);
}

.contact-info-body h3 {
  font-size: var(--text-body-sm);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: normal;
  line-height: var(--lh-h4);
  margin-bottom: var(--space-2xs);
}

.contact-info-body p {
  font-size: var(--text-sm-plus);
  color: var(--color-text-secondary);
  line-height: var(--lh-body);
  margin-bottom: var(--space-3xs);
}

.contact-info-body a {
  color: var(--color-primary);
  font-weight: 500;
  transition: color var(--ease-fast);
}

.contact-info-body a:hover {
  color: var(--color-deep);
  opacity: 1;
}

/* Combined card (Messaging | Follow Us) — two side-by-side columns. */
.contact-info-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
}

.contact-info-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 52px;
}

.contact-info-note {
  font-size: var(--text-xs) !important;
  color: var(--color-text-muted) !important;
  font-style: italic;
  margin-top: var(--space-2xs);
}

/* Scroll to top — styles in global.css */

/* ========================================
   9. RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .contact-details-grid {
    grid-template-columns: 1fr;
    gap: var(--gap-lg);
  }

  .map-container {
    min-height: 340px;
  }

  .product-preview {
    margin-top: var(--space-sm);
  }
  .product-preview-placeholder { min-height: 200px; }
  .product-preview img { max-height: 240px; padding: var(--space-md); }
}

@media (max-width: 768px) {
  .contact-hero {
    padding: var(--lg-hero-pad-top-m) var(--lg-hero-pad-x-m) var(--lg-hero-pad-bottom-m);
  }

  .contact-details-section,
  .contact-form-section {
    padding: var(--space-xl) var(--space-page-x-m);
  }

  .contact-info-cards {
    gap: var(--space-sm);
  }

  .map-container {
    min-height: 260px;
  }
}

@media (max-width: 480px) {
  .contact-hero {
    padding-left: var(--space-page-x-sm);
    padding-right: var(--space-page-x-sm);
  }

  .contact-hero-sub {
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding-left: var(--space-1);
    padding-right: var(--space-1);
    max-width: 100%;
    font-size: var(--text-body);
  }

  .contact-info-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: center;
    align-items: center;
  }

  .contact-info-icon {
    margin-bottom: var(--space-2xs);
  }

  .contact-info-body {
    text-align: center;
  }

  /* Combined Messaging | Follow Us card stacks on small screens. */
  .contact-info-cols {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* reCAPTCHA v3 badge hidden — permitted under Google's terms because the
   required attribution text (.recaptcha-notice) is shown in the form. The
   reCAPTCHA protection itself still runs; only the floating badge is hidden. */
.grecaptcha-badge {
  visibility: hidden;
}
