/* ---------- Breadcrumb ---------- */
.tw-product-breadcrumb {
  padding: 14px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--tw-color-text-soft);
}

.tw-product-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.tw-product-breadcrumb a:hover {
  color: var(--tw-color-accent);
}

.tw-product-breadcrumb__sep {
  margin-inline: 4px;
  opacity: 0.6;
}

.tw-product-breadcrumb__current {
  color: var(--tw-color-text);
  font-weight: 500;
}

/* ---------- Layout ---------- */
.tw-product-main {
  padding: 32px 0 90px;
}

.tw-product-main__grid {
  display: grid;
  grid-template-columns: minmax(0, 668px) minmax(0, 668px);
  justify-content: space-between;
  gap: 64px;
  align-items: start;
}

/* ---------- Gallery ---------- */
.tw-product-gallery {
  position: sticky;
  top: 24px;
}

.tw-product-gallery__main {
  position: relative;
  height: 540px;
  background: var(--tw-color-card-bg);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 40px;
}

.tw-product-gallery__image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
}

.tw-product-gallery__image.is-fading {
  opacity: 0;
}

.tw-product-gallery__badge {
  position: absolute;
  top: 20px;
  right: 17px;
  z-index: 1;
  background: #f9b253;
  color: #000000;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 6px 16px;
  border-radius: var(--tw-radius-pill);
}

.tw-product-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.tw-product-gallery__thumb {
  height: 110px;
  background: var(--tw-color-card-bg);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
}

.tw-product-gallery__thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tw-product-gallery__thumb:hover {
  border-color: var(--tw-color-border);
}

.tw-product-gallery__thumb.is-active {
  border-color: var(--tw-color-ink);
}

/* ---------- Info ---------- */
.tw-product-info {
  text-align: right;
}

.tw-product-info__eyebrow {
  font-size: 16px;
  font-weight: 300;
  direction: ltr;
  line-height: 1;
  letter-spacing: 0;
  color: var(--tw-color-text-muted);
  margin: 0 0 32px;
}

.tw-product-info__title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
  margin: 0 0 14px;
  background-image: var(--tw-gradient-heading);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tw-product-info__price-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.tw-product-info__price {
  font-size: 36px;
  font-weight: 600;
  color: var(--tw-color-ink);
  letter-spacing: -0.5px;
}

.tw-product-info__price .amount {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.tw-product-info__price-old {
  font-size: 20px;
  font-weight: 300;
  color: var(--tw-color-price-old);
  text-decoration: line-through;
}

.tw-product-info__price-old .amount {
  font-size: inherit;
  color: inherit;
}

.tw-product-info__save-badge {
  display: inline-flex;
  align-items: center;
  background: #E9F5EA;
  color: #2E7D32;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 12px;
  border-radius: var(--tw-radius-pill);
  white-space: nowrap;
}

.tw-product-info__save-badge .amount {
  font-size: inherit;
  color: inherit;
}

.tw-product-info__installments {
  font-size: 14px;
  font-weight: 400;
  color: var(--tw-color-text-soft);
  margin: 0 0 32px;
}

.tw-product-info__installments .amount {
  font-size: inherit;
  color: inherit;
}

.tw-product-info__description {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: #5A5252;
  margin-bottom: 32px;
}

.tw-product-info__description strong,
.tw-product-info__description b {
  font-weight: 500;
}

/* Video pill */
.tw-product-info__video-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--tw-color-border);
  border-radius: var(--tw-radius-pill);
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 300;
  font-family: inherit;
  background: #FFFFFF;
  color: var(--tw-color-text);
  text-decoration: none;
  margin-bottom: 32px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.tw-product-info__video-btn:hover {
  border-color: var(--tw-color-ink);
}

.tw-product-info__form .variations{
    display: none;
}

.tw-product-info__play {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tw-color-ink);
  color: #ffffff;
  transform: rotate(60deg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tw-product-info__play svg {
  margin-inline-start: 2px;
  transform: scaleX(-1);
}

/* ---------- Woo form: variations ---------- */
.tw-product-info__form form.cart {
  margin: 0;
}

/* Hide native selects/labels — custom UI is built by main.js */
.tw-product-info__form table.variations {
  border: 0;
  margin: 0 0 8px;
}

.tw-product-info__form table.variations td,
.tw-product-info__form table.variations th {
  border: 0;
  padding: 0;
}

.tw-product-info__form .tw-var-row {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tw-product-info__form .tw-var-row.is-hidden-native select,
.tw-product-info__form .tw-var-row.is-hidden-native label {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.tw-var-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--tw-color-text);
}

.tw-var-options {
  display: flex;
  gap: 14px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* Color swatch circles */
.tw-var-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  outline: 1px solid var(--tw-color-border);
  outline-offset: 2px;
  cursor: pointer;
  padding: 0;
  transition: outline-color 0.15s ease;
}

.tw-var-swatch.is-selected {
  outline: 2px solid var(--tw-color-ink);
}

/* Size boxes */
.tw-var-box {
  min-width: 64px;
  height: 52px;
  border: 1px solid var(--tw-color-border);
  border-radius: 10px;
  background: #ffffff;
  font-size: 19px;
  font-weight: 400;
  color: var(--tw-color-text);
  cursor: pointer;
  padding: 0 16px;
  transition: border-color 0.15s ease;
}

.tw-var-box.is-selected {
  border: 2px solid var(--tw-color-ink);
  font-weight: 500;
}

.tw-product-info__form .reset_variations {
  display: none !important;
}

/* Variation availability / price inside form */
.tw-product-info__form .woocommerce-variation-price,
.tw-product-info__form .woocommerce-variation-availability {
  font-size: 15px;
  color: var(--tw-color-text-soft);
  margin-bottom: 12px;
}

.tw-product-info__form .woocommerce-variation-price .price {
  color: var(--tw-color-ink);
  font-weight: 500;
}

/* ---------- Add-ons ---------- */
.tw-product-addons {
  margin: 6px 0 28px;
}

.tw-product-addons__label {
  font-size: 15px;
  font-weight: 500;
  color: var(--tw-color-text);
  margin: 0 0 12px;
}

.tw-product-addons__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #E4E4E4;
  border-radius: 12px;
  overflow: hidden;
}

