/* ============================================================
   COMPONENTS.CSS — Arihant Fabrics
   Role: Reusable UI components — buttons, cards, forms,
         badges, tags, section wrappers
   Depends on: base.css (custom properties)
   ============================================================ */


/* ============================================================
   SECTION WRAPPER
   Consistent vertical rhythm across all page sections.
   ============================================================ */

.section {
  padding-block: var(--space-3xl);
}

.section--sm {
  padding-block: var(--space-2xl);
}

.section__eyebrow {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(10, 37, 117, 0.65); /* was 0.45 — increased to pass WCAG AA 4.5:1 contrast at 10px */
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section__eyebrow-rule {
  flex: 1;
  border: none;
  border-top: 0.5px solid rgba(10, 37, 117, 0.15);
}

.section__heading {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
}

.section__subheading {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  max-width: 60ch;
  line-height: var(--line-height-body);
}

.section__header {
  margin-bottom: var(--space-2xl);
}


/* ============================================================
   BUTTONS
   Primary, secondary, ghost, and CTA variants.
   All use Inter 500, uppercase, letter-spacing: 1px.
   Minimum height 44px (WCAG touch target).
   ============================================================ */

/* Base reset — all buttons inherit this */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  min-height: 44px;
  cursor: pointer;
  white-space: nowrap;
  border: 1.5px solid transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition:
      background   0.15s ease,
      color        0.15s ease,
      border-color 0.15s ease,
      box-shadow   0.15s ease;
  }
}

/* Primary — navy filled */
.btn--primary {
  background: var(--color-navy);
  color: var(--color-white);
  border-color: var(--color-navy);
}

.btn--primary:hover {
  background: var(--color-navy-dark);
  border-color: var(--color-navy-dark);
  color: var(--color-white);
  text-decoration: none;
}

/* Secondary — outlined navy */
.btn--secondary {
  background: transparent;
  color: var(--color-navy);
  border-color: var(--color-navy);
}

.btn--secondary:hover {
  background: var(--color-navy);
  color: var(--color-white);
  text-decoration: none;
}

/* Ghost — text only, no border or fill */
.btn--ghost {
  background: transparent;
  color: var(--color-navy);
  border-color: transparent;
  padding-inline: 0;
}

.btn--ghost:hover {
  color: var(--color-navy-dark);
  text-decoration: none;
}

/* WhatsApp — green filled */
.btn--whatsapp {
  background: #25d366;
  color: var(--color-white);
  border-color: #25d366;
  gap: 10px;
}

.btn--whatsapp:hover {
  background: #1ebe5d;
  border-color: #1ebe5d;
  color: var(--color-white);
  text-decoration: none;
}

/* Large modifier */
.btn--lg {
  font-size: 13px;
  padding: 14px 32px;
  min-height: 48px;
}

/* Small modifier */
.btn--sm {
  font-size: 11px;
  padding: 8px 16px;
  min-height: 36px;
}

/* Full-width modifier */
.btn--full {
  width: 100%;
}


/* ============================================================
   BADGES
   Inline labels — sampling, certifications, categories.
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 100px;
  padding: 4px 10px;
}

/* Sampling available — used on contact CTA section and contact page */
.badge--sampling {
  background: rgba(10, 37, 117, 0.06);
  color: var(--color-navy);
  border: 1px solid rgba(10, 37, 117, 0.12);
}

/* Gold accent badge */
.badge--gold {
  background: rgba(238, 204, 26, 0.15);
  color: #7a6600;
  border: 1px solid rgba(238, 204, 26, 0.4);
}

/* Certification badges on fabric cards */
.badge--cert {
  background: rgba(10, 37, 117, 0.04);
  color: rgba(10, 37, 117, 0.65);
  border: 1px solid rgba(10, 37, 117, 0.10);
  font-size: 9px;
}


/* ============================================================
   PROCESS STEPS — "Our Fabric Sourcing Process"
   6-step grid: 1-col → 2-col → 3-col → 6-col
   ============================================================ */

.process__steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  list-style: none;
  counter-reset: step-counter;
}

@media (min-width: 480px) {
  .process__steps { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .process__steps { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .process__steps { grid-template-columns: repeat(6, 1fr); }
}

.process__step {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  position: relative;
}

.process__step-number {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(10, 37, 117, 0.35);
}

.process__step-title {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-navy);
  line-height: 1.3;
}

.process__step-desc {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--color-text-muted);
  line-height: 1.65;
}


/* ============================================================
   CTA / ENQUIRY SECTION — Homepage bottom section
   ============================================================ */

.cta-section {
  background: var(--color-bg-light);
  padding-block: var(--space-3xl);
}

.cta-section__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

