/* Sjors Wear product page (loaded on single products only). */

/* ---------- 800px frame ---------- */
.single-product .site-main .hero-section.is-width-constrained,
.single-product .site-main .product-entry-wrapper.is-width-constrained { max-width: min(800px, 88vw); margin-inline: auto; }
.single-product .hero-section { margin-bottom: 18px; }
.single-product .ct-breadcrumbs { font-size: 11px; letter-spacing: .14em; }

.single-product .product-entry-wrapper { align-items: flex-start; }
.single-product .entry-summary::before { content: none; }
@media (min-width: 690px) {
  .single-product .product-entry-wrapper { display: flex; column-gap: 0; }
  .single-product .product-entry-wrapper .sw-gallery { flex: none; width: 54%; }
  .single-product .product-entry-wrapper .entry-summary { flex: none; width: calc(46% - 40px); margin-left: 40px; }
}
/* The purchase block stays in view while the photos scroll by. */
@media (min-width: 690px) and (min-height: 760px) {
  .single-product .product-entry-wrapper .entry-summary { position: sticky; top: 32px; }
  .admin-bar.single-product .product-entry-wrapper .entry-summary { top: 64px; }
}

/* ---------- Editorial gallery ---------- */
.sw-gallery-track { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sw-gallery[data-count="1"] .sw-gallery-track,
.sw-gallery[data-count="2"] .sw-gallery-track { grid-template-columns: 1fr; }
.sw-shot { margin: 0; }
.sw-shot:first-child { grid-column: 1 / -1; }
.sw-gallery[data-count="4"] .sw-shot:last-child { grid-column: 1 / -1; }
.sw-shot-open {
  position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 4px; overflow: hidden;
  background: var(--sw-surface); cursor: zoom-in; aspect-ratio: 4 / 5;
}
.sw-shot-open img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
@media (hover: hover) and (pointer: fine) {
  .sw-shot:not(:first-child) .sw-shot-open:hover img { transform: scale(1.03); }
}
.sw-shot-open:focus-visible { outline: 2px solid var(--sw-ink); outline-offset: 3px; }
.sw-shot figcaption {
  display: flex; gap: 10px; align-items: baseline; margin-top: 9px;
  font: 500 11px/1 Jost, 'Helvetica Neue', Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--sw-text);
}
.sw-shot figcaption span { color: var(--sw-gold-deep); letter-spacing: .08em; }
.sw-gallery-meter { display: none; }

/* Phone: swipe carousel with a counter and a progress line. */
@media (max-width: 689.98px) {
  .sw-gallery { width: 100%; margin-bottom: 6px; }
  .sw-gallery-track {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%); scroll-padding-inline: 6vw; /* % here would refer to the scrollport */
    scrollbar-width: none;
  }
  .sw-gallery-track::-webkit-scrollbar { display: none; }
  .sw-gallery[data-count="1"] .sw-gallery-track { display: block; }
  .sw-shot { flex: 0 0 86%; scroll-snap-align: start; }
  .sw-gallery[data-count="1"] .sw-shot { width: 100%; }
  .sw-gallery-meter { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
  .sw-gallery-count { flex: none; font: 500 11px/1 Jost, 'Helvetica Neue', Arial, sans-serif; letter-spacing: .14em; color: var(--sw-ink); font-variant-numeric: tabular-nums; }
  .sw-gallery-bar { position: relative; flex: 1; height: 1px; background: var(--sw-line); overflow: hidden; }
  .sw-gallery-bar i { position: absolute; left: 0; top: -1px; height: 3px; background: var(--sw-gold-deep); transition: transform .3s ease; }
}