.tw-product-addons__item + .tw-product-addons__item {
  border-top: 1px solid #E4E4E4;
}

.tw-product-addons__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tw-product-addons__row:hover {
  background: #fafafa;
}

.tw-product-addons__checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tw-product-addons__check {
  width: 16px;
  height: 16px;
  border: 1px solid var(--tw-color-border);
  border-radius: 4px;
  background: #ffffff;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tw-product-addons__checkbox:checked ~ .tw-product-addons__check {
  background: #383432;
  border-color: #383432;
  color: #ffffff;
}

.tw-product-addons__thumb {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--tw-color-card-bg);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tw-product-addons__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tw-product-addons__name {
  flex: 1;
  font-size: 14px;
  line-height: 1;
  font-weight: 400;
  color: #372C2C;
  text-align: right;
}

.tw-product-addons__price {
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  color: #797979;
  white-space: nowrap;
}

.tw-product-addons__price .amount {
  font-size: inherit;
  color: inherit;
}

/* ---------- Buy row: quantity + add to cart ---------- */
/* Variable products: add-ons full width on top, then quantity + button row */
.tw-product-info__form .woocommerce-variation-add-to-cart {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 14px;
}

.tw-product-info__form .woocommerce-variation-add-to-cart .tw-product-addons {
  width: 100%;
  order: 0;
  margin: 0px 0 32px;
}

/* Simple products: form itself becomes the buy row (add-ons take full width above) */
.tw-product-info__form form.cart:not(.variations_form) {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 14px;
}

.tw-product-info__form form.cart:not(.variations_form) .tw-product-addons {
  width: 100%;
  order: 0;
}

/* Figma: quantity box on the right, wide dark button on the left (RTL first = right) */
.tw-product-info__form .quantity {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--tw-color-border);
  border-radius: var(--tw-radius-pill);
  min-height: 54px;
  padding: 0 6px;
  order: 1;
  flex-shrink: 0;
}

.tw-product-info__form .quantity .qty {
  width: 44px;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  color: #372C2C;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.tw-product-info__form .quantity .qty::-webkit-inner-spin-button,
.tw-product-info__form .quantity .qty::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tw-qty-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  color: var(--tw-color-ink);
  cursor: pointer;
}

.tw-product-info__form .single_add_to_cart_button {
  flex: 1 1 auto !important;
  order: 2;
  min-height: 54px !important;
  border: 0 !important;
  border-radius: var(--tw-radius-pill) !important;
  background: var(--tw-color-btn-dark) !important;
  color: #ffffff !important;
  font-size: 19px !important;
  font-weight: 400 !important;
  font-family: var(--tw-font) !important;
  line-height: 1.3 !important;
  padding: 12px 24px !important;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.tw-product-info__form .single_add_to_cart_button:hover {
  background: var(--tw-color-btn-dark) !important;
  color: #ffffff !important;
  opacity: 0.92;
}

.tw-product-info__form .single_add_to_cart_button.disabled {
  opacity: 0.5 !important;
  cursor: not-allowed;
}

/* ---------- Trust grid ---------- */
.tw-product-trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.tw-product-trust__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  background: var(--tw-color-card-bg);
  border-radius: 12px;
  min-height: 56px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 400;
  color: var(--tw-color-text);
}

