/**
 * Ira Wear — Page Styles (v3.0 — Elementor Widget Build)
 *
 * Lightweight overrides for Elementor-rendered pages.
 * All page layouts are handled by Elementor widgets — this file only provides:
 *   1. Elementor widget font/color overrides for brand consistency
 *   2. WhatsApp floating button
 *   3. Minor tweaks that Elementor inline styles can't handle
 */

/* ══════════════════════════════════════════════════════════
   ELEMENTOR — Brand Font Overrides
   Ensure headings use our brand fonts even when Elementor
   doesn't inline the font-family on every widget.
   ══════════════════════════════════════════════════════════ */

.elementor-widget-heading .elementor-heading-title {
  font-family: var(--ira-font-heading, 'Playfair Display', serif);
}

.elementor-widget-text-editor {
  font-family: var(--ira-font-body, 'Inter', sans-serif);
}

.elementor-widget-icon-box .elementor-icon-box-title {
  font-family: var(--ira-font-heading, 'Playfair Display', serif);
}

/* Accent text — italic Cormorant Garamond for subtitles */
.elementor-widget-text-editor em,
.elementor-widget-text-editor i {
  font-family: var(--ira-font-accent, 'Cormorant Garamond', serif);
}

/* ══════════════════════════════════════════════════════════
   ELEMENTOR — Section & Widget Spacing Tweaks
   ══════════════════════════════════════════════════════════ */

/* Ensure full-width sections stretch properly */
.elementor-section.elementor-section-full_width > .elementor-container {
  max-width: 100%;
}

