/* VEJA HOME V47.17.2 - safe, independent style layer; includes V47.16 gallery recovery + readable storefront typography.
   Replaces V47.15 CSS, not layered on top of it. All media, pricing,
   cart and customer JS remain owned by the existing application. */

/* Typography scale: only storefront, never Filament/admin or JS-generated prices. */
#app { font-size: 16px; line-height: 1.55; }
#app :is(p, .section-heading p, .catalog-description, .collection-description,
         .veja-v23-muted, .account-hint, .help-small, .shipping-highlights,
         .support-box, .vh4707-assurance, .veja-v24-box p) {
  font-size: clamp(14px, 1.04vw, 16px);
  line-height: 1.65;
}
#app .breadcrumbs, #app .breadcrumbs :is(a, span) {
  font-size: 13px !important;
  line-height: 1.55;
}
#app .section-heading h2, #app .related-section h2,
#app .veja-v23 > h2, #app .veja-v23 h2 {
  font-size: clamp(24px, 2.2vw, 32px) !important;
  line-height: 1.22;
  letter-spacing: -.022em;
}
#app .veja-v23 :is(h3, h4), #app .product-specs h3 {
  font-size: clamp(17px, 1.35vw, 20px) !important;
  line-height: 1.35;
}
#app .veja-v23 :is(p, li, td, th, label, input, select, textarea, button),
#app .product-specs :is(td, th), #app .product-specs p,
#app .account-card :is(p, label, input), #app .checkout-form :is(p, label, input) {
  font-size: 15px;
  line-height: 1.6;
}
#app .product-card .product-name, #app .product-info .product-name {
  font-size: 16px !important;
  line-height: 1.43;
  font-weight: 650;
}
#app .product-card :is(.price, .old-price, .price-sub) { font-size: 15px; }
#app .collection-header p, #app .category-description { font-size: 16px !important; }
#app .veja-v23-panel { padding: clamp(17px, 1.7vw, 25px); }
#app .veja-v23-panel p, #app .veja-v23-panel table { line-height: 1.72; }
.site-header .main-nav .nav-link { font-size: 15px !important; line-height: 1.35; }
#mega-menu :is(a, button), .mega-menu :is(a, button) { font-size: 15px !important; }
.site-header :is(.header-actions, .main-nav) { letter-spacing: normal; }
.site-footer :is(a, p, span, li), footer :is(.footer-group a, .footer-bottom span) {
  font-size: clamp(13px, 1vw, 15px);
  line-height: 1.55;
}

/* Product detail: gallery gets the visual priority without squeezing imagery. */
#app .page-wrap:has(> .detail-layout) {
  --vh16-accent: #81113e;
  --vh16-ink: #241b20;
  --vh16-line: #e9e2df;
}
#app .detail-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr) !important;
  align-items: start !important;
  column-gap: clamp(26px, 3.2vw, 52px) !important;
  row-gap: 26px !important;
  margin-bottom: clamp(28px, 4vw, 56px) !important;
}
#app .detail-layout > * { min-width: 0; }
#app .detail-layout .details {
  min-width: 0;
  width: 100%;
  max-width: none;
  align-self: start;
}
#app .detail-layout .detail-heading {
  margin: 0 0 16px !important;
  padding: 0 !important;
  align-items: flex-start;
  gap: 12px;
}
#app .detail-layout .detail-heading h1 {
  color: var(--vh16-ink);
  font-size: clamp(30px, 2.55vw, 39px) !important;
  line-height: 1.2 !important;
  letter-spacing: -.029em;
  margin-block: 8px 12px !important;
  text-wrap: pretty;
}
#app .detail-layout .badge-row { margin: 10px 0 18px !important; gap: 8px !important; }
#app .detail-layout .badge-row .spec-badge {
  font-size: 13px !important;
  line-height: 1.3;
  border-radius: 999px;
  padding: 7px 11px;
  background: #faf7f7;
  border: 1px solid #eee6e5;
}
#app .detail-layout .vh4714-price-panel {
  min-height: 0 !important;
  padding: 21px 25px !important;
  margin-block: 14px 22px !important;
  background: linear-gradient(135deg, #fff 0%, #fffbfd 100%) !important;
  border: 1px solid #e9dbe0 !important;
  border-radius: 15px !important;
  box-shadow: 0 7px 20px rgba(70, 21, 41, .035) !important;
}
#app .detail-layout .vh4714-price-panel #detail-price {
  color: var(--vh16-accent) !important;
  font-size: clamp(35px, 3vw, 46px) !important;
  line-height: 1.12 !important;
  letter-spacing: -.036em;
}
#app .detail-layout .variant-grid { gap: 16px !important; margin-bottom: 15px !important; }
#app .detail-layout .field-label { font-size: 14px !important; font-weight: 700; line-height: 1.5; }
#app .detail-layout :is(.control, select) {
  font-size: 15px !important;
  min-height: 49px;
  border-color: #e6ddda;
  border-radius: 9px;
}
#app .detail-layout :is(.control, select):focus-visible {
  outline: 2px solid rgba(129, 17, 62, .34);
  outline-offset: 2px;
}
#app .detail-layout .buy-row { gap: 12px; margin-block: 14px 11px !important; }
#app .detail-layout .buy-row .btn {
  min-height: 52px;
  font-size: 16px !important;
  border-radius: 10px;
  background: #7d123d;
  box-shadow: 0 5px 12px rgba(125, 18, 61, .11);
  transition: background .2s ease, box-shadow .2s ease;
}
#app .detail-layout .quantity-control { min-height: 50px; }
#app .detail-layout .quantity-control :is(button, span) { font-size: 15px !important; }
#app .detail-layout .vh4707-assurance {
  padding: 12px 15px !important;
  margin-top: 10px !important;
  border: 1px solid var(--vh16-line);
  border-radius: 10px;
  background: #fff;
}
#app .detail-layout .vh4707-assurance > div { margin: 0 !important; }
#app .detail-layout .vh4707-assurance :is(span, a) { font-size: 14px !important; line-height: 1.6; }