@media (min-width: 1024px) {
  .cta-section__inner {
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-3xl);
    align-items: start;
  }
}

.cta-section__heading {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
}

.cta-section__sub {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
  max-width: 42ch;
  line-height: var(--line-height-body);
}

.cta-section__direct {
  margin-top: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.cta-section__or {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cta-section__email-link {
  font-size: var(--font-size-sm);
  color: var(--color-navy);
  font-weight: 500;
}

/* Right side — form panel */
.cta-section__form-panel {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.cta-section__form-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.cta-section__form-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(10, 37, 117, 0.55);
}


/* ============================================================
   ENQUIRY FORM
   ============================================================ */

.enquiry-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .form-row--two {
    grid-template-columns: 1fr 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(10, 37, 117, 0.55);
}

.form-label .required-mark {
  color: #c0392b;
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--color-text-body);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.5;
}

@media (prefers-reduced-motion: no-preference) {
  .form-input,
  .form-select,
  .form-textarea {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
}

.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  /* outline from base.css :focus-visible now shows for keyboard users */
  border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(10, 37, 117, 0.08);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(26, 26, 26, 0.35);
}

/* Select: custom chevron */
.form-select-wrap {
  position: relative;
}

.form-select-wrap::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(10, 37, 117, 0.45);
  pointer-events: none;
}

.form-select {
  padding-right: 32px;
  cursor: pointer;
  background-image: none;
}

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

.form-note {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* Error state */
.form-input.has-error,
.form-select.has-error,
.form-textarea.has-error {
  border-color: #c0392b;
}

.form-error-msg {
  font-size: 11px;
  color: #c0392b;
  margin-top: 4px;
  display: none;
}

.form-error-msg.is-visible {
  display: block;
}

/* Success / error message after submission */
.form-status {
  display: none;
  padding: var(--space-md);
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-align: center;
}

.form-status.is-success {
  display: block;
  background: rgba(39, 174, 96, 0.08);
  color: #1a7a45;
  border: 1px solid rgba(39, 174, 96, 0.25);
}

.form-status.is-error {
  display: block;
  background: rgba(192, 57, 43, 0.08);
  color: #922b21;
  border: 1px solid rgba(192, 57, 43, 0.25);
}



/* ============================================================
   WHATSAPP INLINE BUTTON (.wa-btn)
   Used in page CTA sections where an inline WhatsApp contact
   link is needed (e.g. contact section left panel).
   Distinct from .wa-sticky (the fixed floating button).
   Moved from home.css → components.css so it is available
   on any page that needs it.
   ============================================================ */
.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(37, 211, 102, 0.10);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: #4cd97a;
  padding: 13px 24px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.06em;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 16px;
}

@media (prefers-reduced-motion: no-preference) {
  .wa-btn {
    transition: background 0.3s ease, border-color 0.3s ease;
  }
}

.wa-btn:hover {
  background: rgba(37, 211, 102, 0.16);
  border-color: rgba(37, 211, 102, 0.5);
  color: #4cd97a;
  text-decoration: none;
}


/* ============================================================
   STICKY WHATSAPP BUTTON (.wa-sticky)
   Fixed bottom-right corner. Visible from page load.
   Hides when the sticky footer begins to reveal (scroll
   geometry check in main.js — updateWaBtn function).
   Desktop: green pill with icon + text.
   Mobile (<768px): green circle with icon only.
   Appears on: index, greige, yarn-dyed, denim, about,
               contact, 404. Not on privacy/terms pages.
   ============================================================ */
.wa-sticky {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #25d366;
  color: #ffffff;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
  z-index: 9997;
}

@media (prefers-reduced-motion: no-preference) {
  .wa-sticky {
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
}

/* Hidden when footer is being revealed — class toggled by main.js */
.wa-sticky.is-footer-visible {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.wa-sticky:hover {
  background: #1ebe5d;
  text-decoration: none;
  color: #ffffff;
}

.wa-sticky:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
}

/* Mobile: circle with icon only — text hidden */
@media (max-width: 767px) {
  .wa-sticky {
    bottom: 16px;
    right: 16px;
    padding: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
  }

  .wa-sticky__text {
    display: none;
  }

  .wa-sticky__icon {
    width: 26px;
    height: 26px;
  }
}

/* ── End of components.css ── */

/* ============================================================
   FORM FIELDS — Base styles
   Used on: homepage CTA enquiry form, contact page form.
   All values are exact from the WordPress prototype.
   
   Deviations from prototype that were fixed:
   - border: rgba(10,37,117,0.12) [was 0.25]
   - padding: 10px 5px [was 9px 12px]
   - text color: #0a2575 [was --color-text-body]
   - focus: box-shadow glow [was border-only]
   - placeholder: rgba(10,37,117,0.5) [was 0.3]
   - textarea: height 60px, resize none [was 100px, resizable]
   - asterisk (sup): rgb(180,60,60) [was navy]
   - form-group padding: 0 [was 12px 0 4px]
   - no appearance:none on fabric-type select [was custom chevron]
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  padding-top: 16px; /* prototype: <p> inside cf7-group has margin-top:1em which
                        collapses through the wrapper div into the grid */
  gap: 4px;          /* prototype: label and input separated by <br/> */
  min-width: 0;      /* allow grid columns to shrink equally — without this,
                        the phone-wrap's 65px country-select sets a minimum
                        content size that prevents the left column from shrinking */
}