/* ---------- Photo viewer ---------- */
.sw-viewer {
  width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
  background: #F4EEE6; color: var(--sw-ink); overflow: hidden;
}
.sw-viewer::backdrop { background: rgba(59, 42, 32, .5); }
.sw-viewer[open] { display: grid; grid-template-rows: 1fr auto; animation: sw-fade .25s ease; }
@keyframes sw-fade { from { opacity: 0; } }
.sw-viewer-stage { display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 64px 72px 0; }
.sw-viewer-img {
  max-width: min(100%, calc(100vw - 144px)); max-height: calc(100dvh - 130px); width: auto; height: auto; object-fit: contain; cursor: zoom-in;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.sw-viewer-img.is-zoomed { transform: scale(2.2); cursor: zoom-out; }
.sw-viewer-caption {
  margin: 0; padding: 16px 20px 22px; text-align: center;
  font: 500 11px/1 Jost, 'Helvetica Neue', Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase;
}
.sw-viewer button {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--sw-line); background: rgba(255, 255, 255, .7); color: var(--sw-ink); font-size: 20px; line-height: 1;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.sw-viewer button:hover { background: var(--sw-ink); color: var(--theme-palette-color-7); }
.sw-viewer button:focus-visible { outline: 2px solid var(--sw-ink); outline-offset: 3px; }
.sw-viewer-close { top: 14px; right: 14px; font-size: 26px; }
.sw-viewer-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.sw-viewer-next { right: 14px; top: 50%; transform: translateY(-50%); }
.sw-viewer.is-single .sw-viewer-prev, .sw-viewer.is-single .sw-viewer-next { display: none; }
.sw-viewer-open { overflow: hidden; }
@media (max-width: 689.98px) {
  .sw-viewer-stage { padding: 64px 0 0; }
  .sw-viewer-img { max-width: 100vw; max-height: calc(100dvh - 190px); }
  .sw-viewer-prev, .sw-viewer-next { top: auto; bottom: 10px; transform: none; }
}

.sw-pdp-loupe {
  position: absolute; z-index: 3; width: 170px; height: 170px; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .85); box-shadow: 0 12px 34px rgba(59, 42, 32, .28), 0 0 0 1px rgba(184, 137, 59, .35);
  background-color: var(--theme-palette-color-7); background-repeat: no-repeat;
  opacity: 0; transform: scale(.85); transition: opacity .18s ease, transform .18s ease;
}
.sw-pdp-loupe.is-on { opacity: 1; transform: scale(1); }
.sw-pdp-hint {
  position: absolute; left: 14px; bottom: 14px; z-index: 2; padding: 7px 12px; border-radius: 999px; pointer-events: none;
  background: rgba(244, 238, 230, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: 500 11px/1 Jost, 'Helvetica Neue', Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--sw-ink);
  transition: opacity .3s ease;
}
.sw-loupe-used .sw-pdp-hint { opacity: 0; }

/* ---------- Purchase block ---------- */
.sw-product-kicker {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 14px; text-decoration: none;
  font: 500 11px/1 Jost, 'Helvetica Neue', Arial, sans-serif; letter-spacing: .28em; text-transform: uppercase; color: var(--sw-gold-deep);
}
.sw-product-kicker::before { content: ""; width: 26px; height: 1px; background: var(--sw-gold); }
.sw-product-kicker:hover { color: var(--sw-ink); }

.single-product .product_title { font-size: clamp(32px, 3.6vw, 42px); line-height: 1.05; margin-bottom: 8px; }
.single-product .entry-summary .price { font: 500 19px/1.2 Jost, 'Helvetica Neue', Arial, sans-serif; margin-bottom: 14px; }
.single-product .woocommerce-product-details__short-description {
  font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 20px; line-height: 1.4; color: var(--sw-ink);
}
.single-product .woocommerce-product-details__short-description p { margin: 0; }
.single-product .entry-summary .ct-product-divider { margin-block: 22px; border-color: var(--sw-line); }

.sw-product-color { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 15px; color: var(--sw-ink); }
.sw-swatch { width: 18px; height: 18px; border-radius: 50%; background: var(--sw-swatch); box-shadow: 0 0 0 1px rgba(59, 42, 32, .18), inset 0 0 0 2px rgba(255, 255, 255, .25); }
.sw-product-color-label, .single-product .variations th label {
  font: 500 11px/1 Jost, 'Helvetica Neue', Arial, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: var(--sw-text);
}
.single-product .variations th { padding-bottom: 10px; text-align: left; }
.single-product .variations th label { display: inline !important; }
.sw-picked { margin-left: 10px; font: 500 14px/1 Jost, 'Helvetica Neue', Arial, sans-serif; color: var(--sw-ink); }
.single-product .variations .reset_variations { display: none !important; }