/* Repaired gallery: NO fixed 630px stage, NO max-height cropping and NO forced
   square/portrait crop. The image determines its own displayed height. */
#app .detail-layout #veja-detail-gallery {
  display: grid !important;
  grid-template-columns: clamp(63px, 5.4vw, 80px) minmax(0, 1fr) !important;
  align-items: start !important;
  gap: clamp(11px, 1.15vw, 17px) !important;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
}
#app .detail-layout #veja-detail-gallery .thumb-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  align-self: start;
  height: auto !important;
  max-height: min(82vh, 880px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d8c8cd transparent;
}
#app .detail-layout #veja-detail-gallery .thumb {
  width: 100%;
  height: auto;
  box-sizing: border-box;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}
#app .detail-layout #veja-detail-gallery .veja-detail-stage {
  position: relative !important;
  display: block !important;
  isolation: isolate;
  box-sizing: border-box;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
  border-radius: 12px;
  background: #fbfaf9;
}
#app .detail-layout #veja-detail-gallery .veja-detail-stage .veja-open-zoom {
  position: relative !important;
  display: block !important;
  inset: auto !important;
  box-sizing: border-box;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  line-height: 0;
  background: transparent;
  border-radius: inherit;
}
#app .detail-layout #veja-detail-gallery .veja-detail-stage #main-detail-image {
  position: relative !important;
  display: block !important;
  inset: auto !important;
  transform: none !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  max-width: 100% !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center top !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}
#app .detail-layout #veja-detail-gallery .veja-detail-stage :is(.veja-gallery-nav, .veja-zoom-hint) {
  z-index: 9;
}
#app .detail-layout #veja-detail-gallery .veja-detail-stage .veja-zoom-hint {
  line-height: 1.3;
  font-size: 13px !important;
}
#app .detail-layout #veja-detail-gallery .veja-detail-stage video {
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 0 !important;
  background: #141414;
}
#app .detail-layout #veja-detail-gallery .veja-detail-stage :is(.vh-video-wrapper, .veja-video-wrapper, .video-container, .video-slide, .veja-media-video) {
  max-width: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
/* When a video is the active item, retain room for landscape/portrait playback
   even if a legacy gallery hides the picture. */
#app .detail-layout #veja-detail-gallery .veja-detail-stage:has(video) {
  min-height: min(68vw, 760px) !important;
}

