/* ---------------------------------------------------------------------------
 * Granzia — Phase 2 fixes (favorites/compare state, cart mobile, shipping,
 * login drawer). Loaded globally after the main stylesheet so these overrides
 * win without editing the large pre-existing CSS files.
 * ------------------------------------------------------------------------- */

/* === (2) Compare icon active state — mirrors the wishlist heart ===
 * The compare button already toggles `.is-active`; it just had no styling, so
 * clicking looked like nothing happened. Give it a tinted circle + navy icon. */
.fp-compare.is-active {
  background: rgba(0, 59, 145, 0.12);
  border-radius: 50%;
}
.fp-compare.is-active .g-icon {
  background: #003b91; /* .g-icon fills its mask with `background` */
}
.fp-compare.is-active img {
  filter: invert(17%) sepia(97%) saturate(1900%) hue-rotate(205deg);
}

/* === (3) Cart mobile alignment — stop price overlapping the title ===
 * The base cart item uses fixed pixel heights (.cart-item 150px, __content
 * 126px, __top 48px) and 454px/627px widths. On a narrow screen a long Arabic
 * title wraps past the fixed 48px top box and collides with the price row that
 * sits at a fixed offset below it. Letting everything size to its content makes
 * title → price → quantity stack cleanly. */
@media (max-width: 767px) {
  .cart-page .cart-item,
  .cart-page .cart-item__content,
  .cart-page .cart-item__top,
  .cart-page .cart-item__copy,
  .cart-page .cart-item__bottom {
    height: auto;
    min-height: 0;
  }
  .cart-page .cart-item {
    width: auto;
    max-width: 100%;
    align-items: start;
  }
  .cart-page .cart-item__content {
    width: auto;
    min-width: 0;
  }
  .cart-page .cart-item__top {
    width: auto;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
  }
  .cart-page .cart-item__copy {
    width: auto;
    min-width: 0;
  }
  .cart-page .cart-item h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .cart-page .cart-item__bottom {
    width: auto;
    margin-top: 12px;
  }
}

/* === (5) Login drawer — render social buttons, kill dead gap, fix scroll ===
 * Root cause: the drawer paints in wp_footer so Nextend's own layout CSS never
 * loads; the theme styled `.nsl-button` but not the button wrappers, so the
 * social block collapsed (invisible buttons + reserved gap), and the flex body
 * lacked `min-height:0`, so it couldn't scroll to the end. */

/* Robust scroll model: fixed header, the BODY is the single scroll container
 * and fills the remaining height. `min-height:0` lets the flex body actually
 * shrink+scroll (the classic "scrolling stops before the end" fix). Dynamic
 * viewport height keeps it correct on mobile browser chrome. */
.gz-login-drawer__panel {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.gz-login-drawer__head {
  flex: 0 0 auto;
}
.gz-login-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 24px;
}

/* Our own social buttons (granzia_render_social_buttons) — self-contained, so
 * they don't depend on Nextend's front-end CSS/JS rendering. Brand colour +
 * icon + label, 46px, full width, stacked. */
.gz-login-drawer__social {
  min-height: 0;
}
.gz-social-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.gz-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 46px;
  border-radius: 10px;
  font-family: var(--font-primary, "Cairo", sans-serif);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.gz-social:hover {
  filter: brightness(0.96);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}
.gz-social__icon {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.gz-social__icon svg {
  display: block;
}
.gz-social--facebook { background: #1877f2; color: #fff; }
.gz-social--google { background: #fff; color: #1f1f1f; border: 1px solid #e0e0e0; }
.gz-social--twitter,
.gz-social--x { background: #000; color: #fff; }

/* === Find-us map: crisp "G" pin mark + branded marker clusters ===
 * The pin now shows only the "G" letter (find-us.js). Force a clean geometric
 * G so it stays legible at pin scale regardless of the Arabic display font. */
.gz-pin__g {
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 0;
}

/* Marker clusters (Leaflet.markercluster): navy circle + white count, matching
 * the brand instead of the plugin's default green/yellow/orange. */
.gz-cluster-wrap {
  background: none;
  border: 0;
}
.gz-cluster {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 47, 135, 0.92);
  color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-weight: 800;
}
.gz-cluster span {
  font-size: 14px;
  line-height: 1;
}