.form-group > label {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(10, 37, 117, 1);
  padding-left: 4px;
  font-weight: 400;
}

/* Required asterisk — matches prototype's label sup */
.form-group > label sup {
  color: rgb(180, 60, 60);
  /* Fix column alignment: browser default vertical-align:super inflates the label
     line box, making labels with asterisks taller than labels without.
     vertical-align:baseline keeps the line box at the same height for all labels.
     position:relative top:-0.35em visually raises the asterisk without affecting
     layout flow — so left and right column inputs align correctly. */
  vertical-align: baseline;
  position: relative;
  top: -0.35em;
  font-size: 0.75em;
}

/* All direct-child inputs/selects/textareas — exact prototype values */
.form-group > input[type="text"],
.form-group > input[type="email"],
.form-group > input[type="tel"],
.form-group > select,
.form-group > textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(10, 37, 117, 0.12);
  border-radius: 8px;
  padding: 7px 5px;
  font-size: 13px;
  font-family: var(--font-body);
  color: #0a2575;
  background: var(--color-white);
}

/* Keyboard focus: gold ring restored — outline: none removed from base rule so
   :focus-visible from base.css can apply, but explicit rule here ensures correct
   offset and overrides any specificity conflicts */
.form-group > input:focus-visible,
.form-group > select:focus-visible,
.form-group > textarea:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .form-group > input,
  .form-group > select,
  .form-group > textarea {
    transition: border-color 0.25s;
  }
}

.form-group > input:focus,
.form-group > select:focus,
.form-group > textarea:focus {
  box-shadow: 0 0 2px 2px rgba(10, 37, 117, 0.3);
  border-color: rgba(10, 37, 117, 0.35);
}

.form-group > input::placeholder,
.form-group > textarea::placeholder {
  color: rgba(10, 37, 117, 0.5);
  font-family: var(--font-body);
}

/* Textarea — prototype: height 60px, no resize */
.form-group > textarea {
  height: 60px;
  resize: none;
}

/* Fabric-type select — appearance: none normalises height to match text inputs.
   Native select adds internal browser height beyond padding; appearance:none removes
   that, making it render at exactly the same height as .form-group > input.
   Custom chevron added so the dropdown arrow is still visible. */
.form-group > select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' viewBox='0 0 10 6'%3E%3Cpath stroke='%230a2575' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px; /* room for chevron */
}

/* ── Phone wrap: country code dropdown + number input ──
   Rendered as a single cohesive field.
   Country code goes in the existing phone field's grid cell.
   Phone-wrap is NOT inside .form-group directly, so
   .form-group > select rules do NOT apply to .country-select.
   Border and radius match other form inputs exactly. ── */
.phone-wrap {
  display: flex;
  border: 1px solid rgba(10, 37, 117, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-white);
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  .phone-wrap { transition: border-color 0.25s; }
}

.phone-wrap:focus-within {
  box-shadow: 0 0 2px 2px rgba(10, 37, 117, 0.3);
  border-color: rgba(10, 37, 117, 0.35);
}

/* Country code select — compact chevron, no flags (Windows doesn't render emoji flags) */
.country-select {
  flex-shrink: 0;
  width: 65px;  /* code-only format (+91, +81 etc) — keeps phone-wrap symmetric with other inputs */
  border: none;
  border-right: 1px solid rgba(10, 37, 117, 0.12);
  background: transparent;
  padding: 7px 18px 7px 5px; /* right room for chevron */
  font-family: var(--font-body);
  font-size: 13px;
  color: #0a2575;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' fill='none' viewBox='0 0 8 5'%3E%3Cpath stroke='%230a2575' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M1 1l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

/* Phone number input — inside .phone-wrap */
.phone-number-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 5px;
  font-family: var(--font-body);
  font-size: 13px;
  color: #0a2575;
  outline: none;
  min-width: 0;
}

.phone-number-input::placeholder {
  color: rgba(10, 37, 117, 0.5);
  font-family: var(--font-body);
}

/* ── End form field styles ── */
