/* ==========================================================================
   home.css — homepage layout overrides
   Loaded AFTER styles/index.css and header.css. Switches the homepage from
   the original full-viewport swiper deck to a normal scrolling storefront
   page. Scoped under body.sp-home so nothing leaks onto other views that
   haven't been migrated yet.
   ========================================================================== */

body.sp-home {
  overflow: auto;
  height: auto;
  background: var(--sp-bg, #f5f6fa);
}

body.sp-home .overlay {
  position: static;
  background: none;
}

body.sp-home .main-container {
  position: static;
}

/* The original nav is absolutely positioned/fixed for the swiper layout;
   the new header lives in normal flow above .sp-main. */
body.sp-home .scrollable-container {
  height: auto;
}

.sp-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

/* ---------- Quick links bar ---------- */
.sp-quicklinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--sp-muted, #5b6478);
  padding: 0.75rem 0;
  margin-bottom: 1rem;
}

.sp-quicklinks strong {
  color: var(--sp-ink, #10182b);
  font-weight: 700;
  margin-right: 0.25rem;
}

.sp-quicklinks a {
  color: var(--sp-muted, #5b6478);
}

.sp-quicklinks a:hover {
  color: var(--sp-blue, #163c8c);
}

.sp-quicklinks .dot {
  color: #c7cce0;
}

/* ---------- Hero row: big banner + sidebar ---------- */
.sp-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  align-items: start;
}

/* Sidebar promo cards */
.sp-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sp-promo-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #eef1fb;
  border-radius: var(--sp-radius, 8px);
  padding: 1rem;
}

.sp-promo-icon {
  font-size: 2rem;
  flex: 0 0 auto;
}

.sp-promo-eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sp-blue, #163c8c);
  margin-bottom: 0.15rem;
}

.sp-promo-title {
  font-family: "Oswald", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--sp-ink, #10182b);
  margin: 0;
}