.tw-product-trust__item svg {
  flex-shrink: 0;
  color: var(--tw-color-text);
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .tw-product-breadcrumb {
    font-size: 13px;
  }

  .tw-product-main {
    padding: 24px 0 64px;
  }

  .tw-product-main__grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  /* Gallery above info on smaller screens */
  .tw-product-gallery {
    position: static;
    order: -1;
  }

  .tw-product-gallery__main {
    height: 440px;
    padding: 32px;
  }

  .tw-product-gallery__thumb {
    height: 96px;
  }

  .tw-product-info__eyebrow {
    margin-bottom: 20px;
  }

  .tw-product-info__title {
    font-size: 32px;
    line-height: 1.1;
  }

  .tw-product-info__price {
    font-size: 30px;
  }

  .tw-product-info__installments {
    margin-bottom: 24px;
  }

  .tw-product-info__description {
    margin-bottom: 26px;
  }

  .tw-product-info__video-btn {
    margin-bottom: 26px;
  }

  .tw-product-info__form .tw-var-row {
    margin-bottom: 26px;
    gap: 12px;
  }

  .tw-product-info__form .woocommerce-variation-add-to-cart .tw-product-addons {
    margin-bottom: 24px;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .tw-product-breadcrumb {
    font-size: 12px;
    padding: 10px 0 0;
  }

  .tw-product-main {
    padding: 16px 0 48px;
  }

  .tw-product-main__grid {
    gap: 24px;
  }

  .tw-product-gallery__main {
    height: clamp(260px, 78vw, 340px);
    padding: 20px;
    border-radius: 12px;
  }

  .tw-product-gallery__badge {
    top: 12px;
    right: 12px;
    font-size: 12px;
    padding: 5px 12px;
  }

  .tw-product-gallery__thumbs {
    gap: 8px;
    margin-top: 8px;
  }

  .tw-product-gallery__thumb {
    height: 72px;
    padding: 8px;
    border-radius: 10px;
  }

  .tw-product-info__eyebrow {
    font-size: 13px;
    margin-bottom: 14px;
  }

  .tw-product-info__title {
    font-size: 26px;
    line-height: 1.15;
    margin-bottom: 12px;
  }

  .tw-product-info__price-row {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
  }

  .tw-product-info__price {
    font-size: 26px;
  }

  .tw-product-info__price-old {
    font-size: 16px;
  }

  .tw-product-info__save-badge {
    font-size: 12px;
    padding: 4px 10px;
  }

  .tw-product-info__installments {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .tw-product-info__description {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .tw-product-info__video-btn {
    font-size: 14px;
    padding: 8px 16px;
    margin-bottom: 22px;
  }

  .tw-product-info__play {
    width: 22px;
    height: 22px;
  }

  .tw-product-info__form .tw-var-row {
    margin-bottom: 22px;
    gap: 10px;
  }

  .tw-var-label {
    font-size: 14px;
  }

  .tw-var-options {
    gap: 12px;
  }

  .tw-var-swatch {
    width: 28px;
    height: 28px;
  }

  .tw-var-box {
    min-width: 54px;
    height: 46px;
    font-size: 16px;
    padding: 0 14px;
    border-radius: 8px;
  }

  .tw-product-info__form .woocommerce-variation-add-to-cart .tw-product-addons {
    margin-bottom: 18px;
  }

  .tw-product-addons__label {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .tw-product-addons__row {
    gap: 8px;
    padding: 8px 10px;
  }

  .tw-product-addons__name {
    font-size: 13px;
    line-height: 1.3;
  }

  .tw-product-addons__price {
    font-size: 12px;
  }

  .tw-product-addons__thumb {
    width: 30px;
    height: 30px;
  }

  /* Buy row: quantity stays compact on the right, button fills the rest */
  .tw-product-info__form .woocommerce-variation-add-to-cart,
  .tw-product-info__form form.cart:not(.variations_form) {
    gap: 10px;
  }

  .tw-product-info__form .quantity {
    min-height: 48px;
    padding: 0 2px;
  }

  .tw-product-info__form .quantity .qty {
    width: 34px;
    font-size: 16px;
  }

  .tw-qty-btn {
    width: 30px;
    height: 30px;
    font-size: 20px;
  }

  .tw-product-info__form .single_add_to_cart_button {
    min-height: 48px !important;
    font-size: 16px !important;
    padding: 10px 16px !important;
  }

  .tw-product-trust {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .tw-product-trust__item {
    min-height: 48px;
    font-size: 12px;
    padding: 8px 10px;
    gap: 8px;
  }

  .tw-product-trust__item svg {
    width: 22px;
    height: 22px;
  }
}

/* Very small phones: trust items stack */
@media (max-width: 400px) {
  .tw-product-trust {
    grid-template-columns: 1fr;
  }

  .tw-product-trust__item {
    font-size: 13px;
  }
}

/* ==========================================================================
   Video modal
   ========================================================================== */
.tw-video-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.tw-video-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tw-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 6, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.tw-video-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  background: #0b0b0b;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.tw-video-modal.is-open .tw-video-modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.tw-video-modal__close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.tw-video-modal__close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: rotate(90deg);
}

.tw-video-modal__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.tw-video-modal__frame iframe,
.tw-video-modal__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

body.tw-video-modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .tw-video-modal { 
    padding: 16px;
  }

  .tw-video-modal__dialog {
    border-radius: 12px;
  }

  .tw-video-modal__close {
    top: 8px;
    inset-inline-end: 8px;
    width: 36px;
    height: 36px;
  }
}