/* Counter widget — ensure number displays inline with suffix */
.elementor-widget-counter .elementor-counter-number-wrapper {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

/* Star rating widget — gold stars */
.elementor-widget-star-rating .elementor-star-rating i {
  color: var(--ira-secondary, #C9A96E);
}

/* Accordion widget — cleaner styling */
.elementor-widget-accordion .elementor-accordion-item {
  border: 1px solid var(--ira-border, #E8E2DA);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.elementor-widget-accordion .elementor-tab-title {
  font-family: var(--ira-font-body, 'Inter', sans-serif);
  font-weight: 600;
  color: var(--ira-text-dark, #1A1A1A);
}

.elementor-widget-accordion .elementor-tab-title a {
  color: inherit;
  text-decoration: none;
}

.elementor-widget-accordion .elementor-tab-content {
  font-family: var(--ira-font-body, 'Inter', sans-serif);
  color: var(--ira-text-medium, #555555);
  line-height: 1.75;
}

/* ══════════════════════════════════════════════════════════
   ELEMENTOR — Button Overrides
   ══════════════════════════════════════════════════════════ */

.elementor-widget-button .elementor-button {
  font-family: var(--ira-font-body, 'Inter', sans-serif);
  transition: all 0.3s ease;
}

.elementor-widget-button .elementor-button:hover {
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════
   ELEMENTOR — Divider Widget
   ══════════════════════════════════════════════════════════ */

.elementor-widget-divider .elementor-divider-separator {
  border-color: var(--ira-secondary, #C9A96E);
}

/* ══════════════════════════════════════════════════════════
   ELEMENTOR — WooCommerce Shortcode Product Grid
   ══════════════════════════════════════════════════════════ */

.elementor-widget-shortcode .woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.elementor-widget-shortcode .woocommerce ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
}

/* ══════════════════════════════════════════════════════════
   WHATSAPP FLOATING BUTTON
   ══════════════════════════════════════════════════════════ */

.ira-whatsapp-float {
  position: fixed;
  bottom: 88px;
  right: 32px;
  z-index: 9998;
}

.ira-whatsapp-float__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: #25D366;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}

.ira-whatsapp-float__btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37,211,102,0.5);
}

.ira-whatsapp-float__btn svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   CARD GRID — Column Gaps for Card Sections
   Uses :has() to target inner section flex containers that
   hold our card columns, adding visible gaps between them.
   ══════════════════════════════════════════════════════════ */

/* Collection card grid: 20px gap between card columns */
.elementor-inner-section > .elementor-container:has(> .ira-collection-card-col) {
  gap: 20px !important;
}

/* Occasion card grid: 20px gap between card columns */
.elementor-inner-section > .elementor-container:has(> .ira-occasion-card-col) {
  gap: 20px !important;
}

/* Row gap between collection card rows is handled via Elementor margin (20px) */

/* Reviews grid: 24px gap between review card columns */
.elementor-element-4c4ba26 > .elementor-container {
  gap: 24px !important;
}

/* Weaving traditions grid: 24px gap between columns (ID-based since no card classes) */
.elementor-element-42b3cfd > .elementor-container {
  gap: 24px !important;
}

/* ══════════════════════════════════════════════════════════
   COLLECTION & OCCASION CARD COLUMNS
   Native Elementor columns with background images + overlays
   ══════════════════════════════════════════════════════════ */

.ira-collection-card-col,
.ira-occasion-card-col {
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  border-radius: 12px;
}

/* Desktop min-heights — portrait cards matching the reference screenshots */
.ira-collection-card-col {
  min-height: 500px !important;
}
.ira-occasion-card-col {
  min-height: 400px !important;
}

.ira-collection-card-col:hover,
.ira-occasion-card-col:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(45,45,45,0.16);
}

/* Ensure heading links inside cards look clean */
.ira-collection-card-col .elementor-heading-title a,
.ira-occasion-card-col .elementor-heading-title a {
  color: #FFFFFF !important;
  text-decoration: none;
}

.ira-collection-card-col .elementor-heading-title a:hover,
.ira-occasion-card-col .elementor-heading-title a:hover {
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════
   ASTRA MINI-CART POPUP — Fix title/close-button overlap
   The remove (×) button is position:absolute right:0.
   Add right padding to the cart item so product title text
   doesn't run underneath the × button.
   ══════════════════════════════════════════════════════════ */

.ast-site-header-cart .widget_shopping_cart .woocommerce-mini-cart-item {
  padding-right: 28px !important;
}

/* Ensure the product title text doesn't overflow */
.ast-site-header-cart .widget_shopping_cart .woocommerce-mini-cart-item > a:not(.remove) {
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ══════════════════════════════════════════════════════════
   WPFORMS — Newsletter Form (inline layout)
   Email field + Subscribe button on a single row, centred.
   Uses the custom form_class "ira-newsletter-form" set in
   WPForms settings so it only targets the newsletter form.
   ══════════════════════════════════════════════════════════ */

.ira-newsletter-form {
  max-width: 520px;
  margin: 0 auto;
}

.ira-newsletter-form .wpforms-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: center;
}

/* Email field takes available space */
.ira-newsletter-form .wpforms-field-container {
  flex: 1 1 250px;
  min-width: 250px;
}

/* Remove default field margins */
.ira-newsletter-form .wpforms-field {
  padding: 0 !important;
  margin: 0 !important;
}

/* Email input — match original inline style */
.ira-newsletter-form .wpforms-field-email input[type="email"] {
  width: 100%;
  padding: 14px 18px !important;
  border: 1px solid #D4C5B0 !important;
  border-radius: 4px !important;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: #FFFFFF;
  outline: none;
}

.ira-newsletter-form .wpforms-field-email input[type="email"]:focus {
  border-color: var(--ira-primary, #800020) !important;
  box-shadow: 0 0 0 3px rgba(128,0,32,0.1);
}

/* Submit button sits beside the email */
.ira-newsletter-form .wpforms-submit-container {
  flex: 0 0 auto;
  padding: 0 !important;
  margin: 0 !important;
}

.ira-newsletter-form .wpforms-submit-container button[type="submit"] {
  padding: 14px 30px !important;
  background: var(--ira-primary, #800020) !important;
  color: #FFFFFF !important;
  border: none;
  border-radius: 4px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}

.ira-newsletter-form .wpforms-submit-container button[type="submit"]:hover {
  background: var(--ira-primary-dark, #5C0017) !important;
  transform: translateY(-2px);
}

/* Hide WPForms branding/powered-by if present */
.ira-newsletter-form .wpforms-recaptcha-container,
.ira-newsletter-form .wpforms-field-hp {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════
   WPFORMS — Brand Styling Overrides
   ══════════════════════════════════════════════════════════ */

.wpforms-container .wpforms-form .wpforms-field-label {
  font-family: var(--ira-font-body, 'Inter', sans-serif);
  font-weight: 600;
  color: var(--ira-text-dark, #1A1A1A);
}

.wpforms-container .wpforms-form input[type="text"],
.wpforms-container .wpforms-form input[type="email"],
.wpforms-container .wpforms-form input[type="tel"],
.wpforms-container .wpforms-form select,
.wpforms-container .wpforms-form textarea {
  font-family: var(--ira-font-body, 'Inter', sans-serif);
  border: 1px solid var(--ira-border, #E8E2DA);
  border-radius: 8px;
  padding: 12px 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.wpforms-container .wpforms-form input:focus,
.wpforms-container .wpforms-form select:focus,
.wpforms-container .wpforms-form textarea:focus {
  border-color: var(--ira-primary, #800020);
  box-shadow: 0 0 0 3px rgba(128,0,32,0.1);
  outline: none;
}

.wpforms-container .wpforms-submit-container button[type="submit"],
.wpforms-container .wpforms-submit-container .wpforms-submit {
  background: var(--ira-primary, #800020) !important;
  color: #FFFFFF !important;
  font-family: var(--ira-font-body, 'Inter', sans-serif) !important;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: none;
  border-radius: 4px;
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.wpforms-container .wpforms-submit-container button[type="submit"]:hover,
.wpforms-container .wpforms-submit-container .wpforms-submit:hover {
  background: var(--ira-primary-dark, #5C0017) !important;
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Elementor Page Overrides
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Product grid: 2 columns on tablet */
  .elementor-widget-shortcode .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* WhatsApp button: smaller on mobile */
  .ira-whatsapp-float {
    bottom: 72px;
    right: 20px;
  }

  .ira-whatsapp-float__btn {
    width: 46px;
    height: 46px;
  }

  .ira-whatsapp-float__btn svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 767px) {
  /* Collection card columns: reduce min-height on mobile */
  .ira-collection-card-col {
    min-height: 350px !important;
  }
  .ira-occasion-card-col {
    min-height: 280px !important;
  }

  /* Reduce grid gaps on mobile */
  .elementor-inner-section > .elementor-container:has(> .ira-collection-card-col),
  .elementor-inner-section > .elementor-container:has(> .ira-occasion-card-col) {
    gap: 12px !important;
  }
  /* Row gap between collection card rows handled via Elementor margin */
  .elementor-element-42b3cfd > .elementor-container,
  .elementor-element-4c4ba26 > .elementor-container {
    gap: 16px !important;
  }
}

@media (max-width: 480px) {
  /* Product grid: 1 column on small mobile */
  .elementor-widget-shortcode .woocommerce ul.products {
    grid-template-columns: 1fr;
  }

  /* Newsletter form: stack vertically on small screens */
  .ira-newsletter-form .wpforms-form {
    flex-direction: column;
    align-items: stretch;
  }
  .ira-newsletter-form .wpforms-submit-container button[type="submit"] {
    width: 100%;
  }
}