/* Fullscreen/big image: show ALL media inside dialog; clip the chrome only. */
#veja-media-dialog[open] {
  box-sizing: border-box;
  max-width: min(1240px, 96vw) !important;
  max-height: calc(100dvh - 28px) !important;
  overflow: hidden !important;
}
#veja-media-dialog[open] .veja-dialog-shell {
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column;
  width: 100%;
  max-height: calc(100dvh - 32px) !important;
  min-height: 0;
  overflow: hidden !important;
}
#veja-media-dialog[open] .veja-dialog-body {
  display: flex !important;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
  max-height: calc(100dvh - 110px) !important;
  max-width: 100%;
  overflow: hidden !important;
  background: #151313;
}
#veja-media-dialog[open] .veja-dialog-body :is(img, video) {
  position: relative !important;
  inset: auto !important;
  transform: none;
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: calc(100dvh - 114px) !important;
  object-fit: contain !important;
  margin: auto;
}
#veja-media-dialog[open] .veja-dialog-body video { background: #151313; }
#veja-media-dialog[open] .veja-dialog-toolbar { position: relative; flex: 0 0 auto; z-index: 8; }

/* Hover video: fully mask the original image (no left/right ghosting). */
#app .product-card .product-image-wrap {
  position: relative;
  display: block;
  isolation: isolate;
  overflow: hidden !important;
}
#app .product-card .product-image-wrap .vh4715-video-layer {
  position: absolute !important;
  inset: 0 !important;
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  background: #f6f2ef;
}
#app .product-card .product-image-wrap video {
  position: absolute !important;
  inset: 0 !important;
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #f6f2ef;
}
#app .product-card.vh4715-video-playing .product-image-wrap > .product-image { opacity: 0 !important; }
#app .product-card.vh4715-video-playing .product-image-wrap video {
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 3 !important;
}
#app .product-card .product-pill { position: relative; z-index: 6; }
#app .product-card .product-wish { z-index: 7; }

/* Nav interaction preserves V47.15 animation. */
.site-header .main-nav .nav-link:not(.sale-link) {
  position: relative;
  text-decoration: none;
  transition: color .2s ease;
}
.site-header .main-nav .nav-link:not(.sale-link)::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 11%;
  right: 11%;
  height: 2px;
  background: #81113e;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .24s ease;
}
.site-header .main-nav .nav-link:not(.sale-link):is(:hover, :focus-visible, [aria-expanded='true']) { color: #81113e; }
.site-header .main-nav .nav-link:not(.sale-link):is(:hover, :focus-visible, [aria-expanded='true'])::after { transform: scaleX(1); }
#mega-menu :is(a, button), .mega-menu :is(a, button) {
  position: relative;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color .2s ease, color .2s ease;
}
#mega-menu a::after, .mega-menu a::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: #81113e;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .22s ease;
  pointer-events: none;
}
#mega-menu :is(a, button):is(:hover, :focus-visible),
.mega-menu :is(a, button):is(:hover, :focus-visible) {
  background-color: rgba(129,17,62,.065);
  color: #81113e !important;
}
#mega-menu a:is(:hover, :focus-visible)::after,
.mega-menu a:is(:hover, :focus-visible)::after { transform: scaleX(1); }

/* Sticky purchase panel makes the long full-size photo more usable. */
@media (min-width: 1120px) {
  #app .detail-layout:not(:has(.custom-form)) > .details {
    position: sticky;
    top: 94px;
  }
}
@media (max-width: 1060px) {
  #app .detail-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 24px !important;
  }
}
@media (max-width: 760px) {
  #app .detail-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 22px !important;
    margin-bottom: 28px !important;
  }
  #app .detail-layout #veja-detail-gallery, #app .detail-layout .details { width: 100%; }
  #app .detail-layout #veja-detail-gallery {
    grid-template-columns: 57px minmax(0, 1fr) !important;
    gap: 10px !important;
  }
  #app .detail-layout #veja-detail-gallery .thumb-list { max-height: 75vh; }
  #app .detail-layout #veja-detail-gallery .veja-detail-stage { height: auto !important; max-height: none !important; }
  #app .detail-layout .detail-heading h1 { font-size: clamp(27px, 6vw, 35px) !important; }
  #app .detail-layout .vh4714-price-panel { padding: 18px 20px !important; }
  #app .detail-layout #veja-detail-gallery .veja-detail-stage:has(video) { min-height: 65vw !important; }
  #app { font-size: 15px; }
}
@media (hover: hover) {
  #app .detail-layout .buy-row .btn:not(:disabled):hover {
    background: #62102f;
    box-shadow: 0 7px 16px rgba(125,18,61,.17);
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header .main-nav .nav-link:not(.sale-link)::after,
  #mega-menu a::after, .mega-menu a::after,
  #app .detail-layout .buy-row .btn { transition: none !important; }
}


/* V47.17 — Use the white area below purchasing controls for editorial content.
   The V47.16 full-size photo behavior is deliberately retained unchanged. */
