/**
 * PrefabHouseUSA Core – Public Styles
 * Quote form, FAQ accordion, etc.
 */

/* FAQ Accordion */
.phu-faq-accordion {
  max-width: 800px;
  margin: 0 auto;
}

.phu-faq-item {
  border-bottom: 1px solid var(--phu-border, #e5e7eb);
}

.phu-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.25rem 0;
  font-size: 1.0625rem;
  font-weight: 600;
  text-align: left;
  color: var(--phu-text, #121417);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.phu-faq-question:hover {
  color: var(--phu-primary, #001BB7);
}

.phu-faq-question svg {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.phu-faq-question[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.phu-faq-answer {
  padding: 0 0 1.5rem;
  color: var(--phu-text-secondary, #495057);
  line-height: 1.7;
}

.phu-faq-answer[hidden] {
  display: none;
}

/* Quote form polish (uses theme form classes) */
.phu-quote-form-wrap {
  max-width: 640px;
}

.phu-quote-form .phu-form-group {
  margin-bottom: 1.25rem;
}
/* =====================================================
   Single Product & Dual CTAs
   ===================================================== */
.phu-product-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
}

.phu-product-ctas .phu-btn {
  flex: 1 1 180px;
  min-width: 160px;
}

/* Hide default Woo button when our dual CTAs are present (keep form for variations) */
.phu-product-ctas-wrap form.cart .single_add_to_cart_button:not(.phu-buy-now-btn) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.phu-product-ctas-wrap form.cart {
  position: relative;
  margin-bottom: 0.5rem;
}

/* Quantity styling */
.phu-product-ctas-wrap .quantity {
  margin-bottom: 1rem;
}

.phu-product-ctas-wrap .quantity .qty {
  width: 80px;
  text-align: center;
  padding: 0.75rem;
  border: 1px solid var(--phu-border, #dee2e6);
  border-radius: 8px;
  font-size: 1rem;
}

/* Variations */
.phu-product-ctas-wrap table.variations {
  margin-bottom: 1rem;
  width: 100%;
}

.phu-product-ctas-wrap table.variations td,
.phu-product-ctas-wrap table.variations th {
  padding: 0.5rem 0;
  vertical-align: middle;
}

.phu-product-ctas-wrap table.variations select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--phu-border, #dee2e6);
  border-radius: 8px;
  background: var(--phu-bg, #fff);
}

/* Product tabs */
.woocommerce-tabs {
  margin-top: 3rem;
}

.woocommerce-tabs ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  border-bottom: 2px solid var(--phu-border, #e5e7eb);
}

.woocommerce-tabs ul.tabs li {
  margin: 0;
}

.woocommerce-tabs ul.tabs li a {
  display: block;
  padding: 0.875rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--phu-text-muted, #6c757d);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.woocommerce-tabs ul.tabs li.active a,
.woocommerce-tabs ul.tabs li a:hover {
  color: var(--phu-primary, #001BB7);
  border-bottom-color: var(--phu-secondary, #FF8040);
}

.woocommerce-Tabs-panel {
  padding: 0.5rem 0 2rem;
}

/* Gallery */
.woocommerce-product-gallery {
  position: relative;
  margin-bottom: 0;
}

.woocommerce-product-gallery__wrapper {
  border-radius: 12px;
  overflow: hidden;
}

.woocommerce-product-gallery .flex-control-thumbs {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0;
  list-style: none;
}

.woocommerce-product-gallery .flex-control-thumbs li {
  flex: 0 0 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s;
}

.woocommerce-product-gallery .flex-control-thumbs li.flex-active,
.woocommerce-product-gallery .flex-control-thumbs li:hover {
  border-color: var(--phu-secondary, #FF8040);
  opacity: 1;
}

.woocommerce-product-gallery .flex-control-thumbs img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  display: block;
}

/* Sale flash */
.phu-single-product .onsale {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 5;
  background: var(--phu-secondary, #FF8040);
  color: #001BB7;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
}

/* =====================================================
   Quote Modal (Global)
   ===================================================== */
.phu-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.phu-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.phu-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 37, 64, 0.75);
  backdrop-filter: blur(6px);
}
.phu-modal-dialog {
  position: relative;
  background: var(--phu-bg-card, #fff);
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.phu-modal.is-open .phu-modal-dialog {
  transform: translateY(0);
}
.phu-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--phu-border, #e5e7eb);
  position: sticky;
  top: 0;
  background: var(--phu-bg-card, #fff);
  z-index: 2;
}
.phu-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-family: var(--phu-font-serif, Georgia, serif);
}
.phu-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--phu-text-muted, #6c757d);
  border-radius: 6px;
  transition: background 0.2s;
}
.phu-modal-close:hover {
  background: var(--phu-gray-100, #f1f3f5);
}
.phu-modal-body {
  padding: 1.5rem;
}

/* =====================================================
   Table of Contents (Blog)
   ===================================================== */
.phu-toc {
  background: var(--phu-bg-alt, #f8f9fa);
  border: 1px solid var(--phu-border, #e5e7eb);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
}
.phu-toc-header {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--phu-secondary, #FF8040);
}
.phu-toc-list {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.7;
}
.phu-toc-list li {
  margin-bottom: 0.35rem;
}
.phu-toc-list a {
  color: var(--phu-text, #121417);
  text-decoration: none;
  font-size: 0.95rem;
}
.phu-toc-list a:hover {
  color: var(--phu-primary, #001BB7);
  text-decoration: underline;
}
.phu-toc-list .phu-toc-h3 {
  margin-left: 1rem;
  list-style-type: circle;
  font-size: 0.9rem;
}

/* Product images must always show */
.phu-product-card-image img,
.woocommerce-product-gallery img,
ul.products li.product img,
.single-product .wp-post-image {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}
.woocommerce-product-gallery {
  opacity: 1 !important;
}
