/* =====================================================
   HatLand — Single product: gallery, summary, tabs, related, sticky bar
   ===================================================== */

.hl-single-top { margin-bottom: 22px; }

.hl-single-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(26px, 4vw, 54px); align-items: start; position: relative; }
.hl-single-summary { position: sticky; top: calc(var(--hl-header-h) + 66px); }
.hl-single-gallery { position: relative; }

/* ---------- تب‌های ووکامرس (بازنویسی استایل) ---------- */
.hl-single-tabs { margin-top: clamp(34px, 5vw, 60px); background: var(--hl-surface); border: 1px solid var(--hl-line); border-radius: var(--hl-radius-lg); overflow: hidden; }
.hl-single-tabs .wc-tabs { display: flex; gap: 4px; padding: 14px 18px 0; border-bottom: 1px solid var(--hl-line); overflow-x: auto; scrollbar-width: none; margin: 0; list-style: none; }
.hl-single-tabs .wc-tabs::-webkit-scrollbar { display: none; }
.hl-single-tabs .wc-tabs li { margin-bottom: 0; background: none; border: 0; }
.hl-single-tabs .wc-tabs li a {
  display: block; padding: 12px 24px; font-weight: 700; font-size: 14.5px;
  color: var(--hl-ink-soft); border-radius: 14px 14px 0 0; position: relative;
}
.hl-single-tabs .wc-tabs li a:hover { color: var(--hl-primary); }
.hl-single-tabs .wc-tabs li.active a { color: var(--hl-primary); }
.hl-single-tabs .wc-tabs li.active a::after { content: ''; position: absolute; bottom: 0; inset-inline: 0; height: 2.5px; background: var(--hl-primary); }
.hl-single-tabs .woocommerce-Tabs-panel, .hl-single-tabs .panel { margin: 0; padding: clamp(22px, 4vw, 40px) !important; width: 100%; }
.hl-single-tabs .panel h2:first-child { font-size: 19px; margin-bottom: 16px; }
.hl-single-tabs .woocommerce-Reviews { display: grid; gap: 30px; }

