/**
 * JewDIY Storefront Premium — topbar, hero, builder chrome, checkout alignment
 */
body.jewdiy-storefront {
  background-color: var(--jewdiy-paper, #f9f6f0);
}

/* ── Topbar ── */
body.jewdiy-storefront .topbar {
  background: rgba(255, 253, 248, 0.92) !important;
  border-bottom: 1px solid rgba(230, 224, 212, 0.95) !important;
  backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: 0 1px 0 rgba(184, 134, 45, 0.12);
}

body.jewdiy-storefront .topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 134, 45, 0.35) 30%, rgba(184, 134, 45, 0.55) 50%, rgba(184, 134, 45, 0.35) 70%, transparent);
  pointer-events: none;
}

body.jewdiy-storefront .topbar .brand-name,
body.jewdiy-storefront .topbar .site-logo-text {
  font-family: var(--jewdiy-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

body.jewdiy-storefront .topbar nav a,
body.jewdiy-storefront .topbar .nav-link {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--jewdiy-muted, #6b7168);
  transition: color var(--jewdiy-duration, 0.22s) var(--jewdiy-ease, ease);
}

body.jewdiy-storefront .topbar nav a:hover,
body.jewdiy-storefront .topbar .nav-link:hover {
  color: var(--jewdiy-moss, #1f5137);
}

/* ── Hero / landing ── */
body.jewdiy-storefront .hero-section h1,
body.jewdiy-storefront .home-hero h1,
body.jewdiy-storefront .hero-copy h1 {
  font-family: var(--jewdiy-font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

body.jewdiy-storefront .hero-section p,
body.jewdiy-storefront .home-hero p,
body.jewdiy-storefront .hero-copy p {
  color: var(--jewdiy-muted, #6b7168);
  line-height: 1.65;
}

body.jewdiy-storefront .hero-cta .pill-button.primary {
  background: linear-gradient(135deg, var(--jewdiy-moss, #1f5137) 0%, var(--jewdiy-moss-mid, #2a6648) 100%);
  border-color: transparent;
  box-shadow: 0 8px 28px rgba(31, 81, 55, 0.24);
  letter-spacing: 0.04em;
}

body.jewdiy-storefront .hero-cta .pill-button.ghost {
  border-color: rgba(230, 224, 212, 0.95);
  background: rgba(255, 253, 248, 0.7);
}

/* ── Builder workspace ── */
body.jewdiy-storefront .builder-shell,
body.jewdiy-storefront .site-shell {
  gap: clamp(12px, 2vw, 20px);
}

body.jewdiy-storefront .builder-left,
body.jewdiy-storefront .catalog-panel,
body.jewdiy-storefront .bead-library-panel {
  border-radius: var(--jewdiy-radius-lg, 18px);
  border: 1px solid rgba(230, 224, 212, 0.92);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--jewdiy-shadow-sm, 0 4px 16px rgba(26, 31, 24, 0.06));
}

body.jewdiy-storefront .canvas-wrap,
body.jewdiy-storefront .builder-canvas-card,
body.jewdiy-storefront .bracelet-stage {
  border-radius: var(--jewdiy-radius-xl, 24px);
  border: 1px solid rgba(230, 224, 212, 0.88);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 253, 248, 0.98), rgba(249, 246, 240, 0.92) 68%),
    linear-gradient(180deg, #fffdf8 0%, #f5f0e6 100%);
  box-shadow: var(--jewdiy-shadow, 0 16px 48px rgba(26, 31, 24, 0.08));
}

body.jewdiy-storefront .builder-summary,
body.jewdiy-storefront .cart-summary-panel {
  border-radius: var(--jewdiy-radius-lg, 18px);
  border: 1px solid rgba(230, 224, 212, 0.92);
  background: rgba(255, 253, 248, 0.96);
}

/* ── Pill buttons (storefront) ── */
body.jewdiy-storefront .pill-button {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition:
    transform var(--jewdiy-duration, 0.22s) var(--jewdiy-ease, ease),
    box-shadow var(--jewdiy-duration, 0.22s) var(--jewdiy-ease, ease);
}

body.jewdiy-storefront .pill-button.primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(31, 81, 55, 0.26);
}

body.jewdiy-storefront .pill-button:not(.primary):hover {
  border-color: var(--jewdiy-line-strong, #d4cdc0);
}

/* ── Size chips & filters ── */
body.jewdiy-storefront .size-chip,
body.jewdiy-storefront .filter-chip,
body.jewdiy-storefront .catalog-size-btn {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

body.jewdiy-storefront .size-chip.active,
body.jewdiy-storefront .filter-chip.active,
body.jewdiy-storefront .catalog-size-btn.active {
  background: var(--jewdiy-moss-light, #edf6ef);
  color: var(--jewdiy-moss, #1f5137);
  border-color: rgba(31, 81, 55, 0.22);
}

/* ── Ready-made page ── */
body.jewdiy-storefront.ready-made-page .ready-hero h1,
body.jewdiy-storefront .ready-made-hero h1 {
  font-family: var(--jewdiy-font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
}

body.jewdiy-storefront .ready-card,
body.jewdiy-storefront .product-card {
  border-radius: var(--jewdiy-radius-lg, 18px);
  border-color: rgba(230, 224, 212, 0.92);
  overflow: hidden;
  transition: box-shadow var(--jewdiy-duration, 0.22s) var(--jewdiy-ease, ease), transform var(--jewdiy-duration, 0.22s) var(--jewdiy-ease, ease);
}

body.jewdiy-storefront .ready-card:hover,
body.jewdiy-storefront .product-card:hover {
  box-shadow: var(--jewdiy-shadow, 0 16px 48px rgba(26, 31, 24, 0.08));
  transform: translateY(-2px);
}

/* ── Checkout polish ── */
body.jewdiy-storefront.checkout-page {
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 253, 248, 0.98), transparent 40%),
    linear-gradient(180deg, #fcfaf5 0%, var(--jewdiy-paper, #f9f6f0) 100%);
}

body.jewdiy-storefront.checkout-page h1,
body.jewdiy-storefront.checkout-page h2 {
  font-family: var(--jewdiy-font-display);
  font-weight: 600;
  letter-spacing: 0;
}

body.jewdiy-storefront.checkout-page .checkout-panel,
body.jewdiy-storefront.checkout-page .order-summary,
body.jewdiy-storefront.checkout-page .form-section,
body.jewdiy-storefront.checkout-page .summary-card {
  border-radius: var(--jewdiy-radius-lg, 18px);
  border-color: rgba(230, 224, 212, 0.92);
  box-shadow: var(--jewdiy-shadow-sm, 0 4px 16px rgba(26, 31, 24, 0.06));
}

body.jewdiy-storefront.checkout-page :is(
  #addressParserSummary,
  #address2Summary,
  .summary-card-heading
) {
  /* 2026-06-25 checkout disclosure 44px tap target:
     optional checkout disclosure rows are real purchase-flow controls, not text labels. */
  box-sizing: border-box;
  min-height: 44px;
}

body.jewdiy-storefront.checkout-page :is(#addressParserSummary, #address2Summary) {
  display: list-item;
  padding-block: 12px;
}

@media (max-width: 540px) {
  body.jewdiy-storefront.checkout-page .location-autofill-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px 10px;
    align-items: center;
  }

  body.jewdiy-storefront.checkout-page .location-autofill-panel p:not(.location-autofill-status) {
    display: none;
  }

  body.jewdiy-storefront.checkout-page .location-autofill-panel button {
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  body.jewdiy-storefront.checkout-page #paymentGroup.payment-methods {
    /* 2026-06-25 mobile checkout payment App segmented control:
       payment choice should be a quick mode switch, not three long web cards. */
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  body.jewdiy-storefront.checkout-page #paymentGroup .payment-option {
    min-height: 82px;
    padding: 8px 6px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-width: 1px;
    border-radius: 14px;
    text-align: center;
    touch-action: manipulation;
  }

  body.jewdiy-storefront.checkout-page #paymentGroup .payment-option.selected {
    box-shadow: inset 0 0 0 1px rgba(47, 109, 74, 0.2);
  }

  body.jewdiy-storefront.checkout-page #paymentGroup .payment-icon {
    width: min(68px, 100%);
    height: 25px;
    border-radius: 6px;
  }

  body.jewdiy-storefront.checkout-page #paymentGroup .payment-body {
    width: 100%;
    justify-items: center;
    gap: 0;
  }

  body.jewdiy-storefront.checkout-page #paymentGroup .payment-title {
    max-width: 100%;
    font-size: 11.5px;
    line-height: 1.18;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body.jewdiy-storefront.checkout-page #paymentGroup .payment-desc,
  body.jewdiy-storefront.checkout-page #paymentGroup .payment-country-note {
    display: none;
  }

  body.jewdiy-storefront.checkout-page #paymentGroup + p {
    margin: 8px 0 0 !important;
    padding: 8px 10px;
    border: 1px solid rgba(58, 109, 75, 0.14);
    border-radius: 12px;
    background: rgba(249, 251, 246, 0.76);
    color: #587160 !important;
    font-size: 11.5px !important;
    line-height: 1.42;
    text-align: left;
  }

  body.jewdiy-storefront.checkout-page #bankTransferPanel:has(#bankTransferResult.active) > #bankTransferHint {
    /* 2026-06-25 mobile checkout bank-transfer duplicate hint collapse */
    display: none;
  }

  body.jewdiy-storefront.checkout-page .topbar {
    /* 2026-06-25 mobile checkout compact App header:
       keep the official brand and return action, but stop the checkout from opening like a tall web page. */
    min-height: 60px;
    padding: 8px 14px;
    align-items: center;
  }

  body.jewdiy-storefront.checkout-page .topbar .brand {
    min-height: 44px;
    gap: 8px;
    min-width: 0;
  }

  body.jewdiy-storefront.checkout-page .topbar .brand-mark {
    width: 32px;
    height: 32px;
  }

  body.jewdiy-storefront.checkout-page .topbar .brand-wordmark {
    width: 108px;
    max-width: 34vw;
  }

  body.jewdiy-storefront.checkout-page .topbar .brand-name {
    min-width: 0;
  }

  body.jewdiy-storefront.checkout-page .topbar .brand-name small {
    display: none;
  }

  body.jewdiy-storefront.checkout-page .topbar .back-link {
    min-height: 44px;
    padding: 0 12px;
  }

  body.jewdiy-storefront.checkout-page .checkout-layout {
    padding-top: 10px;
  }

  body.jewdiy-storefront.checkout-page .form-col {
    gap: 12px;
  }

  body.jewdiy-storefront.checkout-page .summary-card-heading {
    min-height: 48px;
    padding: 10px 12px;
  }

  body.jewdiy-storefront.checkout-page .summary-details {
    border-radius: 16px;
  }

  body.jewdiy-storefront.checkout-page .form-section {
    padding: 12px;
    border-radius: 16px;
  }

  body.jewdiy-storefront.checkout-page .form-section h2 {
    margin-bottom: 10px;
  }

  body.jewdiy-storefront.checkout-page .field {
    gap: 4px;
    margin-bottom: 10px;
  }

  body.jewdiy-storefront.checkout-page .address-history-row {
    /* 2026-06-25 mobile checkout saved-address App row:
       history select and use action belong on one row when the phone has enough width. */
    grid-template-columns: minmax(0, 1fr) 78px;
  }

  body.jewdiy-storefront.checkout-page .address-history-panel p {
    display: none;
  }

  body.jewdiy-storefront.checkout-page .address-parser,
  body.jewdiy-storefront.checkout-page .address-history-panel,
  body.jewdiy-storefront.checkout-page .optional-address-extra {
    padding: 9px 10px;
    margin-bottom: 10px;
  }
}

/* ── Footer brand contract ── */
body.jewdiy-storefront .site-footer {
  border-top: 1px solid rgba(217, 167, 58, 0.22);
  background:
    radial-gradient(circle at 12% 0%, rgba(75, 130, 92, 0.24), transparent 34%),
    linear-gradient(180deg, var(--footer-band, #173f2e) 0%, var(--footer-bg, #07130f) 58%, #06100d 100%);
  color: rgba(255, 255, 255, 0.86);
}

body.jewdiy-storefront .site-footer .footer-top-band {
  background: rgba(23, 63, 46, 0.94);
  color: rgba(255, 255, 255, 0.94);
}

body.jewdiy-storefront .site-footer .footer-col strong {
  color: #ffffff;
}

body.jewdiy-storefront .site-footer .footer-col a,
body.jewdiy-storefront .site-footer .footer-col span,
body.jewdiy-storefront .site-footer .footer-brand p,
body.jewdiy-storefront .site-footer .footer-social a {
  color: rgba(255, 255, 255, 0.76);
}

body.jewdiy-storefront .site-footer .footer-bottom,
body.jewdiy-storefront .site-footer .footer-legal a {
  color: rgba(255, 255, 255, 0.68);
}

body.jewdiy-storefront .site-footer a:hover,
body.jewdiy-storefront .site-footer .footer-legal a:hover {
  color: rgba(255, 255, 255, 0.96);
}

body.jewdiy-storefront .site-footer::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: 24px;
  background: linear-gradient(90deg, transparent, rgba(184, 134, 45, 0.3) 50%, transparent);
}

@media (max-width: 768px) {
  body.jewdiy-storefront .topbar nav a {
    font-size: 10px;
  }
}

/* 2026-06-25 storefront aesthetic rhythm and motion layer v2:
   add breathing room and subtle feedback without changing the purchase path. */
:root {
  --jewdiy-motion-ease: cubic-bezier(0.2, 0.72, 0.18, 1);
  --jewdiy-motion-fast: 160ms;
  --jewdiy-motion-mid: 420ms;
  --jewdiy-motion-slow: 760ms;
  --jewdiy-section-breath: clamp(34px, 5.4vw, 78px);
  --jewdiy-section-breath-mobile: clamp(20px, 6vw, 34px);
  --jewdiy-card-shadow-quiet: 0 8px 24px rgba(23, 38, 28, 0.055);
  --jewdiy-card-shadow-breath: 0 20px 52px rgba(23, 38, 28, 0.095);
}

body.jewdiy-storefront {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, rgba(247, 244, 236, 0.98) 46%, rgba(250, 248, 242, 1) 100%);
  text-rendering: optimizeLegibility;
}

body.jewdiy-storefront .site-shell > section,
body.jewdiy-storefront main > section {
  scroll-margin-top: calc(var(--jewdiy-sticky-topbar-height, 84px) + 18px);
}

body.jewdiy-storefront :is(
  .section-title,
  .how-header,
  .purchase-path-copy,
  .brand-intro-copy,
  .gift-copy,
  .aftercare-main
) {
  margin-bottom: clamp(16px, 2.4vw, 32px);
}

body.jewdiy-storefront :is(
  .purchase-path-grid,
  .ready-grid,
  .ready-value-strip,
  .material-guide-grid,
  .material-grid,
  .review-grid,
  .process-grid,
  .catalog
) {
  gap: clamp(14px, 1.9vw, 24px);
}

@media (min-width: 861px) {
  body.jewdiy-storefront .site-shell > section:not(.hero),
  body.jewdiy-storefront main > section:not(.hero) {
    margin-block: var(--jewdiy-section-breath);
  }
}

body.jewdiy-storefront :is(
  .purchase-path-card,
  .card,
  .ready-card,
  .product-card,
  .checkout-panel,
  .checkout-empty-state,
  .order-summary,
  .form-section,
  .summary-card,
  .summary-details,
  .location-autofill-panel,
  .builder-left,
  .catalog-panel,
  .bead-library-panel,
  .builder-summary,
  .cart-summary-panel
) {
  box-shadow: var(--jewdiy-card-shadow-quiet);
  transition:
    transform var(--jewdiy-motion-fast) var(--jewdiy-motion-ease),
    box-shadow var(--jewdiy-motion-fast) var(--jewdiy-motion-ease),
    border-color var(--jewdiy-motion-fast) ease,
    background-color var(--jewdiy-motion-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
  body.jewdiy-storefront :is(
    .purchase-path-card,
    .card,
    .ready-card,
    .product-card
  ):hover {
    transform: translateY(-3px);
    box-shadow: var(--jewdiy-card-shadow-breath);
    border-color: rgba(184, 138, 60, 0.26);
  }
}

body.jewdiy-storefront :is(
  .purchase-path-card,
  .card,
  .ready-card,
  .product-card
):active {
  transform: translateY(1px) scale(0.992);
  box-shadow: 0 6px 18px rgba(23, 38, 28, 0.07);
}

body.jewdiy-storefront :is(
  .hero-card img,
  .hero-media img,
  .card img,
  .photo img,
  .photo-zoom img,
  .ready-card img,
  .product-card img,
  .purchase-path-card img
) {
  transform-origin: 50% 50%;
  transition:
    transform 560ms var(--jewdiy-motion-ease),
    filter 560ms var(--jewdiy-motion-ease);
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  body.jewdiy-storefront :is(
    .hero-card,
    .hero-media,
    .card,
    .photo,
    .photo-zoom,
    .ready-card,
    .product-card,
    .purchase-path-card
  ):hover img {
    transform: scale(1.028);
    filter: saturate(1.04) contrast(1.02);
  }
}

body.jewdiy-storefront :is(
  .pill-button,
  .button,
  .pill,
  .diy-link,
  .back-link,
  .submit-btn,
  .checkout-empty-actions a,
  .location-autofill-panel button,
  .photo-zoom,
  .nav-link,
  .tab,
  summary
) {
  transition:
    transform var(--jewdiy-motion-fast) var(--jewdiy-motion-ease),
    box-shadow var(--jewdiy-motion-fast) var(--jewdiy-motion-ease),
    border-color var(--jewdiy-motion-fast) ease,
    background-color var(--jewdiy-motion-fast) ease,
    color var(--jewdiy-motion-fast) ease;
}

body.jewdiy-storefront :is(
  .pill-button,
  .button,
  .pill,
  .diy-link,
  .back-link,
  .submit-btn,
  .checkout-empty-actions a,
  .location-autofill-panel button,
  .tab
):active {
  transform: translateY(1px) scale(0.985);
}

body.jewdiy-storefront :is(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid rgba(184, 138, 60, 0.52);
  outline-offset: 3px;
}

body.jewdiy-storefront .topbar {
  transition:
    background-color var(--jewdiy-motion-mid) ease,
    box-shadow var(--jewdiy-motion-mid) ease,
    border-color var(--jewdiy-motion-mid) ease;
}

body.jewdiy-storefront :is(.hero-gift-carousel, .hero-card, .hero-media) {
  border: 1px solid rgba(230, 224, 212, 0.82);
  box-shadow: 0 24px 68px rgba(23, 38, 28, 0.12);
}

@keyframes jewdiyStorefrontRise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes jewdiyHeroImageBreath {
  0% { transform: scale(1); }
  50% { transform: scale(1.012); }
  100% { transform: scale(1); }
}

@keyframes jewdiyHeroFrameBreath {
  0%, 100% { box-shadow: 0 22px 62px rgba(23, 38, 28, 0.11); }
  50% { box-shadow: 0 28px 76px rgba(23, 38, 28, 0.16); }
}

@keyframes jewdiyCtaBreath {
  0%, 100% { box-shadow: 0 8px 24px rgba(31, 81, 55, 0.2); }
  50% { box-shadow: 0 14px 34px rgba(31, 81, 55, 0.3); }
}

@media (prefers-reduced-motion: no-preference) {
  body.jewdiy-storefront .site-shell > section,
  body.jewdiy-storefront main > section {
    animation: jewdiyStorefrontRise 620ms var(--jewdiy-motion-ease) both;
  }

  body.jewdiy-storefront .site-shell > section:nth-of-type(2),
  body.jewdiy-storefront main > section:nth-of-type(2) {
    animation-delay: 70ms;
  }

  body.jewdiy-storefront .site-shell > section:nth-of-type(3),
  body.jewdiy-storefront main > section:nth-of-type(3) {
    animation-delay: 120ms;
  }

  body.jewdiy-storefront :is(.hero-card img, .hero-media img) {
    animation: jewdiyHeroImageBreath 7s ease-in-out 900ms infinite;
  }

  body.jewdiy-storefront .hero-gift-carousel {
    animation: jewdiyHeroFrameBreath 7.5s ease-in-out 900ms infinite;
  }

  body.jewdiy-storefront :is(.reveal.visible, .reveal-stagger > *.visible) {
    animation: jewdiyStorefrontRise 620ms var(--jewdiy-motion-ease) both;
  }

  body.jewdiy-storefront :is(.hero-cta .pill-button.primary, .actions .pill.primary, .actions .diy-link.primary, .checkout-empty-primary) {
    animation: jewdiyCtaBreath 5.6s ease-in-out 1.2s infinite;
  }
}

@media (max-width: 768px) {
  body.jewdiy-storefront .site-shell > section:not(.hero),
  body.jewdiy-storefront main > section:not(.hero) {
    margin-block: var(--jewdiy-section-breath-mobile);
  }

  body.jewdiy-storefront :is(
    .section-title,
    .how-header,
    .purchase-path-copy,
    .brand-intro-copy,
    .gift-copy,
    .aftercare-main
  ) {
    margin-bottom: clamp(14px, 4.5vw, 22px);
  }

  body.jewdiy-storefront :is(
    .purchase-path-grid,
    .ready-grid,
    .ready-value-strip,
    .material-guide-grid,
    .material-grid,
    .review-grid,
    .process-grid,
    .catalog
  ) {
    gap: clamp(12px, 3.8vw, 18px);
  }

  body.jewdiy-storefront :is(
    .purchase-path-card,
    .card,
    .ready-card,
    .product-card,
    .checkout-panel,
    .checkout-empty-state,
    .order-summary,
    .form-section,
    .summary-card,
    .location-autofill-panel
  ) {
    box-shadow: 0 10px 28px rgba(23, 38, 28, 0.065);
  }
}
