/**
 * InfoHub Store — product page.
 * WooCommerce's single-product markup: gallery on the left, a buy panel on
 * the right, then description/reviews and related products.
 */

.ih-page--product div.product {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 40px;
}

/* ---- Gallery -------------------------------------------------- */

.ih-page--product .woocommerce-product-gallery { border-radius: 20px; }

.ih-page--product .woocommerce-product-gallery__image img { aspect-ratio: 1 / 1; object-fit: cover; }

/* Zoom button: WooCommerce prints an emoji; an icon is drawn in its place. */
.ih-page--product .woocommerce-product-gallery__trigger {
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 1px solid hsl(var(--ih-border));
  border-radius: 50%;
  background-color: hsl(var(--ih-card));
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
  font-size: 0;
  transition: background-color 150ms ease;
}

.ih-page--product .woocommerce-product-gallery__trigger > * { display: none; }

.ih-page--product .woocommerce-product-gallery__trigger::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: hsl(var(--ih-foreground));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3Cpath d='M11 8v6'/%3E%3Cpath d='M8 11h6'/%3E%3C/svg%3E") center / 18px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3Cpath d='M11 8v6'/%3E%3Cpath d='M8 11h6'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.ih-page--product .woocommerce-product-gallery__trigger:hover { background-color: hsl(var(--ih-accent)); }

.ih-page--product .flex-control-thumbs { gap: 10px; padding: 12px; border-top: 1px solid hsl(var(--ih-border)); }
.ih-page--product .flex-control-thumbs img { aspect-ratio: 1 / 1; object-fit: cover; border: 2px solid transparent; border-radius: 10px; }
.ih-page--product .flex-control-thumbs img.flex-active { border-color: hsl(var(--ih-primary)); }

/* ---- Buy panel ------------------------------------------------ */

.ih-page--product .summary {
  padding: 32px;
  border-radius: 20px;
}

.ih-store .ih-product-category {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background-color: hsl(var(--ih-primary) / 0.1);
  color: hsl(var(--ih-primary));
  font-size: 12px;
  font-weight: 600;
}

.ih-store .ih-product-category:hover { background-color: hsl(var(--ih-primary) / 0.18); text-decoration: none; }

.ih-store .ih-page--product .product_title {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.ih-page--product .woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: hsl(var(--ih-muted-foreground));
  font-size: 13px;
}