/* ---------- Gallery ---------- */
.hl-gallery { display: flex; flex-direction: column-reverse; gap: 14px; }
.hl-gallery__main {
  background: var(--hl-surface); border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-lg); overflow: hidden; position: relative;
}
.woocommerce-product-gallery { position: relative; }
.woocommerce-product-gallery__wrapper { margin: 0; transition: all .4s ease; }
.woocommerce-product-gallery__image { aspect-ratio: 1/1; }
.woocommerce-product-gallery__image img { width: 100%; height: 100%; object-fit: cover; }
.woocommerce-product-gallery__trigger {
  position: absolute; top: 18px; inset-inline-start: 18px; z-index: 9;
  width: 42px; height: 42px; border-radius: 50%; background: #fff; box-shadow: var(--hl-shadow);
  display: grid; place-items: center; text-indent: -9999px; overflow: hidden;
}
.woocommerce-product-gallery__trigger::before {
  content: ''; width: 18px; height: 18px; text-indent: 0; position: absolute;
  background: var(--hl-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center/contain no-repeat;
}
.hl-gallery__thumbs { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.hl-gallery__thumbs::-webkit-scrollbar { display: none; }
.flex-control-thumbs { display: flex; gap: 12px; overflow-x: auto; }
.flex-control-thumbs li { flex: 0 0 84px; width: 84px !important; }
.flex-control-thumbs img {
  width: 84px; height: 84px; object-fit: cover; border-radius: 14px; cursor: pointer;
  border: 2px solid transparent; opacity: .65; transition: all .25s ease;
}
.flex-control-thumbs img.flex-active, .flex-control-thumbs img:hover { opacity: 1; border-color: var(--hl-primary); }

/* ---------- Summary ---------- */
.hl-single-summary__cat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--hl-primary); background: var(--hl-primary-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 14px; }
.hl-single-summary h1 { font-size: clamp(21px, 3vw, 30px); line-height: 1.65; }
.hl-single-summary__meta { display: flex; align-items: center; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.hl-single-summary__rate { display: flex; align-items: center; gap: 6px; color: var(--hl-accent); font-weight: 700; font-size: 13.5px; }
.hl-single-summary__rate .hl-icon { width: 16px; height: 16px; }
.hl-single-summary__sku { color: var(--hl-ink-soft); font-size: 12.5px; }
.hl-single-summary__excerpt { color: var(--hl-ink-soft); font-size: 14.5px; margin-top: 16px; }

.hl-single-price { margin-top: 22px; background: var(--hl-surface); border: 1px solid var(--hl-line); border-radius: var(--hl-radius-lg); padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.hl-single-price .price { font-size: 24px; font-weight: 800; color: var(--hl-primary); display: flex; align-items: baseline; gap: 6px; }
.hl-single-price .price del { font-size: 15px; color: var(--hl-ink-soft); font-weight: 500; margin-inline-start: 10px; }
.hl-single-price .price ins { text-decoration: none; }
.hl-single-price__save { background: var(--hl-danger); color: #fff; font-size: 12.5px; font-weight: 800; padding: 6px 14px; border-radius: 999px; }

/* Add to cart block */
.hl-cartbox { margin-top: 18px; display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.hl-cartbox form.cart { display: flex; gap: 12px; flex: 1; align-items: stretch; margin: 0; flex-wrap: wrap; }
.hl-cartbox .quantity { flex-shrink: 0; }
.hl-cartbox .single_add_to_cart_button::before {
  content: ''; width: 19px; height: 19px; flex-shrink: 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='20' r='1.6'/%3E%3Ccircle cx='17' cy='20' r='1.6'/%3E%3Cpath d='M3 4h2l2.5 11.5a1.5 1.5 0 0 0 1.5 1.2h7.6a1.5 1.5 0 0 0 1.5-1.2L19.5 8H6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='20' r='1.6'/%3E%3Ccircle cx='17' cy='20' r='1.6'/%3E%3Cpath d='M3 4h2l2.5 11.5a1.5 1.5 0 0 0 1.5 1.2h7.6a1.5 1.5 0 0 0 1.5-1.2L19.5 8H6'/%3E%3C/svg%3E") center/contain no-repeat;
}
.hl-cartbox .single_add_to_cart_button {
  flex: 1; min-width: 200px; height: 54px; border: 0; border-radius: var(--hl-radius);
  background: var(--hl-primary); color: #fff; font-weight: 800; font-size: 15.5px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 12px 26px -10px rgba(194,89,59,.55); transition: all .25s ease;
}
.hl-cartbox .single_add_to_cart_button:hover { background: var(--hl-primary-dark); transform: translateY(-2px); }
.hl-cartbox .single_add_to_cart_button.disabled { opacity: .6; }

/* مرتب‌سازی ووکامرس */
.woocommerce-ordering { margin: 0; }
.woocommerce-ordering select {
  border: 1.5px solid var(--hl-line); border-radius: 999px; padding: 11px 18px;
  font-size: 13.5px; background: var(--hl-surface); font-family: var(--hl-font);
  color: var(--hl-ink); cursor: pointer;
}
.woocommerce-ordering select:focus { outline: none; border-color: var(--hl-primary); }

/* قیمت HTML ووکامرس در قالب تکی */
.hl-single-price .price del { opacity: .55; font-size: .62em; color: var(--hl-ink-soft); }
.hl-single-price .price ins { text-decoration: none; }
.hl-single-price .price .woocommerce-Price-currencySymbol { font-size: 12.5px; font-weight: 600; }
.hl-related .related.products > h2 { font-size: clamp(19px, 2.6vw, 24px); margin-bottom: 20px; }

/* Quantity stepper */
.hl-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--hl-line); border-radius: var(--hl-radius); background: var(--hl-surface); overflow: hidden; height: 54px; }
.hl-qty button {
  width: 44px; align-self: stretch; display: grid; place-items: center;
  color: var(--hl-ink-soft); font-size: 18px; transition: all .2s;
}
.hl-qty button:hover { background: var(--hl-bg); color: var(--hl-primary); }
.hl-qty input[type="number"] {
  width: 52px; border: 0; text-align: center; font-weight: 800; font-size: 15px;
  -moz-appearance: textfield; appearance: textfield; background: none; height: 100%;
}
.hl-qty input::-webkit-outer-spin-button, .hl-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Trust badges */
.hl-trust { margin-top: 22px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.hl-trust__item {
  display: flex; align-items: center; gap: 12px; background: var(--hl-surface);
  border: 1px solid var(--hl-line); border-radius: var(--hl-radius); padding: 13px 16px;
}
.hl-trust__item .hl-icon { width: 22px; height: 22px; color: var(--hl-primary); flex-shrink: 0; }
.hl-trust__item-t { font-weight: 700; font-size: 13px; line-height: 1.5; }
.hl-trust__item-s { font-size: 11.5px; color: var(--hl-ink-soft); }

/* Product meta */
.hl-single-meta { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--hl-line); display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--hl-ink-soft); }
.hl-single-meta a { color: var(--hl-ink-soft); }
.hl-single-meta a:hover { color: var(--hl-primary); }

/* ---------- Tabs ---------- */
.hl-single-tabs { margin-top: clamp(34px, 5vw, 60px); background: var(--hl-surface); border: 1px solid var(--hl-line); border-radius: var(--hl-radius-lg); overflow: hidden; }
.hl-single-tabs__bar { display: flex; gap: 4px; padding: 14px 18px 0; border-bottom: 1px solid var(--hl-line); overflow-x: auto; scrollbar-width: none; }
.hl-single-tabs__bar::-webkit-scrollbar { display: none; }
.hl-single-tabs__bar .hl-tab-btn { padding: 12px 24px; border-radius: 14px 14px 0 0; position: relative; }
.hl-single-tabs__bar .hl-tab-btn.is-active::after { content: ''; position: absolute; bottom: -1px; inset-inline: 0; height: 2.5px; background: var(--hl-primary); }
.hl-single-tabs__body { padding: clamp(22px, 4vw, 40px); }
.hl-single-tabs .hl-tab-panel { margin-top: 0; }
.hl-single-tabs .woocommerce-Reviews { display: grid; gap: 30px; }
.hl-single-tabs .commentlist { list-style: none; padding: 0; }
.hl-single-tabs .comment_container { display: flex; gap: 16px; padding: 20px; background: var(--hl-bg); border-radius: var(--hl-radius); margin-bottom: 14px; }
.hl-single-tabs .comment_container img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.hl-single-tabs .comment-text .star-rating { margin-bottom: 6px; }
.hl-single-tabs .comment-text .meta { color: var(--hl-ink-soft); font-size: 12px; }
.hl-single-tabs .description { font-size: 15px; line-height: 2.1; }

/* star rating مشترک */
.star-rating { display: inline-flex; gap: 2px; color: var(--hl-accent); font-size: 13px; }
.star-rating span { display: none; }

/* ---------- Sticky add-to-cart (mobile) ---------- */
.hl-sticky-cart {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 90;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--hl-line); padding: 12px 18px;
  display: flex; align-items: center; gap: 14px;
  transform: translateY(110%); transition: transform .3s ease;
  box-shadow: 0 -10px 30px -12px rgba(33,29,25,.18);
}
.hl-sticky-cart.is-visible { transform: none; }
.hl-sticky-cart__info { flex: 1; min-width: 0; }
.hl-sticky-cart__name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-sticky-cart__price { color: var(--hl-primary); font-weight: 800; font-size: 14.5px; }
.hl-sticky-cart .hl-btn { padding: 12px 22px; }

/* ---------- Related ---------- */
.hl-related { margin-top: clamp(34px, 5vw, 60px); }

/* WC notice (پیام‌های ووکامرس) */
.hl-notice { background: var(--hl-surface); border: 1px solid var(--hl-line); border-inline-start: 4px solid var(--hl-success); border-radius: var(--hl-radius); padding: 16px 20px; margin-bottom: 22px; font-size: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hl-notice.is-error { border-inline-start-color: var(--hl-danger); }
.hl-notice.is-info { border-inline-start-color: var(--hl-accent); }
.hl-notice a { font-weight: 700; color: var(--hl-primary); }
.hl-notice .button { margin-inline-start: auto; background: var(--hl-ink); color: #fff; border-radius: 999px; padding: 9px 20px; font-weight: 700; font-size: 13px; }
.hl-notice .button:hover { background: var(--hl-primary); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hl-single-layout { grid-template-columns: 1fr; }
  .hl-single-summary { position: static; }
  .hl-trust { grid-template-columns: 1fr; }
  .hl-sticky-cart { display: flex; }
}
@media (min-width: 901px) {
  .hl-sticky-cart { display: none; }
}
