/* AJ & CO v2 — small fix-ups layered on top of the original ajco.css / style.css.
   The static design's stylesheets are copied verbatim; anything v2 needs goes here. */

/* Admin toolbar pushes the sticky header down for logged-in admins. */
html.cms-ab-on body { padding-top: 36px; }
html.cms-ab-on .ib-header { top: 36px; }

/* Local card simulator (null gateway) */
.ib-sim-card { max-width: 520px; margin: 0 auto; }

/* Checkout: numbered step headings (contact → address → delivery → payment → review). */
.ib-step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: .4rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: .7rem;
  line-height: 1;
  vertical-align: .1em;
}

/* Policy pages on phones: the single grid column was `1fr`, whose min-content width is the
   whole scrolling tab row — so the page itself scrolled sideways. Let the nav scroll instead. */
@media (max-width: 767.98px) {
  .ib-policy-layout { grid-template-columns: minmax(0, 1fr); }
  .ib-policy-aside { min-width: 0; }
}

/* Sign-in / register on phones: .row.g-5 has 1.5rem negative margins but the container only
   pads .75rem, which pushed the page 12px wider than the screen. */
@media (max-width: 575.98px) {
  .ib-section--tight .row.g-5 { --bs-gutter-x: 1.5rem; }
}

/* Mobile menu: a plain link (e.g. Home) is not an accordion, so no chevron. */
.ib-mobile-nav a.accordion-button::after { display: none; }

/* ---- Small-screen fixes (responsive sweep, 320–414px) -------------------------------- */

/* Announcement bar: a fixed 34px height clipped the line when it wraps on phones. */
@media (max-width: 575.98px) {
  .ib-announce { height: auto; min-height: var(--ib-bar-h); padding: .35rem 0; line-height: 1.45; letter-spacing: .1em; }
}

/* Home layout 2 hero: the 3.2rem floor made "Remembered" wider than a 320–375px screen. */
@media (max-width: 575.98px) {
  .h2-delivered-hero h1 { font-size: clamp(2.35rem, 12.5vw, 3.2rem); max-width: none; }
}

/* Footer on phones: the Instagram divider is only meaningful beside the copyright line,
   and the Sign Up button must not wrap. */
@media (max-width: 575.98px) {
  .ib-footer-v1-bottom .ib-social { padding-right: 0; border-right: 0; }
  .ib-footer-v1-signup .btn { white-space: nowrap; padding-inline: .9rem; letter-spacing: .1em; }
}

/* Home layout 3 hero: same 3.2rem floor problem — "compromise." ran off a 320px screen and the
   .92 line-height let the last line sit on the paragraph below. */
@media (max-width: 575.98px) {
  .h3-hero .h3-display { font-size: clamp(2.3rem, 11.5vw, 3.2rem); line-height: 1; max-width: none; margin-bottom: 1.1rem; }
}

/* Section heads (title + "See all …" link): let the link drop under the title on phones
   instead of running off the right edge. */
@media (max-width: 575.98px) {
  .ib-section-head { flex-wrap: wrap; column-gap: 1.5rem; row-gap: .75rem; }
}

/* Announcement bar on tablets (768–991px): handle, status pill, message and Contact ran into
   each other. Space them, and drop the Instagram handle there (it is in the footer). */
.ib-announce > .container { gap: 1rem; }
@media (min-width: 768px) and (max-width: 991.98px) {
  .ib-announce { letter-spacing: .1em; }
  .ib-announce > .container > span:first-child > a[target="_blank"] { display: none; }
}

/* Two-up category tiles on small phones: 1.5rem padding + 1.25rem titles left ~92px for
   "Women's Jewellery", so long words poked out of the tile. */
@media (max-width: 399.98px) {
  .ib-tile-body { padding: 1rem .85rem; }
  .ib-tile-body strong { font-size: 1.05rem; overflow-wrap: anywhere; }
  .ib-tile-body em { font-size: .6875rem; letter-spacing: .06em; }
}

/* iOS Safari zooms the page when a focused field's text is under 16px (the design uses 14px).
   iOS only, so the design is unchanged everywhere else. */
@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
}

/* FAQ search: the whole 52px underlined row is the field, not just the 22px text line. */
.ib-faq-search input { align-self: stretch; }

/* Product page, desktop: the lead photo sits in a 4:3 box; `cover` cut the top and bottom off
   square studio shots (pendants lost their bail). Show the whole piece instead. */
@media (min-width: 992px) {
  .ib-pdp-gallery img:first-child { object-fit: contain; }
}

/* Footer credit on phones: it wraps onto its own line, where the leading "·" separates nothing. */
@media (max-width: 575.98px) {
  .ib-footer-credit .ib-footer-sep { display: none; }
}

/* Gallery items are selected by JS, not a horizontal strip. Keep controls visible
   below the selected image on every breakpoint, with comfortable touch targets. */
.ib-pdp-gallery { display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; gap: 0; }
.ib-pdp-gallery [data-gallery-item] { grid-column: 1 / -1; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.ib-pdp-gallery [data-gallery-item][hidden] { display: none !important; }
.ib-gallery-dots { display: flex; flex-wrap: wrap; gap: 0; padding-top: .5rem; }
.ib-gallery-dots button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: transparent; }
.ib-gallery-dots button::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ib-line); transition: background .2s, transform .2s; }
.ib-gallery-dots button[aria-pressed="true"]::after { background: var(--ib-ink); transform: scale(1.3); }
.ib-gallery-dots button:focus-visible { outline: 2px solid var(--ib-ink); outline-offset: -6px; }
.ib-buybar { z-index: 1030; }
.ib-buybar[hidden] { display: none !important; }
.ib-phone-row { display: flex; gap: .5rem; }
.ib-phone-row .ib-phone-country { flex: 0 0 45%; width: 45%; padding-right: 1.8rem; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%23333' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .6rem center; }
.ib-phone-row input { flex: 1; min-width: 0; }
.ib-phone-row.is-enhanced .ib-phone-country { display: none; }
.ib-phone-row .iti { width: 100%; min-width: 0; --iti-border-color: var(--ib-line); --iti-border-radius: 0; }
.ib-phone-row .iti input { width: 100%; }
.ib-phone-row .iti__country-container { padding: 1px; }
.ib-phone-row .iti__selected-country { padding-inline: .75rem; }
.ib-phone-row .iti__dropdown-content { max-width: calc(100vw - 2rem); }
.ib-phone-row .iti__search-input { min-height: 44px; border-bottom: 1px solid var(--ib-line); }
.ib-phone-row .iti__country { min-height: 44px; }
.ib-phone-row .iti.is-invalid { outline: 1px solid #b42318; outline-offset: -1px; }
.ajco-field-error { display: block; margin-top: .375rem; color: #b42318; font-size: .8125rem; line-height: 1.35; }
.form-control.is-invalid, .form-check-input.is-invalid { border-color: #b42318; }
.ib-form-errors { border-radius: 0; font-size: .875rem; }
@media (max-width: 991.98px) {
  .ib-pdp-gallery [data-gallery-item], .ib-pdp-gallery img:first-child { aspect-ratio: 1; object-fit: contain; }
  body.ib-buybar-visible { padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); }
  body.ib-has-tabbar.ib-buybar-visible { padding-bottom: calc(10rem + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 575.98px) {
  .ib-header-inner { gap: .5rem; }
  .ib-header .ib-icon-btn { flex: 0 0 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .ib-gallery-dots button::after { transition: none; }
}