.single-product .sw-option-pills { gap: 6px; }
.single-product .sw-option-pills button { min-width: 46px; padding: 0 9px; font-size: 13px; }
.sw-option-pills.is-nudged { animation: sw-nudge .45s ease; }
.sw-option-pills.is-nudged button:not(.is-unavailable) { border-color: var(--sw-gold); }
@keyframes sw-nudge { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.single-product .woocommerce-variation-availability .stock { margin: 12px 0 0; font-size: 13px; }
.single-product .woocommerce-variation-price { display: none; }

.single-product .entry-summary .ct-cart-actions { display: flex; gap: 10px; width: 100%; margin-top: 18px; }
.single-product .entry-summary .quantity { --quantity-height: 52px; }
.single-product .single_add_to_cart_button {
  flex: 1; min-height: 52px; font-size: 15px; letter-spacing: .02em; transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
/* Before a size is chosen the button reads as a prompt, not as broken. */
.single-product .single_add_to_cart_button.disabled.wc-variation-selection-needed {
  opacity: 1; cursor: pointer; background: transparent; color: var(--sw-ink); border: 1px solid var(--sw-ink);
}
.single-product .single_add_to_cart_button.disabled.wc-variation-selection-needed:hover { background: var(--sw-ink); color: var(--theme-palette-color-7); }
.single-product .single_add_to_cart_button.wc-variation-is-unavailable { opacity: .45; }

.sw-product-note { display: flex; align-items: center; gap: 9px; margin: 14px 0 0; font-size: 14px; color: var(--sw-text); }
.sw-product-note svg { flex: none; color: var(--sw-gold-deep); }

/* Add-to-cart confirmation (product.js) */
.sw-added { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 14px; color: var(--sw-ink); opacity: 0; transform: translateY(-4px); transition: opacity .3s ease, transform .3s ease; }
.sw-added:empty { display: none; }
.sw-added.is-on { opacity: 1; transform: none; }
.sw-added span { color: var(--sw-gold-deep); }
.sw-added a { margin-left: auto; color: var(--sw-ink); text-underline-offset: 4px; text-decoration-color: var(--sw-gold); }

/* ---------- Fold-out details ---------- */
.single-product .entry-summary .ct-product-divider:has(+ .woocommerce-tabs) { margin-bottom: 0; }
.single-product .sw-accordion { margin-top: 0; }
.single-product .woocommerce-tabs .sw-acc-item { margin: 0 !important; padding: 0; border-bottom: 1px solid var(--sw-line); }
.single-product .sw-accordion h2.sw-acc-heading { margin: 0; padding: 0; border: 0; }
.sw-acc-toggle {
  display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 18px 0; border: 0; background: none; cursor: pointer;
  font: 500 12px/1 Jost, 'Helvetica Neue', Arial, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: var(--sw-ink);
}
.sw-acc-toggle:hover { color: var(--sw-gold-deep); }
.sw-acc-toggle:focus-visible { outline: 2px solid var(--sw-ink); outline-offset: 2px; }
.sw-acc-icon { position: relative; width: 12px; height: 12px; }
.sw-acc-icon::before, .sw-acc-icon::after { content: ""; position: absolute; left: 0; top: 50%; width: 12px; height: 1px; background: currentColor; transition: transform .25s ease; }
.sw-acc-icon::after { transform: rotate(90deg); }
.sw-acc-toggle[aria-expanded="true"] .sw-acc-icon::after { transform: rotate(0deg); }
.sw-acc-body { padding: 0 0 22px; font-size: 15px; line-height: 1.7; }
.sw-acc-body > p:first-child { margin-top: 0; }
.sw-acc-body ul { padding-left: 1.1em; margin-bottom: 0; }
.sw-acc-body li::marker { color: var(--sw-gold); }
.sw-acc-body .product_meta { margin-top: 16px; font-size: 12px; letter-spacing: .06em; color: var(--sw-text); }
.sw-acc-body .product_meta .posted_in { display: none !important; }
.sw-acc-body .shop_attributes { margin: 0; }
.sw-acc-body .shop_attributes th, .sw-acc-body .shop_attributes td { padding: 12px 14px; font-size: 14px; }
.sw-acc-body .shop_attributes td p { margin: 0; }
.sw-acc-body .woocommerce-Reviews-title { display: none; }
.sw-acc-body .woocommerce-noreviews { margin-top: 0; }
.sw-acc-body #respond { margin-top: 12px; }
.sw-acc-body .comment-reply-title { font: 500 15px/1.3 Jost, 'Helvetica Neue', Arial, sans-serif; }
.sw-acc-body #review_form textarea { min-height: 110px; }

/* ---------- Complete the look ---------- */
.single-product .related { display: none; }
.sw-look {
  display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center;
  max-width: min(800px, 88vw); margin: clamp(56px, 8vw, 96px) auto 0; padding-top: clamp(40px, 6vw, 64px); border-top: 1px solid var(--sw-line);
}
.sw-look.no-photo { grid-template-columns: 1fr; }
.sw-look-photo { margin: 0; overflow: hidden; border-radius: 4px; aspect-ratio: 4 / 5; }
.sw-look-photo img { display: block; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; transform: scale(1.07); transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
/* The scale trims thin edge bands some generated photos have. */
.sw-look:hover .sw-look-photo img { transform: scale(1.1); }
.sw-look-kicker {
  display: flex; align-items: center; gap: 12px; margin: 0 0 12px;
  font: 500 11px/1 Jost, 'Helvetica Neue', Arial, sans-serif; letter-spacing: .28em; text-transform: uppercase; color: var(--sw-gold-deep);
}
.sw-look-kicker::before { content: ""; width: 26px; height: 1px; background: var(--sw-gold); }
.sw-look h2 { margin: 0 0 22px; font-size: clamp(32px, 3.6vw, 42px); font-weight: 500; line-height: 1.05; }
.sw-look h2 em { font-style: italic; color: var(--sw-gold-deep); }
.sw-look-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--sw-line); }
.sw-look-list li { margin: 0; border-bottom: 1px solid var(--sw-line); }
.sw-look-list a { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 12px 0; text-decoration: none; color: var(--sw-ink); }
.sw-look-list img { width: 64px; height: 80px; object-fit: cover; border-radius: 3px; }
.sw-look-text { display: grid; gap: 4px; }
.sw-look-cat { font: 500 10px/1 Jost, 'Helvetica Neue', Arial, sans-serif; letter-spacing: .24em; text-transform: uppercase; color: var(--sw-gold-deep); }
.sw-look-name { font: 500 15px/1.25 Jost, 'Helvetica Neue', Arial, sans-serif; }
.sw-look-price { font-size: 14px; color: var(--sw-text); }
.sw-look-arrow { font-size: 18px; color: var(--sw-gold-deep); transform: translateX(-4px); opacity: .5; transition: transform .25s ease, opacity .25s ease; }
.sw-look-list a:hover .sw-look-arrow, .sw-look-list a:focus-visible .sw-look-arrow { transform: none; opacity: 1; }
.sw-look-list a:hover .sw-look-name { color: var(--sw-gold-deep); }
.sw-look-list a:focus-visible { outline: 2px solid var(--sw-ink); outline-offset: 3px; }
.sw-look-all { display: inline-block; margin-top: 20px; font-size: 14px; color: var(--sw-ink); text-underline-offset: 5px; text-decoration-color: var(--sw-gold); }
.single-product .site-main { padding-bottom: clamp(56px, 8vw, 96px); }

/* ---------- Phone buy bar ---------- */
.sw-buybar { display: none; }
@media (max-width: 999.98px) {
  .sw-buybar {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60;
    display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 8px 8px 10px;
    border: 1px solid rgba(255, 255, 255, .6); border-radius: 18px;
    background: rgba(244, 238, 230, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 14px 40px rgba(59, 42, 32, .22);
    transform: translateY(140%); visibility: hidden; transition: transform .35s cubic-bezier(.2, .7, .2, 1), visibility 0s .35s;
  }
  .sw-buybar.is-visible { transform: none; visibility: visible; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
  .sw-buybar img { width: 44px; height: 55px; object-fit: cover; border-radius: 8px; }
  .sw-buybar-text { display: grid; gap: 3px; min-width: 0; }
  .sw-buybar-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 14px/1.2 Jost, 'Helvetica Neue', Arial, sans-serif; color: var(--sw-ink); }
  .sw-buybar-price { font-size: 13px; color: var(--sw-text); }
  .sw-buybar-btn {
    min-height: 46px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--sw-ink); color: var(--theme-palette-color-7); font: 500 14px/1 Jost, 'Helvetica Neue', Arial, sans-serif;
  }
  .sw-buybar-btn:focus-visible { outline: 2px solid var(--sw-gold); outline-offset: 2px; }
}

/* ---------- Phone ---------- */
@media (max-width: 689.98px) {
  .single-product .product-entry-wrapper { row-gap: 22px; }
  .sw-look { grid-template-columns: 1fr; gap: 26px; max-width: none; width: auto; margin-inline: 5vw; }
  .sw-look-photo { aspect-ratio: 4 / 3; }
  .sw-look-photo img { object-position: 50% 22%; }
  .single-product .site-main { padding-bottom: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .sw-pdp-loupe, .sw-look-photo img, .sw-buybar, .sw-option-pills.is-nudged { transition: none; animation: none; }
}
