/* Single Product Page Styling */

/* Product Gallery - Hide Zoom Trigger */
.woocommerce-product-gallery__trigger {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

/* Keep image cursor to indicate zoom functionality */
.woocommerce-product-gallery__image {
  cursor: zoom-in !important;
}

.woocommerce-product-gallery__image img {
  cursor: zoom-in !important;
  transition: none !important;
  transform: none !important;
}

.woocommerce-product-gallery__image img:hover {
  transform: none !important;
  scale: none !important;
}

/* Fix gallery thumbnail spacing */
.woocommerce-product-gallery .flex-control-thumbs {
  margin-bottom: 1rem !important;
}

.woocommerce-product-gallery .flex-control-thumbs li {
  margin-bottom: 0 !important;
}

/* Variations table layout - make labels above fields */
.variations {
  border: none !important;
  margin-bottom: 0 !important;
}

.variations tr {
  display: block;
  margin-bottom: 0 !important;
  border: none !important;
}

.variations td {
  display: block !important;
  padding: 0 !important;
  border: none !important;
}

.variations .label {
  display: block !important;
  font-weight: 600;
  color: var(--naf-text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.variations .label label {
  margin: 0;
  font-weight: inherit;
}

/* Style all variation selects to look the same */
.variations .value select {
  width: 100% !important;
  min-width: 200px;
  background: var(--naf-bg-default);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.9rem;
  color: var(--naf-text-primary);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.variations .value select:focus {
  outline: none;
  border-color: var(--naf-primary);
  box-shadow: 0 0 0 2px rgba(197, 164, 92, 0.2);
}

/* Hide the Clear link completely */
.variations .reset_variations {
  display: none !important;
}

/* Fix quantity input and cart button layout */
.cart {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Buttons container - make Add to Cart and Go to Cart on same row */
.cart-buttons-row {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Go to Cart Button - matches Add to Cart design with navy color */
.naf-go-to-cart-btn {
  display: inline-block !important;
  background-color: var(--naf-secondary) !important;
  color: white !important;
  padding: 0.75rem 1.5rem !important;
  height: 3rem !important;
  border: none !important;
  border-radius: 0.375rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  align-self: flex-start !important;
  margin: 0 !important;
  min-width: 9.375rem !important;
  line-height: 1.5 !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

.naf-go-to-cart-btn:hover {
  background-color: var(--naf-secondary) !important;
  color: white !important;
  opacity: 0.9 !important;
  text-decoration: none !important;
}

.naf-go-to-cart-btn i {
  margin-right: 0.5rem !important;
}

.cart .quantity {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.cart .quantity label {
  font-weight: 600;
  color: var(--naf-text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.quantity .qty,
.woocommerce .quantity .qty,
.woocommerce div.product form.cart .quantity .qty,
input.qty,
input[type="number"].qty {
  width: 100% !important;
  max-width: 12.5rem !important;
  height: 3rem !important;
  padding: 0.75rem !important;
  border: 1px solid var(--naf-gray-300) !important;
  border-radius: 0.375rem !important;
  text-align: left !important;
  background-color: white !important;
  background: white !important;
  font-size: 0.875rem !important;
  color: var(--naf-gray-800) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.quantity .qty:focus,
.woocommerce .quantity .qty:focus,
.woocommerce div.product form.cart .quantity .qty:focus,
input.qty:focus,
input[type="number"].qty:focus {
  outline: none !important;
  border-color: var(--naf-primary) !important;
  box-shadow: 0 0 0 2px rgba(197, 164, 92, 0.2) !important;
  background-color: white !important;
  background: white !important;
}

.single_add_to_cart_button {
  background-color: var(--naf-primary) !important;
  color: white !important;
  padding: 0.75rem 1.5rem !important;
  height: 3rem !important;
  border: none !important;
  border-radius: 0.375rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  align-self: flex-start !important;
  margin: 0 !important;
  min-width: 9.375rem !important;
  font-size: var(--wp--preset--font-size--base) !important;
}

.single_add_to_cart_button:hover {
  background-color: var(--naf-primary-600) !important;
  color: white !important;
}

/* Hide SKU when N/A */
.product_meta .sku_wrapper {
  display: none;
}

/* Category styling under title */
.product-categories-under-title {
  margin-bottom: 1rem;
}

.product-categories-under-title .posted_in {
  font-size: 0.9rem;
  color: var(--naf-text-secondary);
  margin: 0;
}

.product-categories-under-title .posted_in a {
  color: var(--naf-primary);
  text-decoration: none;
}

.product-categories-under-title .posted_in a:hover {
  text-decoration: underline;
}

/* Custom meta styling */
.product-detail__meta-custom {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.product-detail__meta-custom .sku_wrapper {
  font-size: 0.9rem;
  color: var(--naf-text-secondary);
}

/* WooCommerce Variations - Enhanced Styling */
.variations {
  border: none !important;
  margin-bottom: 0 !important;
}

.variations tr {
  display: block !important;
  margin-bottom: 0 !important;
  border: none !important;
}

.variations td {
  display: block !important;
  padding: 0 !important;
  border: none !important;
}

.variations .label {
  display: block !important;
  font-weight: 600 !important;
  color: var(--naf-gray-800) !important;
  margin-bottom: 0.5rem !important;
  font-size: 0.875rem !important;
  text-transform: capitalize !important;
  text-align: left !important;
}

.variations .label label {
  margin: 0 !important;
  font-weight: inherit !important;
  font-size: inherit !important;
  color: inherit !important;
  text-transform: capitalize !important;
}

.variations .value {
  position: relative !important;
}

.variations .value select {
  width: 100% !important;
  max-width: 20rem !important;
  background-color: white !important;
  border: 1px solid var(--naf-gray-300) !important;
  border-radius: 0.375rem !important;
  padding: 0.75rem !important;
  padding-right: 2.5rem !important;
  font-size: 0.875rem !important;
  color: var(--naf-gray-800) !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.variations .value select:focus {
  outline: none !important;
  border-color: var(--naf-primary) !important;
  box-shadow: 0 0 0 2px rgba(197, 164, 92, 0.2) !important;
}

.variations .reset_variations {
  display: none !important;
}

/* Variant Cards for Count Selection */
.variant-cards {
  display: flex !important;
  gap: 0.75rem !important;
  flex-wrap: wrap !important;
  margin-top: 0.5rem !important;
}

.variant-card {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.75rem 1rem !important;
  border: 2px solid var(--naf-gray-200) !important;
  border-radius: 0.5rem !important;
  background-color: white !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  color: var(--naf-gray-700) !important;
  min-width: 3rem !important;
  text-align: center !important;
}

.variant-card:hover {
  border-color: var(--naf-primary) !important;
  color: var(--naf-primary) !important;
  background-color: var(--naf-primary-50) !important;
}

.variant-card.selected {
  border-color: var(--naf-primary) !important;
  background-color: var(--naf-primary) !important;
  color: white !important;
  font-weight: 600 !important;
}

.variant-card.selected:hover {
  background-color: var(--naf-primary-600) !important;
  color: white !important;
}

/* Hide original select when variant cards are shown */
.variations .value select.variant-cards-hidden {
  display: none !important;
}

/* Override WooCommerce default styles */
.woocommerce div.product form.cart .variations {
  border: none !important;
  margin-bottom: 2rem !important;
}

.woocommerce div.product form.cart .variations tr {
  display: block !important;
  margin-bottom: 1.5rem !important;
  border: none !important;
}

.woocommerce div.product form.cart .variations td {
  display: block !important;
  padding: 0 !important;
  border: none !important;
  vertical-align: top !important;
}

.woocommerce div.product form.cart .variations td.label {
  width: 100% !important;
  text-align: left !important;
  padding-bottom: 0.5rem !important;
}

.woocommerce div.product form.cart .variations td.value {
  width: 100% !important;
}

.woocommerce div.product form.cart .variations select {
  width: 100% !important;
  max-width: 20rem !important;
  background-color: white !important;
  border: 1px solid var(--naf-gray-300) !important;
  border-radius: 0.375rem !important;
  padding: 0.75rem !important;
  padding-right: 2.5rem !important;
  font-size: 0.875rem !important;
  color: var(--naf-gray-800) !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.woocommerce div.product form.cart .variations select:focus {
  outline: none !important;
  border-color: var(--naf-primary) !important;
  box-shadow: 0 0 0 2px rgba(197, 164, 92, 0.2) !important;
}

/* Additional Product Form Fields Styling */
.woocommerce div.product form.cart p {
  margin-bottom: 1.5rem !important;
}

.woocommerce div.product form.cart label {
  display: block !important;
  font-weight: 600 !important;
  color: var(--naf-gray-800) !important;
  margin-bottom: 0.5rem !important;
  font-size: 0.875rem !important;
}

.woocommerce div.product form.cart input[type="text"],
.woocommerce div.product form.cart input[type="url"],
.woocommerce div.product form.cart input[type="email"],
.woocommerce div.product form.cart textarea {
  width: 100% !important;
  max-width: 20rem !important;
  background-color: white !important;
  border: 1px solid var(--naf-gray-300) !important;
  border-radius: 0.375rem !important;
  padding: 0.75rem !important;
  font-size: 0.875rem !important;
  color: var(--naf-gray-800) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.woocommerce div.product form.cart input[type="text"]:focus,
.woocommerce div.product form.cart input[type="url"]:focus,
.woocommerce div.product form.cart input[type="email"]:focus,
.woocommerce div.product form.cart textarea:focus {
  outline: none !important;
  border-color: var(--naf-primary) !important;
  box-shadow: 0 0 0 2px rgba(197, 164, 92, 0.2) !important;
}

/* Ensure form styling matches */
.cart .variations + .single_variation_wrap {
  margin-top: 0.5rem !important;
}

.cart .single_variation .price {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  color: var(--naf-primary) !important;
  margin-bottom: 1rem !important;
  margin-top: 0.5rem !important;
}

/* Fix spacing between variant cards and price when variation is selected */
.single_variation_wrap {
  margin-top: 0.5rem !important;
}

.single_variation_wrap .woocommerce-variation-price {
  margin-top: 0.5rem !important;
  margin-bottom: 1rem !important;
}

.quantity {
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
}

.quantity label {
  font-weight: 600 !important;
  color: var(--naf-gray-800) !important;
  margin-bottom: 0.5rem !important;
  font-size: 0.875rem !important;
}

/* WooCommerce Product Add-ons (WCPA) Form Field Styling */
.wcpa_field_wrap {
  display: flex !important;
  flex-direction: column !important;
  margin-bottom: 1.5rem !important;
}

.wcpa_field_wrap .wcpa_field_label {
  order: -1 !important;
  font-weight: 600 !important;
  color: var(--naf-gray-800) !important;
  margin-bottom: 0.5rem !important;
  font-size: 0.875rem !important;
  margin-top: 0 !important;
  display: block !important;
}

.wcpa_field_wrap .wcpa_field {
  width: 100% !important;
  max-width: 20rem !important;
  background-color: white !important;
  border: 1px solid var(--naf-gray-300) !important;
  border-radius: 0.375rem !important;
  padding: 0.75rem !important;
  font-size: 0.875rem !important;
  color: var(--naf-gray-800) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.wcpa_field_wrap select.wcpa_field {
  padding-right: 2.5rem !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
}

.wcpa_field_wrap .wcpa_field:focus {
  outline: none !important;
  border-color: var(--naf-primary) !important;
  box-shadow: 0 0 0 2px rgba(197, 164, 92, 0.2) !important;
}

.wcpa_required_ast {
  color: var(--naf-error) !important;
  font-weight: bold !important;
}

/* Fix quantity field labeling - ensure proper order */
.quantity .screen-reader-text {
  position: static !important;
  clip: unset !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  white-space: normal !important;
  font-weight: 600 !important;
  color: var(--naf-gray-800) !important;
  margin-bottom: 0.5rem !important;
  font-size: 0.875rem !important;
  display: block !important;
}

/* Ensure custom quantity label appears above input */
.quantity label {
  order: -1 !important;
  font-weight: 600 !important;
  color: var(--naf-gray-800) !important;
  margin-bottom: 0.5rem !important;
  font-size: 0.875rem !important;
  display: block !important;
}

/* Visible label styling for converted screen reader labels */
.visible-label {
  position: static !important;
  clip: unset !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  white-space: normal !important;
  font-weight: 600 !important;
  color: var(--naf-gray-800) !important;
  margin-bottom: 0.5rem !important;
  font-size: 0.875rem !important;
  display: block !important;
  order: -1 !important;
}

/* Product Features Styling */
.product-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background-color: var(--naf-gray-50);
  border-radius: 0.5rem;
}

/* Responsive Design for Product Features */
@media (max-width: 767px) {
  .product-features {
    grid-template-columns: 1fr;
  }

  .feature-item {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
  }

  .feature-item i {
    margin-right: 0.75rem;
    margin-bottom: 0;
  }
}
