/**
 * Mobile responsive fixes — load AFTER beauty-swiss.css
 * Fixes: horizontal overflow, 2-up product carousels + arrows,
 * menu above header, mini-cart fit, section crop.
 */

html {
  overflow-x: clip;
  max-width: 100%;
}

body.bs-store,
.bs-store {
  overflow-x: clip !important;
  max-width: 100%;
  width: 100%;
  position: relative;
}

#main-content,
.bs-home,
.bs-section,
.bs-container {
  max-width: 100%;
  box-sizing: border-box;
}

.bs-container {
  padding-left: 16px !important;
  padding-right: 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Prevent 100vw scrollbar bugs */
.bs-mini-cart__panel,
.bs-drawer__panel,
.bs-promo,
.bs-header {
  max-width: 100%;
}

/* ─── Mobile menu above everything ─── */
.bs-drawer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 5000 !important;
}
.bs-drawer__backdrop {
  z-index: 1;
}
.bs-drawer__panel {
  z-index: 2;
  width: min(320px, 86vw) !important;
  max-width: 100vw;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.bs-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--bs-text, #282c3f);
  cursor: pointer;
  flex-shrink: 0;
}
.bs-drawer__head {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  padding-top: 4px;
}

/* ─── Mini cart fits the screen ─── */
.bs-mini-cart__overlay {
  z-index: 5100 !important;
}
.bs-mini-cart__panel {
  z-index: 5110 !important;
  width: min(380px, 100%) !important;
  max-width: 100% !important;
  height: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  right: 0 !important;
  left: auto !important;
  box-sizing: border-box !important;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 480px) {
  .bs-mini-cart__panel {
    width: 100% !important;
    max-width: 100% !important;
  }
  .bs-mini-cart__head {
    padding: 14px 16px !important;
  }
  .bs-mini-cart__body {
    padding: 10px 12px 16px !important;
  }
  .bs-mini-cart__foot {
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom)) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .bs-mini-cart__foot .bs-btn,
  .bs-mini-cart__btn {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 14px !important;
  }
  .bs-mini-cart__item {
    padding: 10px !important;
    gap: 10px !important;
  }
}

