/**
 * VELORA Fashion - Single Product Editorial Page
 * Colors: Near Black (#171717), Warm Ivory (#F5F0E8), Muted Burgundy (#7A2435), Soft Taupe (#B8AA9C)
 */

.single-product .site-main {
  padding-top: clamp(24px, 3vw, 48px);
  padding-bottom: clamp(60px, 8vw, 120px);
}

/* ==========================================================================
   Single Product Layout Structure
   ========================================================================== */
.velora-single-product,
.single-product div.product {
  position: relative;
  width: 100%;
}

/* Top Section: Gallery + Sticky Summary */
.velora-single-product__main {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 64px);
  margin-bottom: clamp(60px, 8vw, 100px);
  position: relative;
}

@media (min-width: 1024px) {
  .velora-single-product__main {
    grid-template-columns: 1.15fr 1fr;
    gap: clamp(40px, 5vw, 80px);
    align-items: start;
  }
}

/* Fallback for native WooCommerce markup */
.single-product div.product:not(:has(.velora-single-product__main)) {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 64px);
}

@media (min-width: 1024px) {
  .single-product div.product:not(:has(.velora-single-product__main)) {
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
  }
  .single-product div.product:not(:has(.velora-single-product__main)) > .woocommerce-product-gallery {
    grid-column: 1;
    grid-row: 1;
  }
  .single-product div.product:not(:has(.velora-single-product__main)) > .summary.entry-summary {
    grid-column: 2;
    grid-row: 1;
  }
  .single-product div.product:not(:has(.velora-single-product__main)) > .woocommerce-tabs {
    grid-column: 1 / -1;
  }
  .single-product div.product:not(:has(.velora-single-product__main)) > .related.products,
  .single-product div.product:not(:has(.velora-single-product__main)) > section.related {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   Product Gallery
   ========================================================================== */
.velora-single-product__gallery-col,
.woocommerce-product-gallery {
  position: relative;
  width: 100%;
}

.woocommerce-product-gallery__wrapper {
  margin: 0;
  padding: 0;
}

.woocommerce-product-gallery__image {
  margin-bottom: 16px;
  background-color: var(--velora-gray-200);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  position: relative;
}

.woocommerce-product-gallery__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.woocommerce-product-gallery__image:hover img {
  transform: scale(1.03);
}

.flex-control-thumbs {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.flex-control-thumbs li {
  width: 80px;
  height: 100px;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid var(--velora-gray-300);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.flex-control-thumbs img.flex-active,
.flex-control-thumbs li:hover {
  border-color: var(--velora-burgundy);
}

.flex-control-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   Product Summary (Sticky within Main Hero Section ONLY)
   ========================================================================== */
.velora-single-product__summary-col,
.summary.entry-summary {
  position: relative;
}

.velora-single-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.velora-single-meta .velora-cat {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--velora-burgundy);
}

.velora-single-meta .velora-sku {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--velora-gray-500);
  text-transform: uppercase;
}

h1.product_title.entry-title {
  font-family: var(--font-editorial);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 400;
  line-height: 1.12;
  color: var(--velora-black);
  margin-bottom: 14px;
}

p.price,
.woocommerce-variation-price .price {
  font-family: var(--font-ui);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--velora-black);
  margin-bottom: 22px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

p.price del {
  color: var(--velora-gray-500);
  font-size: 1.1rem;
  font-weight: 400;
  text-decoration: line-through;
}

p.price ins {
  color: var(--velora-burgundy);
  text-decoration: none;
}

.woocommerce-product-details__short-description {
  font-size: 1.05rem;
  color: var(--velora-gray-700);
  margin-bottom: 28px;
  line-height: 1.75;
}

/* Variations Form */
form.variations_form {
  margin-bottom: 28px;
}

table.variations {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

table.variations tr {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

table.variations th.label {
  text-align: left;
  padding: 0 0 8px 0;
}

table.variations th.label label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--velora-black);
}

table.variations td.value {
  padding: 0;
}

table.variations td.value select {
  width: 100%;
  padding: 13px 18px;
  background-color: #FFFFFF;
  border: 1px solid var(--velora-gray-300);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--velora-black);
  border-radius: 0;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

table.variations td.value select:focus {
  outline: none;
  border-color: var(--velora-burgundy);
}

.reset_variations {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.75rem;
  text-decoration: underline;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--velora-gray-500);
}

/* Quantity & Add to Cart Row */
.single_variation_wrap {
  margin-top: 20px;
}

.woocommerce-variation-add-to-cart {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-top: 18px;
}

.quantity {
  display: inline-flex;
  align-items: stretch;
}

.quantity input.qty {
  width: 68px;
  min-height: 52px;
  text-align: center;
  border: 1px solid var(--velora-gray-300);
  background-color: #FFFFFF;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  color: var(--velora-black);
  border-radius: 0;
}

.quantity input.qty:focus {
  outline: none;
  border-color: var(--velora-burgundy);
}

button.single_add_to_cart_button.button {
  flex: 1;
  min-height: 52px;
  background-color: var(--velora-black);
  color: var(--velora-ivory);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--velora-black);
  border-radius: 0;
  transition: all var(--transition-fast);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.single_add_to_cart_button.button:hover {
  background-color: var(--velora-burgundy);
  border-color: var(--velora-burgundy);
  color: #FFFFFF;
}

/* Size Guide Trigger */
.velora-size-guide-trigger-wrap {
  margin-bottom: 18px;
}

.velora-size-guide-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--velora-gray-700);
  border-bottom: 1px dashed var(--velora-gray-500);
  padding-bottom: 3px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.velora-size-guide-trigger:hover {
  color: var(--velora-burgundy);
  border-bottom-color: var(--velora-burgundy);
}