.sp-newsletter-card {
  background: #ffffff;
  border: 1px solid var(--sp-line, #e6e9f2);
  border-radius: var(--sp-radius, 8px);
  padding: 1.1rem;
}

.sp-newsletter-title {
  font-family: "Oswald", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--sp-ink, #10182b);
}

.sp-newsletter-copy {
  font-size: 0.85rem;
  color: var(--sp-muted, #5b6478);
  margin-bottom: 0.85rem;
}

.sp-newsletter-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.sp-newsletter-form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--sp-line, #e6e9f2);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
}

.sp-newsletter-form button {
  flex: 0 0 auto;
  border: none;
  background: var(--sp-blue, #163c8c);
  color: #fff;
  width: 40px;
  border-radius: 6px;
  cursor: pointer;
}

.sp-newsletter-form button:hover {
  background: var(--sp-blue-dark, #0f2c68);
}

.sp-newsletter-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--sp-muted, #5b6478);
}

.sp-newsletter-consent a {
  color: var(--sp-blue, #163c8c);
}

/* Newsletter card placements marked data-always-show="false" (e.g. the item
   page's desktop delivery column) are desktop-only by design -- the floating
   banner covers phone/tablet there instead. This mirrors the >1024px
   "laptop" breakpoint SP.device.getType() uses in sidebar.js, so the card
   doesn't flash visible on small screens before that script runs. */
@media (max-width: 1024px) {
  .sp-newsletter-card[data-always-show="false"] {
    display: none;
  }
}

/* ---------- Section headings (deals / stores / socials) ---------- */
body.sp-home .section-title {
  font-family: "Oswald", sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--sp-ink, #10182b);
  border-bottom: 2px solid var(--sp-ink, #10182b);
  padding-bottom: 0.6rem;
  margin: 2.5rem 0 1.25rem;
}

/* body-slide sections become plain blocks in normal flow */
body.sp-home .body-slide {
  height: auto;
}

/* ---------- Deals grid ----------
 * index.css's base .deals-grid sets a fixed `height: 90vh` +
 * `grid-template-rows: repeat(4, 25%)` sized for a full-viewport swiper
 * slide, and its own @media (max-width: 768px) block additionally forces
 * `grid-auto-flow: column` + `overflow-x: auto` -- a single horizontally
 * scrolling row, built for the old fixed-height mobile layout. On sp-home
 * pages the section is no longer a full-viewport swiper slide (see
 * ".body-slide { height: auto }" above), so this override replaces every
 * one of those properties -- including grid-auto-flow and overflow-x,
 * which earlier versions of this override missed, letting index.css's
 * single-row scroller win on mobile even though the column/row sizing
 * below it was already reset. Breakpoints here (1024px, 600px) are
 * deliberately matched to SP.device.getType()'s own phone/tablet/laptop
 * boundaries so the item count requested by scripts/deals.js and
 * scripts/items_public/all_deals.js always agrees with the column count
 * CSS actually renders.
 */
body.sp-home .deals-grid,
body.sp-home .stores-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: none;
  grid-auto-rows: 220px;
  grid-auto-flow: row;
  gap: 1rem;
  height: auto;
  overflow: visible;
  overflow-x: visible;
}

@media (max-width: 1024px) {
  body.sp-home .deals-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 180px;
    grid-auto-flow: row;
    overflow-x: visible;
  }
}

@media (max-width: 600px) {
  body.sp-home .deals-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
    grid-auto-flow: row;
    overflow-x: visible;
    gap: 0.6rem;
  }
}

body.sp-home .stores-grid {
  width: 75%;
  max-width: 1320px;
  margin: 0 auto;
  margin-bottom: 10px;
}

body.sp-home .deal-item,
body.sp-home .store-item {
  display: block;
  border-radius: var(--sp-radius, 8px);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--sp-line, #e6e9f2);
}

/* "See all deals" link appended after the teaser grid by deals.js */
body.sp-home .deals-see-all-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sp-red, #d92d20);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

body.sp-home .deals-see-all-link:hover {
  border-color: var(--sp-red, #d92d20);
}

body.sp-home .store-item {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: var(--sp-radius);
  background: var(--sp-bg);
  border: 1px solid var(--sp-line);
  text-decoration: none;
  text-align: center;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

body.sp-home .store-item .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

body.sp-home .store-icon {
  font-size: 3.5rem;
  color: var(--sp-red);
  margin-bottom: 0.3rem;
}

body.sp-home .store-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sp-ink);
  margin: 0;
}

body.sp-home .store-item:hover {
  border-color: var(--sp-red);
  box-shadow: 0 4px 12px var(--sp-shadow);
}

/* ---------- Footer ---------- */
body.sp-home .socials-footer {
  width: 100vw;
  right: 0;
  margin: 0;
  margin-left: -135px;
  margin-bottom: -50px;
  margin-top: 3rem;
  background: var(--sp-red-dark);
  padding: 1rem 3rem;
}

body.sp-home .socials-footer footer {
  background: var(--sp-red-darker);
  max-width: 1320px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

body.sp-home .socials-footer h5 {
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--sp-bg);
  margin-bottom: 0.6rem;
}

body.sp-home .socials-footer p {
  color: var(--sp-line);
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}

/* ---------- Swiper pagination not used on the normal-scroll homepage ---------- */
body.sp-home .swiper-pagination {
  display: none;
}

/* ---------- Hero (scripts/hero.js content) confined to the compact banner ----------
   index.css styles .hero-container/.hero-item/etc for a 100vh full-screen hero.
   These overrides re-contain that same markup (built dynamically by hero.js)
   inside the smaller .sp-hero-banner frame instead, without touching hero.js
   or index.css. */
body.sp-home .sp-hero-banner.hero-container {
  overflow: hidden;
}

/* index.css sizes .hero-item at 100vw/100vh for the old full-screen hero;
   pin it to fill the compact banner card instead. */
body.sp-home .sp-hero-banner .hero-item {
  width: 100% !important;
  height: 100% !important;
}

body.sp-home .sp-hero-banner .hero-image-container,
body.sp-home .sp-hero-banner .hero-image-container-inverse {
  position: absolute;
  inset: 0;
}

body.sp-home .sp-hero-banner .hero-image-container img,
body.sp-home .sp-hero-banner .hero-image-container-inverse img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover;
}

body.sp-home .sp-hero-banner .image-overlay {
  position: absolute !important;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(10, 20, 60, 0.6),
    rgba(10, 20, 60, 0) 55%
  );
}

/* Text block: index.css absolutely positions this at top:0/height:100%;
   re-anchor it to the bottom of the banner instead. */
body.sp-home .sp-hero-banner .hero-text,
body.sp-home .sp-hero-banner .hero-text-inverse {
  top: auto !important;
  bottom: 0;
  left: 0 !important;
  right: 0 !important;
  height: auto !important;
  padding: 0 2rem 2.25rem;
  z-index: 2;
}

body.sp-home .sp-hero-banner .hero-title,
body.sp-home .sp-hero-banner .hero-title-inverse {
  position: static !important;
  margin: 0 0 0.4rem !important;
  font-size: 1.5rem;
  color: #fff;
  text-shadow: none;
}

/* The paragraph description doesn't fit the compact banner; the sidebar
   promo cards and quick links carry that supporting copy instead. */
body.sp-home .sp-hero-banner .hero-info,
body.sp-home .sp-hero-banner .hero-info-inverse {
  position: static !important;
  width: auto !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  margin: 0 !important;
}

body.sp-home .sp-hero-banner .hero-info p,
body.sp-home .sp-hero-banner .hero-info-inverse p {
  display: none;
}

