/**
 * GenOffer Storefront Base Styles
 * Base styles for all storefront pages
 */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base body styles */
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #111827;
  background-color: #ffffff;
}

/* Landing page container */
.landing-page {
  min-height: 100vh;
}

/* Image defaults */
img {
  max-width: 100%;
  height: auto;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Button animations */
button,
a.cta-button {
  transition: transform 0.2s, box-shadow 0.2s;
}

button:hover,
a.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/*
 * Touch devices have no real hover state: a tap leaves :hover STUCK on the
 * element until the visitor taps something else, so the lift + shadow above
 * stays painted around whatever was last tapped and reads as a stray
 * bordered box drawn on the page (reported on the checkout's Order summary
 * accordion - the shadow outlines the full-width strip and the -2px lift
 * peels it off the panel behind it). Desktop is untouched: (hover: none)
 * only matches pointers that cannot hover.
 */
@media (hover: none) {
  button:hover,
  a.cta-button:hover {
    transform: none;
    box-shadow: none;
  }
}

/* Checkout page layout - constrain width */
.genoffer-checkout-products,
.genoffer-address-form,
.genoffer-order-summary,
.genoffer-payment-form {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/*
 * Shopify-style checkout (ShopifyCheckoutLayout, class .sc-layout) owns a
 * single authoritative horizontal inset for every block in its layout:
 * `hPadding`/`sidebarInset` on desktop, the `stackedInset` prop (applied to
 * .sc-layout-main/.sc-layout-side/.sc-layout-side-footer) once it stacks
 * below the mobile breakpoint. AddressForm/PaymentForm always render with
 * the .genoffer-address-form/.genoffer-payment-form classes above regardless
 * of `fieldStyle`, so without this override two things double up with that
 * owned inset inside .sc-layout: the max-width:680px here re-centers the
 * block (with unwanted margin:auto) once the stacked column - which can be
 * wider than 680px in the fluid range between the mobile and desktop
 * breakpoints - exceeds it, and the mobile margin rule further below adds
 * its own 16px on top. Both push fields/submit button in further than
 * sibling blocks like section headings or NoticeBanner, at different
 * amounts depending on viewport width - the exact left/right-margin
 * inconsistency this rule (and its mobile-scoped twin below) fixes. This is
 * a normal (non-media) rule so its higher specificity - two classes vs. one
 * - wins over both the rule above and the mobile-only rule below regardless
 * of viewport. Scoped to descendants of .sc-layout only, so the default
 * (non-Shopify) checkout variant above - still live on other merchant
 * checkout templates - is completely unaffected.
 */
.sc-layout .genoffer-checkout-products,
.sc-layout .genoffer-address-form,
.sc-layout .genoffer-order-summary,
.sc-layout .genoffer-payment-form {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

/* Checkout page container */
[data-page-type="CHECKOUT"] .landing-page > div,
body.checkout-page .landing-page > div {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Responsive adjustments for checkout */
@media (max-width: 768px) {
  .genoffer-checkout-products,
  .genoffer-address-form,
  .genoffer-order-summary,
  .genoffer-payment-form {
    margin-left: 16px;
    margin-right: 16px;
  }
}

/*
 * Same double-inset bug as the .sc-layout rule above, in the plain Puck
 * checkout: Columns (.puck-columns-inner) hard-codes `padding: Npx 16px`, so
 * every block dropped in a column already sits 16px off the page edge. The
 * mobile rule above then adds another 16px to these four - and only these
 * four - so on a phone the address/payment fields land 32px in while their
 * siblings in the same column (OldExpressCheckout, OldProductSelector's
 * cards, coupon input) sit at 16px. Measured on a live 390px checkout: form
 * blocks 32..358, everything else 16..374. Nothing wants a second gutter
 * inside a container that already owns one, so drop it there; blocks placed
 * outside a Columns wrapper keep the 16px above as their only gutter. Two
 * classes vs. one wins on specificity regardless of order.
 */
@media (max-width: 768px) {
  .puck-columns-inner .genoffer-checkout-products,
  .puck-columns-inner .genoffer-address-form,
  .puck-columns-inner .genoffer-order-summary,
  .puck-columns-inner .genoffer-payment-form {
    margin-left: 0;
    margin-right: 0;
  }
}

/*
 * Second half of the same alignment: with the double margin gone the form
 * BLOCKS line up with their siblings, but the fields inside them are still
 * inset by the component's own `padding` prop (24px by default) while the
 * blocks they sit beside - OldProductSelector's cards, which bleed out over
 * that same padding, and the coupon row - run edge to edge. On a phone that
 * 24px is the difference between a field and the card behind it, and it reads
 * as the field being too narrow rather than as padding. Vertical padding is
 * untouched, and desktop keeps the inset, where the extra width is not needed
 * and the breathing room looks deliberate.
 *
 * `!important` is required, not decorative: both components set `padding` as
 * an inline style from an operator-editable prop, which no stylesheet
 * selector can outrank.
 */
@media (max-width: 768px) {
  .puck-columns-inner .genoffer-address-form,
  .puck-columns-inner .genoffer-payment-form {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Form input focus states */
.genoffer-address-form input:focus,
.genoffer-address-form select:focus,
.genoffer-payment-form input:focus,
.genoffer-payment-form select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Spreedly iframe container styles */
#spreedly-number,
#spreedly-cvv {
  position: relative;
}

#spreedly-number iframe,
#spreedly-cvv iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  position: absolute;
  top: 0;
  left: 0;
}

/* Draft Preview Banner */
.draft-preview-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: white;
  padding: 8px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  z-index: 99999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
