/* ==========================================================================
   Ficha de producto — woocommerce/single-product.php
   Enqueued on is_product() from functions.php.

   Only the structure the markup needs to hold together: the two columns, the
   vertical thumbnails, the stepper and the tabs. The look is yours to define.
   ========================================================================== */

.single-product-page {
  padding: 3rem 0;
}

/* --- Layout --- */

.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 3rem;
}

/* --- Gallery --- */

.product-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.product-gallery.has-thumbs {
  grid-template-columns: 88px 1fr;
}

.product-gallery__thumbs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-gallery__thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: none;
  cursor: pointer;
}

.product-gallery__thumb.is-active,
.product-gallery__thumb:hover {
  border-color: var(--accent-color);
}

.product-gallery__thumb img {
  width: 100%;
  aspect-ratio: 1;
}

.product-gallery__main {
  position: relative;
}

.product-gallery__main img {
  width: 100%;
  border-radius: 1rem;
  transition: opacity 0.2s ease;
}

/* --- Loader while a thumbnail is being swapped in --- */

.product-gallery__loader {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  border-radius: 1rem;
  background-color: rgba(255, 255, 255, 0.55);
}

.product-gallery.is-loading .product-gallery__loader {
  display: grid;
}

.product-gallery.is-loading .product-gallery__main img {
  opacity: 0.5;
}

/* --- Summary --- */

.product-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.product-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background-color: var(--isabelline);
  font-size: 13px;
  font-weight: 600;
}

.product-title {
  font-size: 40px;
  font-weight: bold;
  line-height: 1.1;
}

.product-price {
  color: var(--accent-color);
  font-size: 32px;
  font-weight: bold;
}

.product-short-description p + p {
  margin-top: 1rem;
}

.product-attributes__row + .product-attributes__row {
  margin-top: 0.5rem;
}

.product-attributes__label {
  font-weight: 600;
}

/* --- Add to cart --- */

.product-actions {
  width: 100%;
}

.product-actions form.cart {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

/* The pill keeps its own width; the buttons take the full column. */
.product-actions .quantity {
  align-self: flex-start;
}

.product-actions .quantity.has-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.618em 1em;
  border: 2px solid var(--kilimanjaro);
  border-radius: 9999px;
}

.product-actions .quantity.has-stepper input.qty {
  width: 44px;
  border: 0;
  text-align: center;
}

.quantity__button {
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* The theme's button, applied to WooCommerce's own submit. */
.product-actions .single_add_to_cart_button,
.product-actions .product-buy-now {
  width: 100%;
}

.product-actions .single_add_to_cart_button {
  background-color: #fff !important;
  border: solid 2px var(--kilimanjaro) !important;
  border-radius: 9999px !important;
  color: var(--kilimanjaro) !important;
}

.product-buy-now {
  cursor: pointer;
}

/* Variable products: WooCommerce lays out its selectors in a table. */
.product-actions .variations {
  width: 100%;
}

.product-actions .variations th,
.product-actions .variations td {
  padding-bottom: 0.75rem;
  text-align: left;
  vertical-align: middle;
}

/* --- Trust badges --- */

.product-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.product-trust__item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-trust__icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.product-trust__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-trust__title {
  font-size: 14px;
  font-weight: 600;
}

.product-trust__text {
  font-size: 13px;
}

/* --- Tabs --- */

.product-tabs {
  margin-top: 4rem;
}

.product-tabs .wc-tabs {
  display: flex;
  gap: 2rem;
  border-bottom: 1px solid var(--isabelline);
}

.product-tabs .wc-tabs li a {
  display: block;
  padding: 0 0 12px;
  font-weight: 600;
}

.product-tabs .wc-tabs li.active a {
  border-bottom: 2px solid var(--accent-color);
  color: var(--accent-color);
}

.product-tabs .woocommerce-Tabs-panel {
  max-width: 640px;
  padding-top: 1.5rem;
}

.product-tabs .woocommerce-Tabs-panel p + p {
  margin-top: 1rem;
}

/* --- Related --- */

.product-related {
  margin-top: 4rem;
}

.product-related__header {
  margin-bottom: 1.5rem;
}

.product-related__link {
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 991px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 575px) {
  .product-gallery.has-thumbs {
    grid-template-columns: 64px 1fr;
  }

  .product-title {
    font-size: 30px;
  }
}