.velora-size-guide-trigger svg {
  width: 15px;
  height: 15px;
}

/* Atelier Trust Perks */
.velora-product-perks {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--velora-gray-200);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.velora-perk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--velora-gray-700);
}

.velora-perk-icon {
  color: var(--velora-burgundy);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Bottom Section: Editorial Tabs & Curated Pairings
   ========================================================================== */
.velora-single-product__bottom {
  width: 100%;
}

/* Tabs */
.woocommerce-tabs {
  margin-top: 40px;
  border-top: 1px solid var(--velora-gray-200);
  padding-top: clamp(40px, 6vw, 70px);
}

.woocommerce-tabs ul.tabs {
  display: flex !important;
  justify-content: center;
  gap: clamp(20px, 4vw, 44px);
  border-bottom: 1px solid var(--velora-gray-200);
  margin-bottom: 40px;
  padding: 0;
  list-style: none;
}

.woocommerce-tabs ul.tabs li {
  margin: 0;
  padding: 0;
}

.woocommerce-tabs ul.tabs li a {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--velora-gray-500);
  padding: 14px 8px;
  display: inline-block;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.woocommerce-tabs ul.tabs li.active a,
.woocommerce-tabs ul.tabs li a:hover {
  color: var(--velora-black);
  border-bottom-color: var(--velora-burgundy);
}

.woocommerce-Tabs-panel {
  max-width: 820px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--velora-gray-700);
}

.woocommerce-Tabs-panel h2 {
  font-family: var(--font-editorial);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--velora-black);
  margin-bottom: 18px;
}

.woocommerce-Tabs-panel p {
  color: var(--velora-gray-700);
  margin-bottom: 16px;
}

.woocommerce-Tabs-panel ul {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.woocommerce-Tabs-panel ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
}

.woocommerce-Tabs-panel ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--velora-burgundy);
}

/* ==========================================================================
   Related & Upsell Products (Complete The Wardrobe)
   ========================================================================== */
.related.products,
section.related,
.upsells.products,
section.upsells {
  width: 100% !important;
  border-top: 1px solid var(--velora-gray-200);
  padding-top: clamp(60px, 8vw, 100px);
  margin-top: clamp(60px, 8vw, 100px);
}

.related.products > h2,
section.related > h2,
.upsells.products > h2,
section.upsells > h2 {
  font-family: var(--font-editorial) !important;
  font-size: clamp(2.2rem, 3.8vw, 3rem) !important;
  font-weight: 400 !important;
  color: var(--velora-black) !important;
  margin-bottom: 48px !important;
  text-align: center !important;
  letter-spacing: -0.01em !important;
}

/* Related Products Grid */
.single-product .related.products ul.products,
.single-product section.related ul.products,
.single-product .upsells.products ul.products {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: clamp(16px, 2.5vw, 32px) !important;
  padding: 0 !important;
  margin: 0 0 40px 0 !important;
  list-style: none !important;
  width: 100% !important;
}

@media (min-width: 768px) {
  .single-product .related.products ul.products,
  .single-product section.related ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (min-width: 1024px) {
  .single-product .related.products ul.products,
  .single-product section.related ul.products {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* Related Product Card */
.single-product .related.products ul.products li.product,
.single-product section.related ul.products li.product {
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  background-color: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  float: none !important;
}

.single-product .related.products ul.products li.product a.woocommerce-LoopProduct-link {
  display: flex !important;
  flex-direction: column !important;
  text-decoration: none !important;
  color: inherit !important;
}

.single-product .related.products ul.products li.product img {
  width: 100% !important;
  aspect-ratio: 4 / 5 !important;
  object-fit: cover !important;
  background-color: var(--velora-gray-200) !important;
  margin-bottom: 14px !important;
  display: block !important;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.single-product .related.products ul.products li.product:hover img {
  transform: scale(1.03) !important;
}

.single-product .related.products ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-editorial) !important;
  font-size: 1.25rem !important;
  font-weight: 400 !important;
  color: var(--velora-black) !important;
  margin: 6px 0 !important;
  line-height: 1.25 !important;
}

.single-product .related.products ul.products li.product .price {
  font-family: var(--font-ui) !important;
  font-size: 0.98rem !important;
  font-weight: 600 !important;
  color: var(--velora-black) !important;
  margin-bottom: 16px !important;
  display: block !important;
}

.single-product .related.products ul.products li.product .button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 20px !important;
  background-color: var(--velora-black) !important;
  color: var(--velora-ivory) !important;
  font-family: var(--font-ui) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  border: 1px solid var(--velora-black) !important;
  border-radius: 0 !important;
  transition: all var(--transition-fast) !important;
  margin-top: auto !important;
  text-decoration: none !important;
  text-align: center !important;
}

.single-product .related.products ul.products li.product .button:hover {
  background-color: var(--velora-burgundy) !important;
  border-color: var(--velora-burgundy) !important;
  color: #FFFFFF !important;
}
