/*
 * Sleepbetter.Baby v3.6.12
 * Mobile purchase flow: direct Buy Now, true full-width cart and checkout,
 * and the consultant roster as a calm two-column grid instead of a slider.
 */

/* ------------------------------------------------------------------ */
/* 1) Product page on phones: one decisive Buy Now                    */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
  /* The fixed bottom bar sells with a single large Buy Now. Add to Cart
     stays available inside the purchase card above. */
  body.sbb-theme-v3612.single-product .sbb-pdp-sticky-cart-form,
  body.sbb-theme-v3612.single-product
    .sbb-pdp-sticky-purchase-v350__form
    > form.sbb-pdp-sticky-cart-form.cart {
    display: none;
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-sticky-purchase-v350__form {
    grid-template-columns: minmax(0, 1fr);
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-sticky-purchase-v350 {
    min-height: 74px;
    grid-template-columns: minmax(78px, .52fr) minmax(0, 1.48fr);
    gap: .6rem;
    padding: .62rem .65rem .62rem .95rem;
  }

  /* Older layers hid the price on small phones because two buttons needed
     the room; with a single Buy Now the price fits again. */
  body.sbb-theme-v3612.single-product .sbb-pdp-sticky-purchase-v350__summary {
    display: grid;
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-sticky-purchase-v350__summary strong {
    font-size: 1.02rem;
  }

  body.sbb-theme-v3612.single-product
    .sbb-pdp-sticky-purchase-v350__form
    button.sbb-pdp-sticky-purchase-v350__buy.button {
    min-height: 54px;
    border-color: var(--sbb-commerce-cocoa, #624837);
    background: var(--sbb-commerce-cocoa, #624837);
    color: #fff;
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .012em;
    box-shadow: 0 12px 26px rgba(63, 44, 34, .24);
  }

  body.sbb-theme-v3612.single-product
    .sbb-pdp-sticky-purchase-v350__form
    button.sbb-pdp-sticky-purchase-v350__buy.button:hover {
    border-color: var(--sbb-commerce-cocoa-deep, #493529);
    background: var(--sbb-commerce-cocoa-deep, #493529);
  }

  /* Purchase card: Buy Now first and largest; Add to Cart is the quiet
     secondary path underneath. */
  body.sbb-theme-v3612.single-product .sbb-pdp-primary-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: .5rem;
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-primary-actions > .sbb-pdp-buy-now-form {
    order: -1;
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-primary-actions .sbb-pdp-direct-buy.button {
    min-height: 56px;
    border-color: var(--sbb-commerce-cocoa, #624837);
    background: var(--sbb-commerce-cocoa, #624837);
    color: #fff;
    font-size: .9rem;
    box-shadow: 0 14px 30px rgba(63, 44, 34, .2);
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-primary-actions .sbb-pdp-direct-buy.button:hover {
    border-color: var(--sbb-commerce-cocoa-deep, #493529);
    background: var(--sbb-commerce-cocoa-deep, #493529);
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-primary-actions .single_add_to_cart_button.button {
    min-height: 48px;
  }

  /* Hero fills the phone: single side gutter instead of a doubled one,
     and the duplicate price strip leaves the sticky bar to do its job. */
  body.sbb-theme-v3612.single-product .sbb-pdp-ebook-hero {
    padding: calc(var(--sbb-header-height) + 1.15rem) 1rem 2rem;
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-ebook-hero__inner {
    width: 100%;
    gap: 1.35rem;
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-hero-commerce-v350 {
    display: none;
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-ebook-hero__cover {
    width: min(62vw, 290px);
    margin-inline: auto;
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-ebook-hero__copy h1 {
    margin-bottom: .5rem;
    font-size: clamp(2rem, 8.6vw, 2.7rem);
  }

  body.sbb-theme-v3612.single-product .sbb-pdp-hero-assurances-v320 {
    margin-top: .85rem;
  }

  /* Every product section shares the same calm 1rem gutter. */
  body.sbb-theme-v3612.single-product .sbb-pdp-ebook-purchase__inner,
  body.sbb-theme-v3612.single-product :where(
    .sbb-pdp-ebook-benefits,
    .sbb-pdp-book-intro-v330,
    .sbb-pdp-preview-v320,
    .sbb-pdp-audience-v320,
    .sbb-pdp-ebook-detail,
    .sbb-pdp-policy-v320
  ),
  body.sbb-theme-v3612 .sbb-pdp-related-v320 {
    width: calc(100% - 2rem);
  }
}

/* ------------------------------------------------------------------ */
/* 2) Cart and checkout: fill the phone width without clipping        */
/* ------------------------------------------------------------------ */

/* The hero's two-column template kept reserving 300px for a hidden image,
   pushing copy and the step indicator outside the rounded card. */
@media (max-width: 920px) {
  body.sbb-theme-v3612:is(.woocommerce-cart, .woocommerce-checkout) .sbb-commerce-hero-v320 {
    grid-template-columns: minmax(0, 1fr);
  }

  body.sbb-theme-v3612 .sbb-commerce-hero-v320__copy {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  /* All three purchase steps stay visible — no cut-off horizontal slider. */
  body.sbb-theme-v3612:is(.woocommerce-cart, .woocommerce-checkout)
    .sbb-commerce-progress-v320
    ol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .3rem;
    overflow: visible;
    padding-bottom: 0;
  }

  body.sbb-theme-v3612:is(.woocommerce-cart, .woocommerce-checkout)
    .sbb-commerce-progress-v320
    li {
    min-width: 0;
    min-height: 46px;
    flex: none;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: .32rem;
    padding: .32rem .38rem;
  }

  body.sbb-theme-v3612:is(.woocommerce-cart, .woocommerce-checkout)
    .sbb-commerce-progress-v320
    li
    > span {
    width: 20px;
    height: 20px;
    font-size: .56rem;
  }

  body.sbb-theme-v3612:is(.woocommerce-cart, .woocommerce-checkout)
    .sbb-commerce-progress-v320
    li
    strong {
    font-size: .56rem;
    line-height: 1.18;
    white-space: normal;
  }
}

@media (max-width: 768px) {
  /* Cart line cards label every value even if WooCommerce core styles
     are unavailable. */
  body.sbb-theme-v3612.woocommerce-cart
    .woocommerce
    table.shop_table_responsive.cart
    tr.cart_item
    > td:where(.product-price, .product-quantity, .product-subtotal)::before {
    margin-right: .4rem;
    content: attr(data-title) ": ";
  }

  /* One big, thumb-friendly step at the end of each screen. */
  body.sbb-theme-v3612.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
    display: inline-flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    font-size: .92rem;
  }

  body.sbb-theme-v3612.woocommerce-checkout #place_order {
    width: 100%;
    min-height: 56px;
    font-size: .95rem;
  }

  body.sbb-theme-v3612.woocommerce-checkout .woocommerce ul.payment_methods {
    margin: 0 0 1.1rem;
    padding: 0;
    list-style: none;
  }

  body.sbb-theme-v3612.woocommerce-checkout .woocommerce #order_review table.shop_table {
    width: 100%;
  }

  /* The disabled Update-cart row reads as a quiet utility, not a CTA. */
  body.sbb-theme-v3612.woocommerce-cart
    .woocommerce
    table.shop_table_responsive.cart
    tr:last-child
    td.actions
    .button[name="update_cart"] {
    min-height: 46px;
    font-size: .78rem;
  }
}

/* ------------------------------------------------------------------ */
/* 3) Consultants on phones: the whole team in two columns            */
/* ------------------------------------------------------------------ */

@media (max-width: 520px) {
  .sbb-theme-v3612 .sbb-consultant-grid,
  .sbb-theme-v3612 .sbb-page--consultants-archive .sbb-consultant-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    overflow: visible;
    margin-inline: 0;
    padding: 0;
    scroll-snap-type: none;
  }

  /* Cards return to the desktop anatomy: portrait on top, text below.
     The former sideways split was made for the removed one-card slider. */
  .sbb-theme-v3612 .sbb-consultant-card {
    display: flex;
    width: auto;
    flex: none;
    flex-direction: column;
    grid-template-columns: none;
  }

  .sbb-theme-v3612 .sbb-consultant-card > button {
    display: block;
    width: 100%;
  }

  .sbb-theme-v3612 .sbb-consultant-card__image {
    grid-row: auto;
    min-height: 0;
    aspect-ratio: 4 / 5;
  }

  .sbb-theme-v3612 .sbb-consultant-card__content {
    align-content: start;
    padding: .66rem .7rem .2rem;
  }

  .sbb-theme-v3612 .sbb-consultant-card__content strong {
    font-size: 1.02rem;
    line-height: 1.15;
  }

  .sbb-theme-v3612 .sbb-consultant-card__content em {
    margin-top: .14rem;
    font-size: .6rem;
    line-height: 1.3;
  }

  .sbb-theme-v3612 .sbb-consultant-card__content > span {
    margin-top: .3rem;
    font-size: .68rem;
    line-height: 1.45;
  }

  .sbb-theme-v3612 .sbb-consultant-card__profile-link {
    margin: .1rem .7rem .7rem;
    font-size: .66rem;
  }
}
