/**
 * Asma tenant — shop, PDP, cart, checkout commerce UI.
 * Scoped via html[data-storefront-template='asma-shop'].
 */

html[data-storefront-template='asma-shop'] {
  --asma-brand: #3bb77e;
  --asma-brand-dark: #2da86a;
  --asma-ink: #253d4e;
  --asma-muted: #7e879c;
  --asma-line: rgba(59, 183, 126, 0.15);
  --asma-radius: 16px;
  --asma-shadow: 0 8px 28px rgba(37, 61, 78, 0.08);
}

/* Native cart controls: keyboard-operable and independent of the legacy anchor-only rules. */
html[data-storefront-template='asma-shop'] .asma-cart-page .detail-qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 110px;
  padding: 4px;
}
html[data-storefront-template='asma-shop'] .asma-cart-page .detail-qty > button,
html[data-storefront-template='asma-shop'] .asma-cart-page .action > button {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 36px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #23784f;
  cursor: pointer;
}
html[data-storefront-template='asma-shop'] .asma-cart-page button:focus-visible {
  outline: 2px solid #23784f;
  outline-offset: 3px;
}
html[data-storefront-template='asma-shop'] .asma-cart-page .detail-qty > button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ── Wider commerce containers ───────────────────────────────── */
@media (min-width: 992px) {
  html[data-storefront-template='asma-shop'] #main-content .main > .container,
  html[data-storefront-template='asma-shop'] #main-content .main .page-header .container {
    max-width: min(1320px, 94vw);
  }
}

@media (min-width: 1400px) {
  html[data-storefront-template='asma-shop'] #main-content .main > .container,
  html[data-storefront-template='asma-shop'] #main-content .main .page-header .container {
    max-width: min(1440px, 92vw);
  }
}

/* ── Scroll-to-top — snappy visibility (no jQuery fade lag) ─── */
html[data-storefront-template='asma-shop'] #scrollUp {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease !important;
  will-change: opacity, transform;
}

html[data-storefront-template='asma-shop'] #scrollUp.asma-scroll-visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

html[data-storefront-template='asma-shop'] #scrollUp.asma-scroll-visible,
html[data-storefront-template='asma-shop'] #scrollUp[style*='display: block'] {
  display: flex !important;
}

/* ── Page headers & breadcrumbs ──────────────────────────────── */
html[data-storefront-template='asma-shop'] .main .page-header {
  background: transparent;
  border-bottom: none;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .archive-header {
  position: relative;
  overflow: hidden;
  border-radius: var(--asma-radius);
  border: 1px solid var(--asma-line);
  padding: clamp(1.75rem, 3.5vw, 2.75rem) clamp(1.5rem, 3vw, 2.5rem);
  background:
    linear-gradient(135deg, rgba(240, 253, 244, 0.96) 0%, rgba(255, 255, 255, 0.92) 52%, rgba(248, 252, 249, 0.96) 100%),
    url('/uploads/asma/shop/sidebar-filter-bg.webp') center / cover no-repeat;
  box-shadow: var(--asma-shadow);
}

html[data-storefront-template='asma-shop'] .asma-shop-page .archive-header::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--asma-brand), #29a065, var(--asma-brand));
  opacity: 0.85;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .archive-header .tags-list li a {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--asma-line);
  box-shadow: none;
}

html[data-storefront-template='asma-shop'] .main .page-header h1,
html[data-storefront-template='asma-shop'] .main .archive-header h1 {
  color: var(--asma-ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}

html[data-storefront-template='asma-shop'] .main .breadcrumb a {
  color: var(--asma-muted);
}

html[data-storefront-template='asma-shop'] .main .breadcrumb a:hover {
  color: var(--asma-brand);
}

/* ── Shop listing ─────────────────────────────────────────────── */
html[data-storefront-template='asma-shop'] .asma-shop-page .shop-product-fillter {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--asma-line);
  border-radius: var(--asma-radius);
  background: #fff;
  box-shadow: var(--asma-shadow);
}

html[data-storefront-template='asma-shop'] .asma-shop-page .shop-product-fillter .totall-product p {
  margin: 0;
  color: var(--asma-muted);
}

html[data-storefront-template='asma-shop'] .asma-shop-page .shop-product-fillter .totall-product strong {
  color: var(--asma-brand);
}