/* Price: set apart from the title, with the amount as the largest thing in the panel. */
.ih-page--product .summary .price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 22px 0 0;
  padding-top: 22px;
  border-top: 1px solid hsl(var(--ih-border));
  color: hsl(var(--ih-foreground));
  font-size: clamp(38px, 4vw, 46px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.ih-page--product .summary .price .woocommerce-Price-currencySymbol {
  margin-right: 2px;
  color: hsl(var(--ih-muted-foreground));
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: 0.95em;
}

.ih-page--product .summary .price del .woocommerce-Price-currencySymbol { font-size: 1em; vertical-align: baseline; }

.ih-page--product .summary .price del { order: -1; flex-basis: 100%; color: hsl(var(--ih-muted-foreground)); font-size: 16px; font-weight: 500; letter-spacing: 0; line-height: 1.4; }
.ih-page--product .summary .price ins { text-decoration: none; }

.ih-page--product .summary .ih-pix-price { margin: 14px 0 0 !important; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.ih-page--product .summary .ih-pix-price strong { font-size: 17px; }
.ih-page--product .summary .ih-pix-price small { font-size: 12px; }

.ih-page--product .woocommerce-product-details__short-description {
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.6;
}

.ih-page--product .woocommerce-product-details__short-description > :last-child { margin-bottom: 0; }

/* Buttons: "Comprar agora" first, the native add-to-cart as the second option. */
.ih-page--product form.cart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0 0;
}

.ih-page--product form.cart .quantity { align-self: flex-start; }

.ih-store .ih-page--product form.cart .button {
  flex: none;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  border-radius: 12px;
  font-size: 16px;
}

.ih-store .ih-page--product form.cart .ih-buy-now { order: 1; }

/* Only when "Comprar agora" exists does the native button step back. */
.ih-store .ih-page--product form.cart:has(.ih-buy-now) .single_add_to_cart_button {
  order: 2;
  min-height: 48px;
  border: 1px solid hsl(var(--ih-border));
  background-color: hsl(var(--ih-card));
  color: hsl(var(--ih-foreground));
  font-size: 15px;
}

.ih-store .ih-page--product form.cart:has(.ih-buy-now) .single_add_to_cart_button:hover {
  opacity: 1;
  background-color: hsl(var(--ih-accent));
}

.ih-page--product .stock { margin: 16px 0 0; font-size: 13px; font-weight: 600; }
.ih-page--product .stock.out-of-stock { color: hsl(var(--ih-destructive)); }

/* "Ver vídeo" and "Compartilhar". */
.ih-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.ih-product-actions > * { flex: 1 1 0; min-width: 150px; }

.ih-store .ih-product-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background-color: hsl(var(--ih-muted));
  color: hsl(var(--ih-foreground));
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.ih-store .ih-product-action:hover { background-color: hsl(var(--ih-accent)); }
/* "Ver vídeo" in YouTube red, so it reads as a play button. */
.ih-store .ih-product-action--video { background-color: #ff0000; color: #fff; }
.ih-store .ih-product-action--video:hover { background-color: #cc0000; }
.ih-store .ih-product-action--video .ih-icon { fill: currentColor; }

.ih-store .ih-product-action:focus-visible { outline: 2px solid hsl(var(--ih-ring)); outline-offset: 2px; }

.ih-product-share .ih-popover__panel { width: 220px; }
.ih-store .ih-product-share .ih-popover__link { width: 100%; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.ih-store .ih-product-share .ih-popover__link .ih-icon { color: hsl(var(--ih-muted-foreground)); }

/* Store advantages. */
.ih-product-advantages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin: 24px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid hsl(var(--ih-border));
  list-style: none;
}

.ih-product-advantages li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.ih-product-advantages .ih-icon { flex-shrink: 0; margin-top: 2px; color: hsl(var(--ih-primary)); }
.ih-product-advantages span { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ih-product-advantages strong { font-size: 13px; font-weight: 600; }
.ih-product-advantages small { color: hsl(var(--ih-muted-foreground)); font-size: 12px; }

.ih-page--product .product_meta {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 20px;
  font-size: 12px;
}

/* ---- Description and reviews ---------------------------------- */

.ih-page--product .woocommerce-tabs { margin-top: 8px; }

/* With a single section its title is enough; the tab strip only appears when
   there is something to switch between, and then it replaces the titles. */
.ih-page--product .woocommerce-tabs ul.tabs:has(li:only-child) { display: none; }
.ih-store .ih-page--product .woocommerce-Tabs-panel > h2:first-child { margin: 0 0 16px; font-size: 20px; font-weight: 700; }
.ih-page--product .woocommerce-tabs:has(ul.tabs li:nth-child(2)) .woocommerce-Tabs-panel > h2:first-child { display: none; }

.ih-page--product .woocommerce-Tabs-panel { padding: 32px; border-radius: 20px; }

.ih-page--product .woocommerce-Tabs-panel--description { font-size: 15px; line-height: 1.7; }
.ih-page--product .woocommerce-Tabs-panel--description > * { max-width: 760px; }
.ih-page--product .woocommerce-Tabs-panel--description > :last-child { margin-bottom: 0; }
.ih-page--product .woocommerce-Tabs-panel--description p { margin: 0 0 16px; color: hsl(240 5% 26%); }
.ih-store .ih-page--product .woocommerce-Tabs-panel--description h1,
.ih-store .ih-page--product .woocommerce-Tabs-panel--description h2 { margin: 28px 0 12px; font-size: 19px; font-weight: 700; }
.ih-store .ih-page--product .woocommerce-Tabs-panel--description h3 { margin: 22px 0 8px; font-size: 16px; font-weight: 600; }
.ih-page--product .woocommerce-Tabs-panel--description ul,
.ih-page--product .woocommerce-Tabs-panel--description ol { margin: 0 0 16px; padding-left: 22px; color: hsl(240 5% 26%); }
.ih-page--product .woocommerce-Tabs-panel--description li { margin-bottom: 6px; }
.ih-page--product .woocommerce-Tabs-panel--description img { height: auto; max-width: 100%; border-radius: 12px; }

/* Embedded videos keep 16:9 and never overflow the column. */
.ih-page--product .woocommerce-Tabs-panel--description iframe,
.ih-page--product .woocommerce-Tabs-panel--description video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 0 16px;
  border: 0;
  border-radius: 14px;
  background-color: #000;
}

/* Reviews. */
.ih-page--product #reviews .woocommerce-Reviews-title,
.ih-page--product #reviews .comment-reply-title { display: block; margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.ih-page--product #reviews .woocommerce-noreviews { margin: 0 0 20px; color: hsl(var(--ih-muted-foreground)); }
.ih-page--product #reviews ol.commentlist { margin: 0 0 24px; padding: 0; list-style: none; }
.ih-page--product #reviews ol.commentlist li { padding: 16px 0; border-bottom: 1px solid hsl(var(--ih-border)); }
.ih-page--product #reviews .comment_container { display: flex; gap: 12px; }
.ih-page--product #reviews .comment_container img.avatar { width: 40px; height: 40px; border-radius: 50%; }
.ih-page--product #reviews .comment-text .meta { margin: 4px 0 6px; color: hsl(var(--ih-muted-foreground)); font-size: 13px; }
.ih-page--product #review_form { max-width: 640px; }
.ih-page--product #review_form .comment-notes { color: hsl(var(--ih-muted-foreground)); font-size: 13px; }
.ih-page--product #review_form label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.ih-page--product #review_form p { margin: 0 0 16px; }

.ih-page--product #review_form input[type="text"],
.ih-page--product #review_form input[type="email"],
.ih-page--product #review_form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid hsl(var(--ih-input, var(--ih-border)));
  border-radius: var(--ih-radius);
  background-color: hsl(var(--ih-card));
  font: inherit;
}

.ih-page--product #review_form textarea { min-height: 120px; resize: vertical; }
.ih-page--product #review_form .comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 8px; }
.ih-page--product #review_form .comment-form-cookies-consent label { margin: 0; font-weight: 400; }

.ih-store .ih-page--product #review_form input[type="submit"] {
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--ih-radius);
  background-color: hsl(var(--ih-primary));
  color: hsl(var(--ih-primary-foreground));
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Star picker: WooCommerce turns the select into five links. */
.ih-page--product p.stars { margin: 0 0 16px; }
.ih-page--product p.stars span { display: inline-flex; gap: 4px; }

.ih-store .ih-page--product p.stars a {
  position: relative;
  width: 28px;
  height: 28px;
  overflow: hidden;
  color: hsl(var(--ih-warning));
  font-size: 0;
  text-decoration: none;
}

.ih-page--product p.stars a::before { content: '★'; position: absolute; inset: 0; font-size: 26px; line-height: 28px; text-align: center; }
.ih-page--product p.stars a:hover ~ a::before,
.ih-page--product p.stars.selected a.active ~ a::before { color: hsl(var(--ih-border)); }
.ih-page--product p.stars:not(.selected):not(:hover) a::before { color: hsl(var(--ih-border)); }

.ih-page--product .related,
.ih-page--product .upsells { margin-top: 16px; }

.ih-store .ih-page--product .related > h2,
.ih-store .ih-page--product .upsells > h2 { font-size: 20px; font-weight: 700; }

/* ---- Video dialog --------------------------------------------- */

.ih-video-modal {
  width: min(960px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background-color: #000;
  overflow: visible;
}

.ih-video-modal::backdrop { background-color: rgb(9 9 11 / 0.78); }

.ih-video-modal__frame { aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; }
.ih-video-modal__frame iframe { display: block; width: 100%; height: 100%; border: 0; }

.ih-video-modal__close {
  position: absolute;
  top: -48px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background-color: rgb(255 255 255 / 0.16);
  color: #fff;
  cursor: pointer;
}

.ih-video-modal__close:hover { background-color: rgb(255 255 255 / 0.28); }

/* ---- Responsive ----------------------------------------------- */

@media (max-width: 900px) {
  .ih-page--product div.product { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ih-page--product .summary { padding: 20px; }
  .ih-page--product .summary .price { font-size: 28px; }
  .ih-page--product .woocommerce-Tabs-panel { padding: 20px; }
}

@media (max-width: 460px) {
  .ih-product-advantages { grid-template-columns: minmax(0, 1fr); }
}