#app .detail-layout { margin-bottom: clamp(18px, 2.4vw, 32px) !important; }
#app .detail-layout > .details { align-self: start; }
@media (min-width: 1120px) {
  /* Sticky would pin an unusually long article; content now flows naturally. */
  #app .detail-layout:not(:has(.custom-form)) > .details {
    position: static !important; top: auto !important;
  }
}
#app .detail-layout .vh4717-inline-info {
  display: block;
  min-width: 0;
  padding-top: clamp(22px, 2vw, 32px);
  margin-top: clamp(20px, 2.2vw, 30px);
  border-top: 1px solid #e9e0dc;
}
#app .detail-layout .vh4717-inline-info > .vh4707-section-eyebrow {
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: .085em;
  margin-bottom: 7px !important;
}
#app .detail-layout .vh4717-inline-info > h2 {
  margin: 0 0 18px !important;
  font-size: clamp(24px, 2vw, 30px) !important;
  line-height: 1.23;
  letter-spacing: -.02em;
}
#app .detail-layout .vh4717-inline-info .veja-v23-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: start !important;
  min-width: 0;
}
#app .detail-layout .vh4717-inline-info .veja-v23-panel {
  min-width: 0;
  padding: clamp(18px, 1.6vw, 23px) !important;
  border: 1px solid #ece4e0;
  border-radius: 13px;
  box-shadow: none;
  background: #fff;
}
#app .detail-layout .vh4717-inline-info .veja-v23-panel h3 {
  font-size: clamp(18px, 1.42vw, 21px) !important;
  margin-bottom: 10px !important;
}
#app .detail-layout .vh4717-inline-info .veja-v23-panel :is(p,li,td,th) {
  font-size: clamp(15px, 1.13vw, 17px) !important;
  line-height: 1.75 !important;
  overflow-wrap: anywhere;
}
#app .detail-layout .vh4717-inline-info .veja-v23-panel table {
  width: 100%; table-layout: auto; max-width: 100%;
}
#app .detail-layout .vh4717-inline-info .veja-v23-panel :is(td,th) {
  padding-block: 8px;
}
/* The other copy of related collections is obsolete; V47.17 removes the node too. */
#app .vh4707-editorial-related { display: none !important; }
/* When no genuinely related product exists, do not show an empty recommendation block. */
#app .page-wrap:has(> .detail-layout) .related-section:has(.product-grid:empty) {
  display: none !important;
}
/* FAQ: comfortable reading on both desktop and mobile. */
#app .page-wrap:has(> .detail-layout) .faq > h2,
#app .page-wrap:has(> .detail-layout) .faq h2 {
  font-size: clamp(25px, 2.05vw, 31px) !important;
  line-height: 1.28 !important;
  margin-bottom: 18px !important;
}
#app .page-wrap:has(> .detail-layout) .faq details {
  padding-block: clamp(14px, 1.5vw, 19px) !important;
}
#app .page-wrap:has(> .detail-layout) .faq summary {
  font-size: clamp(16px, 1.32vw, 19px) !important;
  font-weight: 650 !important;
  line-height: 1.55 !important;
}
#app .page-wrap:has(> .detail-layout) .faq details p {
  font-size: clamp(15px, 1.14vw, 17px) !important;
  line-height: 1.8 !important;
  margin-block: 13px 3px !important;
}
#app .page-wrap:has(> .detail-layout) .faq summary:focus-visible {
  outline: 2px solid #81113e;
  outline-offset: 4px;
  border-radius: 3px;
}
@media (max-width: 760px) {
  #app .detail-layout .vh4717-inline-info {
    margin-top: 24px;
    padding-top: 22px;
  }
  #app .detail-layout .vh4717-inline-info .veja-v23-panel {
    padding: 16px !important;
  }
  #app .page-wrap:has(> .detail-layout) .faq summary {
    font-size: 17px !important;
  }
}

/* V47.17.1 related-card media: hide paused video until playback really starts. */
#app .vh47171-related-card .vh4715-video-layer {
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
#app .vh47171-related-card.vh4715-video-playing .vh4715-video-layer { opacity: 1; }
#app .page-wrap:has(> .detail-layout) .related-section[hidden] { display: none !important; }

/* VEJA 47.17.2: prevent old empty block from reserving height when editorial moves right. */
#app .page-wrap:has(> .detail-layout) #veja-v23-extras:empty { display:none!important; }
