/* ==========================================================================
   Single Product Page Styles
   ========================================================================== */

/* Astra Customizer handles the entry-header (featured image + title above
   the WooCommerce content). This rule is a safety net — #primary ID gives
   enough specificity without !important. */
body.single-product #primary > header.entry-header {
  display: none;
}

/* ==========================================================================
   Outer wrapper
   Astra targets .ast-article-single — adding it to our selector beats it
   without needing !important.
   ========================================================================== */

.pitbull-single-product.ast-article-single {
  display: block;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Top Section — 2-column grid
   .pitbull-product-top is our custom class; nothing external targets it,
   so plain display:grid wins.
   ========================================================================== */

.pitbull-product-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  direction: ltr; /* image left, details right regardless of RTL */
  margin: 2rem;
}

/* WooCommerce default sets float + width on .summary and .images.
   Grid ignores floats on grid items, but an explicit width on a grid item
   still applies inside its cell. We beat WooCommerce's selector
   (.woocommerce div.product div.summary = 0,3,2) by adding the product
   class and entry-summary class to reach 0,5,0. */
.pitbull-single-product.product
  .pitbull-product-top
  > .pitbull-product-gallery-col,
.pitbull-single-product.product
  .pitbull-product-top
  > .pitbull-product-summary-col.summary.entry-summary {
  float: none;
  clear: none;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Gallery Column
   ========================================================================== */

.pitbull-product-gallery-col {
  direction: ltr;
}

.pitbull-product-gallery-col .woocommerce-product-gallery {
  height: 100%;
}

/* WooCommerce: .woocommerce div.product div.images = (0,3,2).
   Adding .pitbull-single-product prefix brings us to (0,4,0) which wins. */
.pitbull-single-product
  .pitbull-product-gallery-col
  .woocommerce-product-gallery.images {
  float: none;
  width: 100%;
  max-width: none;
  clear: none;
  position: relative;
  margin: 0;
  height: 100%;
}

.pitbull-product-gallery-col .woocommerce-product-gallery__wrapper {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  height: 100%;
}

.pitbull-product-gallery-col .woocommerce-product-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
}

/* WooCommerce sets a max-width on gallery images in some versions.
   .pitbull-product-gallery-col .woocommerce-product-gallery__image img = 0,2,1
   beats WooCommerce's generic img selectors. */
.pitbull-product-gallery-col .woocommerce-product-gallery__image img,
.pitbull-product-gallery-col .woocommerce-product-gallery__image a img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  height: 100% !important;
}