body.sp-home .sp-hero-banner .hero-btn,
body.sp-home .sp-hero-banner .hero-btn-inverse {
  position: static !important;
  display: inline-block;
  margin: 0 !important;
  background: var(--sp-blue, #163c8c);
  color: #fff;
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.7rem 1.6rem;
  border-radius: 4px;
  border: none;
}

body.sp-home .sp-hero-banner .hero-btn:hover,
body.sp-home .sp-hero-banner .hero-btn-inverse:hover {
  background: var(--sp-blue-dark, #0f2c68);
  color: #fff;
}

@media (max-width: 575px) {
  body.sp-home .sp-hero-banner .hero-text,
  body.sp-home .sp-hero-banner .hero-text-inverse {
    padding: 0 1rem 1.25rem;
  }

  body.sp-home .sp-hero-banner .hero-title,
  body.sp-home .sp-hero-banner .hero-title-inverse {
    font-size: 1.1rem;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .sp-hero-row {
    grid-template-columns: 1fr;
  }

  .sp-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sp-promo-card {
    flex: 1 1 240px;
  }

  .sp-newsletter-card {
    flex: 1 1 100%;
  }
  /* .sp-item-delivery-card {
    display: flex;
    padding: 0;
  }
  .sp-item-delivery-card .sp-item-delivery-row {
    flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.1rem 1rem;
  border-top: none;
  border-left: 1px solid var(--sp-line, #e6e9f2);
  } */

  body.sp-home .socials-footer {
    margin-left: -16px;
    margin-bottom: -50px;
    margin-top: 0.2rem;
    padding: 0.1rem 0.2rem;
  }

  body.sp-home .stores-grid {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    margin-bottom: 1rem;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  body.sp-home .store-item {
    padding: 0;
  }

  body.sp-home .store-item .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  body.sp-home .store-icon {
    font-size: 1.7rem;
    margin-bottom: 0.1rem;
  }

  body.sp-home .store-item h3 {
    font-size: 0.7rem;
  }
}

@media (max-width: 575px) {
  .sp-main {
    padding: 1rem 1rem 2.5rem;
  }

  .sp-hero-cta {
    left: 1rem;
    bottom: 1rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }

  .sp-sidebar {
    flex-direction: column;
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  body.sp-home .socials-footer {
    margin-left: -20px;
    margin-bottom: -50px;
    margin-top: 0.2rem;
    padding: 0.1rem 0.2rem;
  }
}

/* ---------- Sidebar: printing & badges promo cards replace delivery info on desktop/laptop ----------
   On desktop/laptop the delivery block moves out of the sidebar into its own
   full-width horizontal band below the hero row (see .sp-home-delivery-full
   below); two promo cards for jersey printing/badges sit here instead, still
   followed by the newsletter card. Below 991px (tablet/mobile) nothing here
   changes: the sidebar keeps showing the original delivery card + newsletter,
   exactly as before this change -- see the matching @media (max-width: 991px)
   block. */
.sp-sidebar-services {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sp-sidebar-delivery {
  display: none;
}

/* ---------- Full-width delivery band (desktop/laptop only) ----------
   Reuses item_delivery_info.ejs's own markup/classes, laid out horizontally
   across the full .sp-main width instead of stacked. Hidden below 992px --
   .sp-sidebar-delivery (unchanged) covers tablet/mobile instead. */
.sp-home-delivery-full {
  margin-top: 1.25rem;
}

.sp-home-delivery-full .sp-item-delivery-card {
  position: static;
  display: flex;
  align-items: stretch;
  padding: 0;
}

.sp-home-delivery-full .sp-item-delivery-row {
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* gap: 0.35rem; */
  padding: 1.1rem 1rem;
  border-top: none;
  border-left: 1px solid var(--sp-line, #e6e9f2);
}

.sp-home-delivery-full .sp-item-delivery-row:first-of-type {
  border-left: none;
  padding-left: 1rem;
  margin-top: 2rem;
}

.sp-home-delivery-full .sp-item-delivery-row:nth-of-type(2) {
  border-left: none;
  padding-left: 1rem;
  margin-top: 1rem;
}

.sp-home-delivery-full .sp-item-delivery-row i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 0;
  font-size: 22px;
}

/* bi-geo-alt-fill's pin shape reads as higher than the other icons even at
   an identical box position -- nudge it down slightly to match */
.sp-home-delivery-full .bi-geo-alt-fill {
  transform: translateY(3px);
}

@media (max-width: 768px) {
  .sp-sidebar-services {
    display: none;
  }

  .sp-sidebar-delivery {
    display: block;
  }

  .sp-home-delivery-full {
    display: none;
  }
}

@media (min-width: 768px) {
  .sp-home-delivery-full {
    display: block;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  /* Tablet: hero/sidebar is stacked (1 column), so the sidebar's own
     delivery card is still visible too. Hide it here specifically so
     delivery info doesn't show twice on tablet. */
  .sp-sidebar-services {
    display: none;
  }
  .sp-sidebar-delivery {
    display: none;
  }
}

/* ---------- Compact variant chips (order canvas -- labels only) ---------- */
  .sp-order-variant-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--sp-bg-soft, #f4f4f5);
    border: 1px solid var(--sp-line, #e5e7eb);
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
    transition:
      border-color 0.15s ease,
      background 0.15s ease,
      box-shadow 0.15s ease;
    user-select: none;
  }

  .sp-order-variant-chip:hover {
    border-color: var(--sp-ink, #10182b);
  }

  .sp-order-variant-chip.sp-order-variant-card--selected {
    border-color: var(--sp-red, #e31e24);
    background: rgba(227, 30, 36, 0.06);
    box-shadow: 0 0 0 1px var(--sp-red, #e31e24);
  }

  .sp-order-variant-chip__label {
    font-weight: 600;
  }

  .sp-order-variant-chip__price {
    font-size: 12px;
    color: var(--sp-muted, #6b7280);
  }

  .sp-order-variant-chip__check {
    font-size: 11px;
    color: var(--sp-muted, #6b7280);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .sp-order-variant-chip.sp-order-variant-card--selected
    .sp-order-variant-chip__check {
    color: var(--sp-red, #e31e24);
  }

  /* ---------- Variants table (details offcanvas) ---------- */
  .sp-order-variants-table {
    font-size: 13px;
    margin-bottom: 0;
  }

  .sp-order-variants-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--sp-muted, #6b7280);
    font-weight: 700;
    border-bottom-color: var(--sp-line, #e5e7eb);
  }

  .sp-order-variants-table td {
    vertical-align: top;
  }
  .sp-order-variants-table__muted {
    color: var(--sp-muted, #6b7280);
  }

/* ==========================================================================
   Cart actions (Continue Shopping / Proceed to Checkout)
   Appears inside #orderOffcanvas once the customer adds an item to the
   cart -- hidden via d-none until then (see item_page.js / 
   item_variants_canvas.js). Column on phones, row from tablet upward.
   ========================================================================== */
.order-cart-actions {
  border-top-color: var(--sp-line);
}

.order-cart-actions__buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Tablet and up: side-by-side */
@media (min-width: 768px) {
  .order-cart-actions__buttons {
    flex-direction: row;
  }

  /* Equal widths, both filling available space */
  .order-cart-actions__btn {
    flex: 1 1 0;
  }
}

/* Shared button base */
.order-cart-actions__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: var(--sp-radius);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

.order-cart-actions__btn:active {
  transform: scale(0.98);
}

.order-cart-actions__btn:focus-visible {
  outline: 2px solid var(--sp-ink);
  outline-offset: 2px;
}

/* Primary — Proceed to Checkout, brand red */
.order-cart-actions__btn--primary {
  background: var(--sp-red);
  border-color: var(--sp-red);
  color: #fff;
}

.order-cart-actions__btn--primary:hover {
  background: var(--sp-red-dark);
  border-color: var(--sp-red-dark);
  color: #fff;
}

/* Secondary — Continue Shopping, outline style */
.order-cart-actions__btn--secondary {
  background: transparent;
  border-color: var(--sp-line);
  color: var(--sp-ink);
}

.order-cart-actions__btn--secondary:hover {
  background: var(--sp-bg-soft);
  border-color: var(--sp-muted);
  color: var(--sp-ink);
}

/* ---------- Quantity stepper (order canvas) ---------- */
.sp-order-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sp-order-qty__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--sp-ink);
  margin: 0;
}

.sp-order-qty__stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  overflow: hidden;
  background: var(--sp-bg);
}

.sp-order-qty__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--sp-ink);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.sp-order-qty__btn:hover {
  background: var(--sp-bg-soft);
  color: var(--sp-red);
}

.sp-order-qty__btn:active {
  background: var(--sp-line);
}

.sp-order-qty__btn:focus-visible {
  outline: 2px solid var(--sp-red);
  outline-offset: -2px;
}

.sp-order-qty__input {
  width: 56px;
  border: none;
  border-left: 1px solid var(--sp-line);
  border-right: 1px solid var(--sp-line);
  background: transparent;
  color: var(--sp-ink);
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  padding: 0 4px;
  -moz-appearance: textfield; /* hide Firefox spin buttons */
}

.sp-order-qty__input:focus {
  outline: none;
}

/* Hide the browser's native number spin buttons in WebKit/Blink --
   the +/- buttons on either side do the job more visibly. */
.sp-order-qty__input::-webkit-outer-spin-button,
.sp-order-qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}