html[data-storefront-template='asma-shop'] .asma-shop-page .tags-list li a {
  border-radius: 999px;
  padding: 0.35rem 0.875rem;
  border: 1px solid var(--asma-line);
  transition: all 0.2s ease;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .tags-list li.active a,
html[data-storefront-template='asma-shop'] .asma-shop-page .tags-list li a:hover {
  background: var(--asma-brand);
  border-color: var(--asma-brand);
  color: #fff !important;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid .product-cart-wrap,
html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid .product-cart-wrap {
  border: 1px solid var(--asma-line);
  border-radius: var(--asma-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--asma-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid .product-cart-wrap:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(59, 183, 126, 0.14);
}

html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid .product-img-action-wrap {
  background: linear-gradient(145deg, #f0fdf4, #fff);
}

html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid .product-img-action-wrap .product-img img {
  object-fit: contain !important;
  padding: 0.75rem;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid .product-content-wrap {
  padding: 0.875rem 1rem 1.125rem;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid .product-content-wrap h2 {
  font-size: 0.9375rem;
  line-height: 1.35;
  font-weight: 700;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid .product-price > span {
  color: var(--asma-brand);
  font-weight: 700;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid .add-cart .add {
  border-radius: 999px;
  font-weight: 600;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .pagination .page-link {
  border-radius: 10px;
  min-width: 40px;
  text-align: center;
  border-color: var(--asma-line);
  color: var(--asma-ink);
}

html[data-storefront-template='asma-shop'] .asma-shop-page .pagination .page-item.active .page-link {
  background: var(--asma-brand);
  border-color: var(--asma-brand);
}

/* ── Shop sidebar ────────────────────────────────────────────── */
html[data-storefront-template='asma-shop'] .asma-shop-page .primary-sidebar .sidebar-widget {
  border: 1px solid var(--asma-line);
  border-radius: var(--asma-radius);
  background: #fff;
  box-shadow: var(--asma-shadow);
  padding: 1.25rem !important;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .primary-sidebar .section-title.style-1 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--asma-ink);
  border-bottom: 1px solid rgba(59, 183, 126, 0.1);
  padding-bottom: 0.75rem;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .primary-sidebar .product-sidebar.bg-grey {
  background: #f8fcf9 !important;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .primary-sidebar.sticky-sidebar {
  position: sticky;
  top: calc(88px + env(safe-area-inset-top, 0px));
  align-self: flex-start;
  z-index: 2;
  max-height: calc(100vh - 104px - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid.asma-shop-grid > [class*='col-'],
html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid.asma-shop-grid > .asma-shop-grid-item,
html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid.asma-shop-grid > .asma-shop-grid-item {
  padding-left: 0;
  padding-right: 0;
  min-width: 0;
}

html[data-storefront-template='asma-shop'] .asma-catalog-page > .mb-10.text-center h1 {
  color: #253d4e;
  font-weight: 800;
}

@media (min-width: 992px) {
  html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid.asma-shop-grid,
  html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid.asma-shop-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
    --bs-gutter-x: 0;
  }

  html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid.asma-shop-grid > [class*='col-'],
  html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid.asma-shop-grid > .asma-shop-grid-item,
  html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid.asma-shop-grid > [class*='col-'],
  html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid.asma-shop-grid > .asma-shop-grid-item {
    flex: none !important;
    max-width: none !important;
    width: auto !important;
  }
}

html[data-storefront-template='asma-shop'] .asma-sidebar-promo--instagram {
  position: relative;
}

html[data-storefront-template='asma-shop'] .asma-sidebar-promo--instagram::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(37, 61, 78, 0.05) 0%, rgba(37, 61, 78, 0.72) 100%);
  z-index: 1;
  pointer-events: none;
}

html[data-storefront-template='asma-shop'] .asma-sidebar-promo--instagram .banner-text {
  display: flex !important;
  flex-direction: column;
  justify-content: flex-end;
  inset: 0;
  padding: 1rem 1.125rem !important;
  z-index: 2;
}

html[data-storefront-template='asma-shop'] .asma-sidebar-promo--instagram .banner-text span {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 0.35rem;
}

html[data-storefront-template='asma-shop'] .asma-sidebar-promo--instagram .banner-text h4 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
}

html[data-storefront-template='asma-shop'] .asma-sidebar-promo--instagram .banner-text .text-brand {
  color: #b8f5d4 !important;
}

html[data-storefront-template='asma-shop'] .asma-shop-page .primary-sidebar .banner-img.asma-sidebar-promo,
html[data-storefront-template='asma-shop'] .main.sara-pdp .primary-sidebar .banner-img.asma-sidebar-promo {
  position: relative;
  display: block;
  padding: 0;
  height: auto !important;
  min-height: 0 !important;
  background: none !important;
  border-radius: var(--asma-radius);
  overflow: hidden;
  box-shadow: var(--asma-shadow);
}

html[data-storefront-template='asma-shop'] .asma-sidebar-promo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

html[data-storefront-template='asma-shop'] .asma-sidebar-promo .banner-text {
  display: none !important;
}

html[data-storefront-template='asma-shop'] .asma-sidebar-promo--instagram .banner-text {
  display: flex !important;
}

/* ── Product detail (PDP) ────────────────────────────────────── */
html[data-storefront-template='asma-shop'] .main.sara-pdp {
  background: #fff;
}

html[data-storefront-template='asma-shop'] .main.sara-pdp .sara-pdp-detail {
  border: 1px solid var(--asma-line);
  border-radius: calc(var(--asma-radius) + 4px);
  padding: clamp(1rem, 2vw, 1.5rem);
  background: #fff;
  box-shadow: var(--asma-shadow);
}

html[data-storefront-template='asma-shop'] .main.sara-pdp .primary-sidebar .sidebar-widget {
  border: 1px solid var(--asma-line);
  border-radius: var(--asma-radius);
  box-shadow: var(--asma-shadow);
}

html[data-storefront-template='asma-shop'] .main.sara-pdp .sara-pdp-related .product-cart-wrap {
  border: 1px solid var(--asma-line);
  border-radius: var(--asma-radius);
  box-shadow: var(--asma-shadow);
}

html[data-storefront-template='asma-shop'] .main.sara-pdp .sara-pdp-related .product-img img {
  object-fit: contain !important;
  padding: 0.5rem;
}

/* ── Cart ─────────────────────────────────────────────────────── */
html[data-storefront-template='asma-shop'] .asma-cart-page .table-wishlist {
  border: 1px solid var(--asma-line);
  border-radius: var(--asma-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--asma-shadow);
}

html[data-storefront-template='asma-shop'] .asma-cart-page .table-wishlist thead {
  background: #f8fcf9;
}

html[data-storefront-template='asma-shop'] .asma-cart-page .table-wishlist th {
  font-weight: 700;
  color: var(--asma-ink);
  border: none;
}

html[data-storefront-template='asma-shop'] .asma-cart-page .table-wishlist td {
  vertical-align: middle;
  border-color: rgba(59, 183, 126, 0.08);
}

html[data-storefront-template='asma-shop'] .asma-cart-page .cart-totals,
html[data-storefront-template='asma-shop'] .asma-cart-page .shopping-summery {
  border: 1px solid var(--asma-line);
  border-radius: var(--asma-radius);
  background: #fff;
  box-shadow: var(--asma-shadow);
  padding: 1.5rem;
}

html[data-storefront-template='asma-shop'] .asma-cart-page .cart-totals h4,
html[data-storefront-template='asma-shop'] .asma-cart-page .shopping-summery h4 {
  font-weight: 800;
  color: var(--asma-ink);
}

html[data-storefront-template='asma-shop'] .asma-cart-page .btn,
html[data-storefront-template='asma-shop'] .asma-checkout-page .btn {
  border-radius: 999px;
  font-weight: 700;
}

html[data-storefront-template='asma-shop'] .asma-cart-page .btn:hover,
html[data-storefront-template='asma-shop'] .asma-checkout-page .btn:hover {
  transform: translateY(-1px);
}

/* ── Checkout ─────────────────────────────────────────────────── */
html[data-storefront-template='asma-shop'] .asma-checkout-page .billing-form,
html[data-storefront-template='asma-shop'] .asma-checkout-page .payment {
  border: 1px solid var(--asma-line);
  border-radius: var(--asma-radius);
  background: #fff;
  box-shadow: var(--asma-shadow);
  padding: clamp(1.25rem, 2vw, 1.75rem);
}

html[data-storefront-template='asma-shop'] .asma-checkout-page .payment h4,
html[data-storefront-template='asma-shop'] .asma-checkout-page .billing-form h4 {
  font-weight: 800;
  color: var(--asma-ink);
  margin-bottom: 1.25rem;
}

html[data-storefront-template='asma-shop'] .asma-checkout-page .form-control,
html[data-storefront-template='asma-shop'] .asma-checkout-page .form-select {
  border-radius: 12px;
  border-color: rgba(37, 61, 78, 0.12);
}

html[data-storefront-template='asma-shop'] .asma-checkout-page .form-control:focus,
html[data-storefront-template='asma-shop'] .asma-checkout-page .form-select:focus {
  border-color: var(--asma-brand);
  box-shadow: 0 0 0 3px rgba(59, 183, 126, 0.15);
}

html[data-storefront-template='asma-shop'] .asma-checkout-page .order_table {
  border: 1px solid var(--asma-line);
  border-radius: var(--asma-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--asma-shadow);
}

html[data-storefront-template='asma-shop'] .asma-checkout-page .payment_option .custome-radio .form-check-label {
  border-radius: 12px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(37, 61, 78, 0.1);
  transition: border-color 0.2s ease;
}

html[data-storefront-template='asma-shop'] .asma-checkout-page .payment_option .custome-radio input:checked + .form-check-label {
  border-color: var(--asma-brand);
  background: rgba(59, 183, 126, 0.06);
}

/* ── Checkout success ─────────────────────────────────────────── */
html[data-storefront-template='asma-shop'] .asma-checkout-success {
  padding: clamp(3rem, 8vw, 5rem) 1rem;
  text-align: center;
}

html[data-storefront-template='asma-shop'] .asma-checkout-success-card {
  max-width: 520px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3rem);
  border: 1px solid var(--asma-line);
  border-radius: calc(var(--asma-radius) + 4px);
  background: #fff;
  box-shadow: var(--asma-shadow);
}

html[data-storefront-template='asma-shop'] .asma-checkout-success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 183, 126, 0.12);
  color: var(--asma-brand);
}

html[data-storefront-template='asma-shop'] .asma-checkout-success h1 {
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  font-weight: 800;
  color: var(--asma-ink);
  margin-bottom: 0.75rem;
}

html[data-storefront-template='asma-shop'] .asma-checkout-success p {
  color: var(--asma-muted);
  margin-bottom: 1rem;
}

html[data-storefront-template='asma-shop'] .asma-checkout-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

html[data-storefront-template='asma-shop'] .asma-checkout-success-actions .btn {
  border-radius: 999px;
  min-width: 160px;
  font-weight: 700;
}

html[data-storefront-template='asma-shop'] .asma-checkout-success-actions .btn-outline {
  background: transparent;
  border: 2px solid var(--asma-brand);
  color: var(--asma-brand);
}

html[data-storefront-template='asma-shop'] .asma-checkout-success-actions .btn-outline:hover {
  background: var(--asma-brand);
  color: #fff;
}

@media (max-width: 991px) {
  html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid.asma-shop-grid,
  html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid.asma-shop-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-left: 0;
    margin-right: 0;
  }

  html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid.asma-shop-grid > [class*='col-'],
  html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid.asma-shop-grid > .asma-shop-grid-item,
  html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid.asma-shop-grid > [class*='col-'],
  html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid.asma-shop-grid > .asma-shop-grid-item,
  html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid .col-lg-3,
  html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid .col-lg-3 {
    flex: none !important;
    max-width: none !important;
    width: auto !important;
  }
}

@media (max-width: 575px) {
  html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid.asma-shop-grid,
  html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid.asma-shop-grid {
    grid-template-columns: 1fr;
  }

  html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid .col-lg-3,
  html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid .col-md-4,
  html[data-storefront-template='asma-shop'] .asma-shop-page .product-grid.asma-shop-grid > .asma-shop-grid-item,
  html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid .col-lg-3,
  html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid .col-md-4,
  html[data-storefront-template='asma-shop'] .asma-catalog-page .product-grid.asma-shop-grid > .asma-shop-grid-item {
    flex: none !important;
    max-width: none !important;
    width: auto !important;
  }
}