/* Zoom trigger */
.pitbull-product-gallery-col .woocommerce-product-gallery__trigger {
  top: 0.75rem;
  left: 0.75rem;
  right: auto;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.pitbull-product-gallery-col .woocommerce-product-gallery__trigger:hover {
  background: #fff;
}

/* Sale badge */
.pitbull-product-gallery-col .onsale {
  background: var(--color-accent, #ccb87a);
  color: #fff;
  font-family: var(--font-family-fredoka, "Fredoka", sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  top: 0.75rem;
  right: 0.75rem;
  left: auto;
  margin: 0;
  min-height: auto;
  min-width: auto;
  line-height: 1.6;
}

/* Thumbnail strip below main image */
.pitbull-product-gallery-col .flex-control-thumbs {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.pitbull-product-gallery-col .flex-control-thumbs li {
  flex: 0 0 calc(25% - 0.375rem);
  margin: 0;
}

.pitbull-product-gallery-col .flex-control-thumbs img {
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    border-color 0.2s ease,
    opacity 0.2s ease;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  opacity: 0.7;
}

.pitbull-product-gallery-col .flex-control-thumbs img:hover,
.pitbull-product-gallery-col .flex-control-thumbs img.flex-active {
  border-color: var(--color-text-global, #2a8c8d);
  opacity: 1;
}

/* ==========================================================================
   Summary Column
   ========================================================================== */

.pitbull-product-summary-col {
  direction: rtl;
  text-align: right;
}

/* Breadcrumb — Astra hooks this into woocommerce_single_product_summary
   at priority 0 so it lands at the top of our summary column. */
.pitbull-product-summary-col .woocommerce-breadcrumb {
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 0.8125rem;
  color: #9ca3af;
  direction: rtl;
  text-align: right;
  display: block;
  margin: 0 0 1rem;
  line-height: 1.4;
}

.pitbull-product-summary-col .woocommerce-breadcrumb a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pitbull-product-summary-col .woocommerce-breadcrumb a:hover {
  color: var(--color-text-global, #2a8c8d);
}

/* Product title */
.pitbull-product-summary-col .product_title.entry-title {
  font-family: var(--font-family-fredoka, "Fredoka", sans-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-global, #2a8c8d);
  margin: 0 0 0.5rem;
  line-height: 1.2;
  text-align: right;
}

/* Astra single-product-category tag */
.pitbull-product-summary-col .single-product-category {
  display: block;
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 0.875rem;
  color: var(--color-accent, #ccb87a);
  margin-bottom: 0.75rem;
  direction: rtl;
  text-align: right;
}

.pitbull-product-summary-col .single-product-category a {
  color: var(--color-accent, #ccb87a);
  text-decoration: none;
  font-weight: 600;
}

.pitbull-product-summary-col .single-product-category a:hover {
  text-decoration: underline;
}

/* Star rating */
.pitbull-product-summary-col .woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-direction: row-reverse;
  justify-content: flex-end;
  margin-bottom: 1rem;
  direction: rtl;
}

.pitbull-product-summary-col .star-rating {
  color: var(--color-accent, #ccb87a);
  font-size: 1rem;
}

.pitbull-product-summary-col .woocommerce-review-link {
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 0.875rem;
  color: #6b7280;
  text-decoration: none;
}

.pitbull-product-summary-col .woocommerce-review-link:hover {
  color: var(--color-text-global, #2a8c8d);
}

/* Price */
.pitbull-product-summary-col .price {
  font-family: var(--font-family-fredoka, "Fredoka", sans-serif);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-text-global, #2a8c8d);
  margin-bottom: 1.25rem;
  display: block;
  direction: rtl;
}

.pitbull-product-summary-col .price del {
  color: #9ca3af;
  font-size: 1.25rem;
  font-weight: 400;
  margin-left: 0.5rem;
  opacity: 0.8;
}

.pitbull-product-summary-col .price ins {
  text-decoration: none;
  color: #dc2626;
}

/* Astra stock availability */
.pitbull-product-summary-col .ast-stock-detail {
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 0.9rem;
  direction: rtl;
  text-align: right;
  margin: 0 0 1rem;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.pitbull-product-summary-col .ast-stock-detail .ast-stock-avail {
  color: #6b7280;
  font-weight: 600;
}

.pitbull-product-summary-col .ast-stock-detail .stock.in-stock {
  color: #059669;
}

.pitbull-product-summary-col .ast-stock-detail .stock.out-of-stock {
  color: #dc2626;
}

/* Short description */
.pitbull-product-summary-col .woocommerce-product-details__short-description {
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: var(--font-size-text, 1.125rem);
  color: #374151;
  line-height: 1.75;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  direction: rtl;
}

/* --- Add to cart form --- */
.pitbull-product-summary-col form.cart {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-direction: row-reverse;
  margin-bottom: 1.5rem;
}

/* Quantity — plain wrapper (no Astra +/- buttons) */
.pitbull-product-summary-col .quantity {
  display: flex;
  align-items: center;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

/* Astra quantity with +/- buttons (.buttons_added).
   Astra targets .quantity generically; our parent selector makes ours more
   specific so no !important needed. */
.pitbull-product-summary-col .quantity.buttons_added {
  display: flex;
  align-items: center;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  padding: 0;
}

.pitbull-product-summary-col .quantity.buttons_added .minus,
.pitbull-product-summary-col .quantity.buttons_added .plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  padding: 0.6rem 0;
  background: #f3f4f6;
  color: var(--color-text-global, #2a8c8d);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  border-radius: 0;
  transition: background 0.15s ease;
  line-height: 1;
  flex-shrink: 0;
}

.pitbull-product-summary-col .quantity.buttons_added .minus:hover,
.pitbull-product-summary-col .quantity.buttons_added .plus:hover {
  background: var(--color-background, #c7e1e2);
}

.pitbull-product-summary-col .quantity.buttons_added .qty {
  border: none;
  border-right: 1px solid #e5e7eb;
  border-left: 1px solid #e5e7eb;
  border-radius: 0;
  width: 56px;
  text-align: center;
}

.pitbull-product-summary-col .qty {
  font-family: var(--font-family-fredoka, "Fredoka", sans-serif);
  font-size: 1.125rem;
  width: 60px;
  padding: 0.6rem 0.5rem;
  text-align: center;
  border: none;
  outline: none;
  color: #1a1a1a;
  background: transparent;
  -moz-appearance: textfield;
}

.pitbull-product-summary-col .qty::-webkit-outer-spin-button,
.pitbull-product-summary-col .qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Add to cart button — matches .btn-primary design system (gold, rounded).
   Bumping to .pitbull-single-product prefix beats Astra/WC button selectors. */
.pitbull-single-product
  .pitbull-product-summary-col
  .single_add_to_cart_button {
  font-family: var(--font-family-fredoka, "Fredoka", sans-serif);
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
  padding: 0.75rem 1.75rem;
  background: var(--color-accent, #ccb87a);
  color: #fff;
  border: 2px solid var(--color-accent, #ccb87a);
  border-radius: 2rem;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
  letter-spacing: 0.02em;
  text-align: center;
}

.pitbull-single-product
  .pitbull-product-summary-col
  .single_add_to_cart_button:hover {
  background: #fff;
  color: var(--color-text-global, #2a8c8d);
  border-color: var(--color-text-global, #2a8c8d);
}

.pitbull-single-product
  .pitbull-product-summary-col
  .single_add_to_cart_button.disabled,
.pitbull-single-product
  .pitbull-product-summary-col
  .single_add_to_cart_button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Variable product: attribute table */
.pitbull-product-summary-col table.variations {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  direction: rtl;
}

.pitbull-product-summary-col table.variations td,
.pitbull-product-summary-col table.variations th {
  padding: 0.4rem 0;
  text-align: right;
  vertical-align: middle;
}

.pitbull-product-summary-col table.variations .label label {
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 0.9375rem;
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
  padding-left: 1rem;
}

.pitbull-product-summary-col table.variations select {
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 1rem;
  padding: 0.55rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
  direction: rtl;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.pitbull-product-summary-col table.variations select:focus {
  outline: none;
  border-color: var(--color-text-global, #2a8c8d);
}

.pitbull-product-summary-col .reset_variations {
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 0.8125rem;
  color: #9ca3af;
  text-decoration: none;
  display: inline-block;
  margin-top: 0.25rem;
}

.pitbull-product-summary-col .reset_variations:hover {
  color: var(--color-text-global, #2a8c8d);
}

.pitbull-product-summary-col .woocommerce-variation-price .price {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

/* Stock status */
.pitbull-product-summary-col .stock {
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.pitbull-product-summary-col .in-stock {
  color: #059669;
}

.pitbull-product-summary-col .out-of-stock {
  color: #dc2626;
}

/* Product meta (SKU / categories / tags) */
.pitbull-product-summary-col .product_meta {
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 2;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
  margin-top: 0.5rem;
  direction: rtl;
}

.pitbull-product-summary-col .product_meta span {
  display: block;
}

.pitbull-product-summary-col .product_meta a {
  color: var(--color-text-global, #2a8c8d);
  text-decoration: none;
}

.pitbull-product-summary-col .product_meta a:hover {
  text-decoration: underline;
}

.pitbull-product-summary-col .product_meta .sku_wrapper,
.pitbull-product-summary-col .product_meta .posted_in {
  display: none;
}

/* ==========================================================================
   Lower Section — Tabs + Related
   ========================================================================== */

.pitbull-product-lower {
  padding-top: 2.5rem;
  direction: rtl;
}

/* --- Tabs navigation ---
   WooCommerce targets .woocommerce-tabs ul.tabs (0,2,1).
   .pitbull-product-lower .woocommerce-tabs ul.tabs = 0,3,1 — wins. */
.pitbull-product-lower .woocommerce-tabs ul.tabs,
.pitbull-product-lower .woocommerce-tabs ul.wc-tabs {
  display: flex;
  flex-direction: row-reverse;
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  border-bottom: 2px solid var(--color-background, #c7e1e2);
  gap: 0;
  background: transparent;
}

.pitbull-product-lower .woocommerce-tabs ul.tabs::before,
.pitbull-product-lower .woocommerce-tabs ul.tabs::after {
  display: none;
}

.pitbull-product-lower .woocommerce-tabs ul.tabs li {
  background: none;
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 0;
}

.pitbull-product-lower .woocommerce-tabs ul.tabs li a {
  font-family: var(--font-family-fredoka, "Fredoka", sans-serif);
  font-size: 1.0625rem;
  color: #6b7280;
  padding: 0.75rem 1.5rem;
  display: block;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
  background: transparent;
}

.pitbull-product-lower .woocommerce-tabs ul.tabs li.active a,
.pitbull-product-lower .woocommerce-tabs ul.tabs li a:hover {
  color: var(--color-text-global, #2a8c8d);
  border-bottom-color: var(--color-text-global, #2a8c8d);
  background: transparent;
}

/* Tab panels */
.pitbull-product-lower .woocommerce-Tabs-panel {
  direction: rtl;
  text-align: right;
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: var(--font-size-text, 1.125rem);
  color: #374151;
  line-height: 1.8;
  padding: 0;
  border: none;
  background: transparent;
}

.pitbull-product-lower .woocommerce-Tabs-panel h2 {
  display: none;
}

.pitbull-product-lower .woocommerce-Tabs-panel p {
  margin-bottom: 1rem;
}

/* Additional info table */
.pitbull-product-lower .shop_attributes {
  width: 100%;
  border-collapse: collapse;
  direction: rtl;
}

.pitbull-product-lower .shop_attributes th,
.pitbull-product-lower .shop_attributes td {
  padding: 0.6rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid #f0f0f0;
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 0.9375rem;
}

.pitbull-product-lower .shop_attributes th {
  color: var(--color-text-global, #2a8c8d);
  font-weight: 700;
  width: 35%;
  background: #f9fafb;
}

/* Reviews */
.pitbull-product-lower #reviews {
  direction: rtl;
}

.pitbull-product-lower #reviews h3,
.pitbull-product-lower #reviews h2 {
  font-family: var(--font-family-fredoka, "Fredoka", sans-serif);
  font-size: var(--font-size-h3, 1.5rem);
  color: var(--color-text-global, #2a8c8d);
  margin-bottom: 1.25rem;
  text-align: right;
}

.pitbull-product-lower .comment-text {
  background: #f9fafb;
  border-radius: 10px;
  padding: 1.25rem;
  direction: rtl;
  text-align: right;
  margin-bottom: 1rem;
}

.pitbull-product-lower .review_form_wrapper label {
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 0.9375rem;
  color: #374151;
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
}

.pitbull-product-lower .review_form_wrapper input[type="text"],
.pitbull-product-lower .review_form_wrapper input[type="email"],
.pitbull-product-lower .review_form_wrapper textarea {
  font-family: var(--font-family-alef, "Alef", sans-serif);
  font-size: 1rem;
  padding: 0.7rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  direction: rtl;
  transition: border-color 0.2s ease;
}

.pitbull-product-lower .review_form_wrapper input:focus,
.pitbull-product-lower .review_form_wrapper textarea:focus {
  outline: none;
  border-color: var(--color-text-global, #2a8c8d);
  box-shadow: 0 0 0 3px rgba(42, 140, 141, 0.1);
}

.pitbull-product-lower #submit {
  font-family: var(--font-family-fredoka, "Fredoka", sans-serif);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.7rem 2rem;
  background: var(--color-accent, #ccb87a);
  color: #fff;
  border: 2px solid var(--color-accent, #ccb87a);
  border-radius: 2rem;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
  margin-top: 0.5rem;
}

.pitbull-product-lower #submit:hover {
  background: #fff;
  color: var(--color-text-global, #2a8c8d);
  border-color: var(--color-text-global, #2a8c8d);
}

/* ==========================================================================
   Related + Upsell Products
   .pitbull-product-lower .related.products ul.products = 0,4,1
   beats WooCommerce's .woocommerce ul.products = 0,2,1
   ========================================================================== */

.pitbull-product-lower .related.products {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--color-background, #c7e1e2);
  direction: rtl;
}

.pitbull-product-lower .related.products > h2,
.pitbull-product-lower .upsells.products > h2 {
  font-family: var(--font-family-fredoka, "Fredoka", sans-serif);
  font-size: var(--font-size-h3, 1.5rem);
  color: var(--color-text-global, #2a8c8d);
  font-weight: 600;
  margin: 0 0 1.5rem;
  text-align: right;
}

.pitbull-product-lower .related.products ul.products,
.pitbull-product-lower .upsells.products ul.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pitbull-product-lower .related.products ul.products li.product,
.pitbull-product-lower .upsells.products ul.products li.product {
  margin: 0;
  width: auto;
  float: none;
  padding: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .pitbull-product-lower .related.products ul.products,
  .pitbull-product-lower .upsells.products ul.products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .pitbull-single-product {
    padding: 0 1rem;
    margin: 1rem auto;
  }

  .pitbull-product-top {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 0.5rem;
  }

  .pitbull-product-summary-col .product_title.entry-title {
    font-size: 1.5rem;
  }

  .pitbull-product-summary-col .price {
    font-size: 1.5rem;
  }

  .pitbull-product-summary-col form.cart {
    flex-direction: column;
    align-items: stretch;
  }

  .pitbull-single-product
    .pitbull-product-summary-col
    .single_add_to_cart_button {
    width: 100%;
  }

  .pitbull-product-lower .woocommerce-tabs ul.tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .pitbull-product-lower .woocommerce-tabs ul.tabs li a {
    padding: 0.75rem 1rem;
    white-space: nowrap;
  }
}