/* ─── Homepage product carousels: larger 2-up cards + overlay arrows ─── */
@media (max-width: 767.98px) {
  .bs-product-carousel {
    position: relative;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
  }

  .bs-product-carousel__track,
  .bs-home .bs-product-carousel__track,
  .bs-scroll-row.bs-product-carousel__track {
    gap: 12px !important;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .bs-product-carousel__track > .bs-product,
  .bs-product-carousel__track > .bs-product--sb,
  .bs-home .bs-product-carousel__track > .bs-product,
  .bs-home .bs-product-carousel__track > .bs-product--sb,
  .bs-home .bs-scroll-row > .bs-product--sb {
    flex: 0 0 calc((100% - 12px) / 2) !important;
    width: calc((100% - 12px) / 2) !important;
    max-width: calc((100% - 12px) / 2) !important;
    min-width: 0 !important;
    scroll-snap-align: start;
  }

  /* Arrows overlay on top of product cards */
  .bs-product-carousel__arrow {
    display: flex !important;
    width: 36px !important;
    height: 36px !important;
    top: 38% !important;
    transform: translateY(-50%);
    z-index: 5 !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid rgba(40, 44, 63, 0.1) !important;
    box-shadow: 0 4px 14px rgba(40, 44, 63, 0.16) !important;
  }
  .bs-product-carousel__arrow--prev {
    left: 6px !important;
  }
  .bs-product-carousel__arrow--next {
    right: 6px !important;
  }

  .bs-home .bs-product--sb .bs-product__body {
    padding: 10px 10px 12px !important;
  }
  .bs-home .bs-product--sb .bs-product__name {
    font-size: 13px !important;
    min-height: 2.5em;
  }
  .bs-home .bs-product--sb .bs-product__price-current {
    font-size: 15px !important;
  }
  .bs-home .bs-product--sb .bs-product__cart-btn {
    padding: 10px 8px !important;
    font-size: 11px !important;
  }
}

/* ─── Stop section / row crop & horizontal scroll ─── */
@media (max-width: 767.98px) {
  .bs-section {
    overflow-x: clip !important;
    overflow-y: visible;
    padding-left: 0;
    padding-right: 0;
  }

  .bs-section__decor {
    display: none !important; /* blobs cause soft crop feel */
  }

  .bs-section__head {
    gap: 8px;
    align-items: flex-start;
  }

  .bs-home-cats__track,
  .bs-scroll-row,
  .mb-video-carousel__track,
  .bs-reviews-carousel__track {
    max-width: 100%;
  }

  .bs-promo__inner {
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 8px !important;
  }

  .bs-promo__locale-name {
    display: none !important;
  }

  .bs-header__grid {
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 8px !important;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
  }

  /* Hero / banners */
  .bs-hero,
  .bs-hero__slider,
  .bs-hero__slide,
  .bs-banner,
  img {
    max-width: 100%;
  }

  .bs-hero__slide img,
  .bs-hero img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  /* Hide hero CTA button on mobile */
  .bs-hero__content .bs-btn,
  .bs-hero__overlay .bs-btn {
    display: none !important;
  }
}

/* Lock body scroll when drawers open (optional helper class) */
body.bs-drawer-open,
body.bs-cart-open,
body.bs-auth-modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* Auth modal above header + drawers */
.bs-auth-modal {
  z-index: 6000 !important;
}

/* ─── Cart / Wishlist / Checkout — no right-side crop ─── */
.cart-checkout-page,
.bs-cart-page,
.bs-wishlist-page,
.bs-checkout {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: clip;
  min-width: 0;
}

.cart-checkout-layout,
.cart-checkout-layout--checkout,
.bs-cart-main,
.cart-summary-panel,
.cart-checkout-main,
.bs-checkout__main,
.bs-checkout__form,
.checkout-card,
.bs-cart-card,
.bs-wishlist-card,
.cart-summary-card,
.bs-cart-list,
.bs-wishlist-list,
.bs-checkout__cart-list,
.fomo-offer-strip,
.coupon-box,
.coupon-input-row {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 767.98px) {
  .bs-store .cart-checkout-page {
    padding: 1.15rem 12px 2.5rem !important;
  }

  .bs-store .cart-checkout-header {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1.15rem;
  }

  .bs-store .cart-checkout-title {
    font-size: 1.35rem;
    word-break: break-word;
  }

  .bs-store .cart-checkout-subtitle {
    font-size: 12px;
    max-width: 100%;
  }

  .bs-store .cart-checkout-layout,
  .bs-store .cart-checkout-layout--checkout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.15rem !important;
    width: 100%;
  }

  .bs-store .checkout-card,
  .bs-store .auth-card {
    padding: 1rem 12px !important;
    border-radius: 10px;
    overflow: hidden;
  }

  .bs-store .bs-cart-card,
  .bs-store .bs-wishlist-card {
    padding: 0 !important;
  }

  .bs-store .bs-cart-card__head {
    padding: 1rem 12px 0 !important;
  }

  .bs-store .checkout-section-title,
  .bs-store .cart-summary-title {
    font-size: 1rem;
    word-break: break-word;
  }

  /* Cart line: image + body, price on its own row */
  .bs-store .bs-cart-item {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    grid-template-areas:
      "image body"
      "price price" !important;
    gap: 10px 12px !important;
    padding: 14px 12px !important;
    align-items: start !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .bs-store .bs-cart-item__image {
    grid-area: image;
    width: 64px !important;
    height: 78px !important;
  }

  .bs-store .bs-cart-item__body {
    grid-area: body;
    min-width: 0 !important;
    overflow: hidden;
  }

  .bs-store .bs-cart-item__name,
  .bs-store .bs-cart-item__name a {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .bs-store .bs-cart-item__price {
    grid-area: price;
    text-align: left !important;
    padding-left: calc(64px + 12px);
    align-self: start !important;
  }

  .bs-store .bs-cart-item__actions {
    gap: 8px 10px !important;
    margin-top: 6px;
    width: 100%;
    max-width: 100%;
  }

  .bs-store .bs-cart-item__actions .cart-action-link,
  .bs-store .cart-action-link {
    font-size: 11px;
    white-space: normal;
  }

  .bs-store .cart-qty-control {
    flex-shrink: 0;
  }

  .bs-store .cart-qty-control button {
    width: 30px;
    height: 30px;
  }

  /* Wishlist */
  .bs-store .bs-wishlist-item {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    grid-template-areas:
      "image body"
      "actions actions" !important;
    gap: 10px 12px !important;
    padding: 14px 12px !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .bs-store .bs-wishlist-item__image {
    width: 64px !important;
    height: 78px !important;
  }

  .bs-store .bs-wishlist-item__name,
  .bs-store .bs-wishlist-item__name a,
  .bs-store .bs-wishlist-item__brand {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .bs-store .bs-wishlist-item__actions {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .bs-store .bs-wishlist-item__btn {
    width: 100% !important;
    flex: none !important;
    white-space: normal !important;
    padding: 12px 14px !important;
    font-size: 12px !important;
  }

  .bs-store .bs-wishlist-item__remove {
    width: 100%;
    text-align: center;
  }

  /* Checkout compact cart lines */
  .bs-store .cart-line-item,
  .bs-store .cart-line-item--compact {
    display: flex;
    gap: 10px !important;
    padding: 12px 0 !important;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .bs-store .cart-line-item-image,
  .bs-store .cart-line-item-image--sm {
    width: 56px !important;
    height: 68px !important;
    flex-shrink: 0;
  }

  .bs-store .cart-line-item-body {
    min-width: 0 !important;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .bs-store .cart-line-item-top {
    flex-wrap: wrap;
    gap: 4px 10px !important;
  }

  .bs-store .cart-line-item-name {
    flex: 1 1 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .bs-store .cart-line-item-price {
    font-size: 14px;
  }

  .bs-store .cart-line-item-actions {
    gap: 8px 10px !important;
    max-width: 100%;
  }

  .bs-store .checkout-form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  .bs-store .checkout-field,
  .bs-store .input-theme,
  .bs-store select.input-theme,
  .bs-store textarea.input-theme {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .bs-store .checkout-payment-option {
    padding: 12px !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .bs-store .checkout-payment-option__label {
    flex-wrap: wrap;
    min-width: 0;
  }

  .bs-store .bs-checkout__checkbox {
    max-width: 100%;
  }

  .bs-store .bs-checkout__checkbox span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .bs-store .bs-checkout__barcode {
    max-width: 100%;
    overflow: hidden;
  }

  .bs-store .bs-checkout__qr {
    max-width: 100%;
    height: auto;
  }

  .bs-store .cart-summary-row,
  .bs-store .cart-summary-total {
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .bs-store .cart-summary-row span,
  .bs-store .cart-summary-total span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .bs-store .cart-summary-row.muted span:last-child {
    text-align: right;
    max-width: 58%;
  }

  .bs-store .btn-primary,
  .bs-store .bs-checkout__submit {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .bs-store .coupon-apply-btn {
    min-width: 4.25rem;
    padding: 11px 12px !important;
  }

  .bs-store .fomo-offer-strip {
    margin: 0 0 1.15rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .bs-store .fomo-offer-strip-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 0.85rem !important;
    padding: 0.9rem 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .bs-store .fomo-offer-strip-text {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .bs-store .fomo-offer-strip-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    white-space: normal;
    line-height: 1.3;
    padding: 0.25rem 0.55rem;
    font-size: 0.62rem !important;
    letter-spacing: 0.06em;
  }

  .bs-store .fomo-offer-strip-title {
    font-size: 0.98rem !important;
    line-height: 1.3 !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
  }

  .bs-store .fomo-offer-strip-message {
    font-size: 0.78rem !important;
    max-width: 100% !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .bs-store .fomo-offer-strip-meta {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 10px 12px !important;
    margin-top: 0.7rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .bs-store .fomo-offer-meta-item {
    min-width: 0 !important;
    max-width: 100%;
  }

  .bs-store .fomo-offer-meta-label {
    font-size: 0.6rem !important;
  }

  .bs-store .fomo-offer-meta-value {
    font-size: 0.88rem !important;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal !important;
  }

  .bs-store .fomo-offer-countdown {
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 1 !important;
    align-items: center !important;
    box-sizing: border-box;
  }

  .bs-store .fomo-countdown-clock--hero {
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.45rem 0.75rem !important;
  }

  .bs-store .fomo-countdown-hero-value {
    font-size: 1.2rem !important;
    letter-spacing: 0.05em;
  }

  .bs-store .fomo-offer-countdown-hint {
    max-width: 100%;
    padding: 0 4px;
    overflow-wrap: anywhere;
  }

  .bs-store .fomo-summary-row {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .bs-store .fomo-summary-row-inner {
    gap: 0.5rem !important;
  }

  .bs-store .fomo-summary-row-left,
  .bs-store .fomo-summary-row-right {
    min-width: 0;
    max-width: 100%;
  }

  .bs-store .fomo-summary-code,
  .bs-store .fomo-summary-save {
    overflow-wrap: anywhere;
  }

  /* Related products on cart — keep inside page */
  .bs-store .bs-cart-related {
    margin-top: 2rem;
    padding-top: 1.5rem;
    max-width: 100%;
    overflow-x: clip;
  }

  .bs-store .bs-cart-related .bs-section__head {
    flex-wrap: wrap;
    margin-bottom: 1rem;
  }

  .bs-store .bs-cart-related .bs-product-carousel {
    margin: 0 !important;
    max-width: 100%;
    overflow: hidden;
  }

  .bs-store .bs-cart-related .bs-product-carousel__arrow--prev {
    left: 4px !important;
  }

  .bs-store .bs-cart-related .bs-product-carousel__arrow--next {
    right: 4px !important;
  }

  .bs-store .bs-cart-empty,
  .bs-store .bs-wishlist-empty {
    padding: 2rem 1rem !important;
  }

  .bs-store .bs-cart-empty__btn,
  .bs-store .bs-wishlist-empty__btn {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
  }
}

/* Extra-narrow phones */
@media (max-width: 379.98px) {
  .bs-store .cart-checkout-page {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .bs-store .bs-cart-item__price {
    padding-left: 0;
  }

  .bs-store .checkout-card,
  .bs-store .auth-card {
    padding: 0.9rem 10px !important;
  }

  .bs-store .fomo-offer-strip-inner {
    padding: 0.85rem 10px !important;
  }

  .bs-store .fomo-offer-strip-meta {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }
}

/* ─── PDP mobile: full-bleed purchase bar + primary coupon headers ─── */
@media (max-width: 767.98px) {
  .bs-store .bs-pdp .bs-container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .bs-store .bs-pdp__purchase {
    position: sticky;
    bottom: 0;
    z-index: 30;
    width: calc(100% + 24px) !important;
    max-width: none !important;
    margin-left: -12px !important;
    margin-right: -12px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom)) !important;
    background: #fff !important;
    border-top: 1px solid #f0e8ec;
    border-radius: 0 !important;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.06);
    box-sizing: border-box !important;
  }

  .bs-store .bs-coupon-card__top,
  .bs-store .bs-coupon-card--orange .bs-coupon-card__top,
  .bs-store .bs-coupon-card--pink .bs-coupon-card__top,
  .bs-store .bs-coupon-card--rose .bs-coupon-card__top {
    background: var(--bs-pink, var(--color-primary, #CA9C46)) !important;
    background-image: none !important;
  }
}
