/*
 * Efectos visuales para la pagina de producto General Ecuador.
 * Este archivo se carga solo en productos individuales.
 */

body.single-product {
  --product-effect-shadow: 0 18px 34px rgba(16, 20, 24, 0.14);
  --product-effect-ring: 0 0 0 1px rgba(34, 151, 211, 0.24);
  --product-effect-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body.single-product .single-product-main-image {
  position: relative;
  cursor: zoom-in;
  outline: none;
}

body.single-product .single-product-main-image:focus,
body.single-product .single-product-main-image:focus-visible,
body.single-product .single-product-main-image:active,
body.single-product .single-product-main-image img:focus,
body.single-product .single-product-main-image img:focus-visible,
body.single-product .single-product-main-image img:active {
  outline: none;
  box-shadow: none;
}

.single-product-image-action {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  background: rgba(6, 96, 142, 0.88);
  color: #fff;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 950;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

body.single-product .single-product-main-image:hover .single-product-image-action,
body.single-product .single-product-main-image:focus-visible .single-product-image-action,
body.single-product .single-product-main-image:focus-within .single-product-image-action {
  opacity: 1;
  transform: translateY(0);
}

.general-product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(10, 14, 18, 0.92);
  padding: clamp(18px, 4vw, 44px);
  animation: productLightboxIn 0.18s ease both;
}

.general-product-lightbox.is-closing {
  animation: productLightboxIn 0.14s ease reverse both;
}

.general-product-lightbox img {
  display: block;
  max-width: min(92vw, 980px);
  max-height: 88vh;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  animation: productLightboxImageIn 0.22s var(--product-effect-ease) both;
}

.general-product-lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.general-product-lightbox-close:hover,
.general-product-lightbox-close:focus-visible {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

@keyframes productLightboxIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes productLightboxImageIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

body.single-product .general-variation-option:hover:not(:disabled):not(.is-disabled):not(.is-selected),
body.single-product .general-variation-option:focus-visible:not(:disabled):not(.is-disabled):not(.is-selected) {
  border-color: rgba(34, 151, 211, 0.54);
  background: var(--blue-soft);
  color: var(--brand-dark);
  box-shadow: 0 8px 16px rgba(34, 151, 211, 0.12);
}

body.single-product .general-variation-option.is-selected {
  box-shadow: 0 10px 18px rgba(34, 151, 211, 0.24);
}

body.single-product .general-variation-option:disabled,
body.single-product .general-variation-option.is-disabled {
  opacity: 0.58;
}

body.single-product .single-product-price {
  transition:
    color 0.2s ease,
    transform 0.2s var(--product-effect-ease);
}

body.single-product .single-product-price.is-price-updated,
body.single-product .woocommerce-variation-price.is-price-updated {
  animation: productPriceFlash 0.42s var(--product-effect-ease) both;
}

@keyframes productPriceFlash {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  45% {
    color: var(--brand-dark);
    opacity: 0.72;
    transform: scale(0.98);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

body.single-product .single-product-buy-button,
body.single-product .single-product-native-cart .single_add_to_cart_button {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 9px 20px rgba(34, 151, 211, 0.22);
}

body.single-product .single-product-buy-button::before,
body.single-product .single-product-native-cart .single_add_to_cart_button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  pointer-events: none;
  transform: translateX(-110%);
}

body.single-product .single-product-buy-button:hover::before,
body.single-product .single-product-buy-button:focus-visible::before,
body.single-product .single-product-native-cart .single_add_to_cart_button:hover::before,
body.single-product .single-product-native-cart .single_add_to_cart_button:focus-visible::before {
  transform: translateX(110%);
  transition: transform 0.52s ease;
}

body.single-product .single-product-buy-button:hover,
body.single-product .single-product-buy-button:focus-visible,
body.single-product .single-product-native-cart .single_add_to_cart_button:hover,
body.single-product .single-product-native-cart .single_add_to_cart_button:focus-visible {
  box-shadow: 0 13px 28px rgba(34, 151, 211, 0.32);
}

body.has-general-product-sticky {
  padding-bottom: 72px;
}

.general-product-sticky-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -12px 28px rgba(16, 20, 24, 0.12);
  transform: translateY(105%);
  transition: transform 0.28s var(--product-effect-ease);
}

.general-product-sticky-bar.is-visible {
  transform: translateY(0);
}

.general-product-sticky-inner {
  display: grid;
  width: calc(100% - var(--general-home-gutter));
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 0 auto;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}

.general-product-sticky-info {
  min-width: 0;
}

.general-product-sticky-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.general-product-sticky-price {
  color: var(--brand-dark);
  font-size: 17px;
  font-weight: 950;
  line-height: 1.1;
}

.general-product-sticky-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s var(--product-effect-ease);
}

.general-product-sticky-button:hover,
.general-product-sticky-button:focus-visible {
  background: var(--brand-dark);
  box-shadow: 0 10px 22px rgba(34, 151, 211, 0.22);
  transform: translateY(-1px);
}

.general-product-sticky-button:disabled {
  background: rgba(16, 20, 24, 0.22);
  color: rgba(16, 20, 24, 0.48);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

body.single-product .single-product-info-grid article {
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s var(--product-effect-ease);
}

body.single-product .single-product-info-grid article:hover,
body.single-product .single-product-info-grid article:focus-within {
  border-color: rgba(34, 151, 211, 0.34);
  box-shadow: var(--product-effect-shadow);
  transform: translateY(-2px);
}

body.single-product .single-product-service-list li {
  position: relative;
  padding-left: 18px;
}

body.single-product .single-product-service-list li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--brand);
  transform: translateY(-50%);
}

@media (max-width: 760px) {
  body.has-general-product-sticky {
    padding-bottom: 82px;
  }

  .general-product-sticky-inner {
    width: calc(100% - 28px);
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .general-product-sticky-info {
    display: none;
  }

  .general-product-sticky-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.single-product .single-product-price.is-price-updated,
  body.single-product .woocommerce-variation-price.is-price-updated,
  .general-product-lightbox,
  .general-product-lightbox img {
    animation: none;
  }

  body.single-product .single-product-main-image,
  .single-product-image-action,
  body.single-product .single-product-buy-button,
  body.single-product .single-product-native-cart .single_add_to_cart_button,
  .general-product-sticky-bar,
  body.single-product .single-product-info-grid article {
    transition: none;
  }

  body.single-product .single-product-info-grid article:hover,
  body.single-product .single-product-info-grid article:focus-within {
    transform: none;
  }
}
