/* =============================================
   Product Detail Page Styles
   ============================================= */

:root { --blue: #003A96; }

/* Breadcrumb */
.breadcrumb-bar {
  background: var(--bg-gray);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
}
.breadcrumb a {
  color: var(--text-mid);
  transition: color .2s;
}
.breadcrumb a:hover { color: var(--blue); }
.bc-sep { font-size: 10px; color: #bbb; }

/* Section */
.product-detail-section {
  padding: 40px 0 16px;
}

/* Loading */
.product-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  gap: 16px;
  color: var(--text-light);
}
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Two-column layout */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 56px;
}

/* Gallery */
.product-gallery {
  position: sticky;
  top: 120px;
}
.gallery-main {
  position: relative;
  background: var(--bg-gray);
  border: 1px solid var(--border);
  border-radius: 16px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
}
.gallery-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  z-index: 2;
}
.gallery-visual {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-visual svg {
  width: 160px;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.15));
}

/* Gallery thumbnails & arrows */
.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.gallery-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  object-fit: cover;
  cursor: pointer;
  transition: border-color .2s;
  background: var(--bg-gray);
}
.gallery-thumb.active { border-color: var(--blue); }
.gallery-thumb:hover { border-color: var(--blue); }
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: var(--transition);
  z-index: 3;
  display: none;
}
.gallery-arrow:hover { background: white; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.gallery-arrow-left { left: 10px; }
.gallery-arrow-right { right: 10px; }
.gallery-arrow.visible { display: flex; }

.gallery-trust {
  display: flex;
  gap: 8px;
}
.gallery-trust-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg-gray);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  font-size: 11px;
  color: var(--text-mid);
  text-align: center;
}
.gallery-trust-item i {
  color: var(--blue);
  font-size: 14px;
}

/* Product Summary */
.product-summary {
  padding-top: 4px;
}
.ps-category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}
.ps-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  color: #003A96;
}
.ps-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.ps-purity {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}
.ps-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-mid);
}
.ps-rating i { color: #f59e0b; font-size: 12px; }

.ps-price-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.ps-price {
  font-size: 30px;
  font-weight: 700;
  color: #003A96;
}
.ps-old-price {
  font-size: 17px;
  color: var(--text-light);
  text-decoration: line-through;
}
.ps-save {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 3px;
}

.ps-short-desc {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 0;
}

.ps-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* Qty row */
.ps-qty-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.ps-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 72px;
}
.ps-qty-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ps-qty-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-gray);
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-mid);
  transition: var(--transition);
}
.ps-qty-btn:hover { background: var(--border); color: var(--text); }
.ps-qty-num {
  min-width: 40px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

.ps-add-btn {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(to right, #3AC0E2, #0088CB);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ps-add-btn:hover {
  background: linear-gradient(to right, #2dafd9, #0073b0);
  color: #fff;
  border-color: transparent;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,136,203,0.45);
}
.ps-add-btn.added {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.ps-disclaimer {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
}

/* Trust grid */
.ps-trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ps-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ps-trust-item i {
  color: var(--blue);
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}
.ps-trust-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ps-trust-item strong {
  font-size: 13px;
  font-weight: 600;
}
.ps-trust-item span {
  font-size: 12px;
  color: var(--text-light);
}

/* Tabs */
.product-tabs {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-gray);
}
.tab-btn {
  padding: 14px 22px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--blue); }
.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  background: white;
  font-weight: 600;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.tab-content {
  padding: 32px;
}
.tab-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #003A96;
}
.tab-content p {
  color: var(--text-mid);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.tab-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.tab-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-mid);
}
.tab-list li i {
  color: var(--green);
  margin-top: 3px;
  flex-shrink: 0;
}

/* Spec table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.spec-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.spec-table td:first-child {
  font-weight: 600;
  color: var(--text);
  width: 200px;
  background: var(--bg-gray);
}
.spec-table td:last-child {
  color: var(--text-mid);
}
.spec-table tr:last-child td { border-bottom: none; }

/* COA box */
.coa-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--blue-light);
  border: 1px solid #c5d5e9;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.coa-icon {
  font-size: 28px;
  color: var(--blue);
  flex-shrink: 0;
}
.coa-box div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.coa-box strong { font-size: 14px; font-weight: 600; }
.coa-box span { font-size: 12px; color: var(--text-mid); }
.btn-ghost {
  background: none;
  border: 1px solid var(--blue);
  color: var(--blue);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--blue); color: white; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

.coa-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.coa-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-mid);
}
.coa-check i { color: var(--green); font-size: 15px; }

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.faq-item strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.faq-item p {
  font-size: 14px;
  color: var(--text-mid);
  margin: 0;
}

/* Related Products */
.related-section { margin-top: 56px; margin-bottom: 40px; }
.related-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #003A96;
}

/* Responsive */
@media (max-width: 860px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .product-gallery { position: static; }
  .ps-trust-grid { grid-template-columns: 1fr 1fr; }
  .tabs-nav { flex-wrap: wrap; }
  .tab-btn { padding: 10px 14px; font-size: 13px; }
  .tab-content { padding: 20px; }
  .spec-table td:first-child { width: 140px; }
}

@media (max-width: 560px) {
  .ps-trust-grid { grid-template-columns: 1fr; }
  .gallery-trust { flex-direction: column; }
  .coa-box { flex-direction: column; text-align: center; }
}

/* =============================================
   Product Extra Section (Formulation / FAQ / Process)
   ============================================= */
.product-extra-section { padding: 16px 0; background: #fff; }

.pex-heading {
  font-size: 26px; font-weight: 400; color: #003A96;
  text-align: center; margin-top: 0; margin-bottom: 28px; letter-spacing: .2px;
}

.pex-formulation p { font-size: 16px; color: #444; line-height: 1.8; margin-bottom: 14px; }

.pex-divider { border: none; border-top: 1px solid #dde0ee; margin: 48px 0; }

.pex-faq {
  background: linear-gradient(135deg, #003A96 0%, #001D4B 100%);
  position: relative;
  overflow: hidden;
  padding: 56px 0;
}
.pex-faq::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cdefs%3E%3Cstyle%3Eline%7Bstroke:rgba(255,255,255,0.12);stroke-width:1%7D circle%7Bfill:rgba(255,255,255,0.10);stroke:rgba(255,255,255,0.18);stroke-width:1%7D polygon%7Bfill:none;stroke:rgba(255,255,255,0.08);stroke-width:1%7D%3C/style%3E%3C/defs%3E%3Cpolygon points='100,10 155,40 155,100 100,130 45,100 45,40'/%3E%3Cpolygon points='0,70 45,40 45,100 0,130'/%3E%3Cpolygon points='155,40 200,10 200,70 155,100'/%3E%3Cpolygon points='100,130 155,100 155,160 100,190 45,160 45,100'/%3E%3Cpolygon points='0,130 45,100 45,160 0,190'/%3E%3Cpolygon points='155,100 200,70 200,130 155,160'/%3E%3Ccircle cx='100' cy='10' r='3'/%3E%3Ccircle cx='155' cy='40' r='3'/%3E%3Ccircle cx='155' cy='100' r='3'/%3E%3Ccircle cx='100' cy='130' r='3'/%3E%3Ccircle cx='45' cy='100' r='3'/%3E%3Ccircle cx='45' cy='40' r='3'/%3E%3Ccircle cx='100' cy='70' r='4'/%3E%3Cline x1='100' y1='10' x2='100' y2='70'/%3E%3Cline x1='155' y1='40' x2='100' y2='70'/%3E%3Cline x1='155' y1='100' x2='100' y2='70'/%3E%3Cline x1='100' y1='130' x2='100' y2='70'/%3E%3Cline x1='45' y1='100' x2='100' y2='70'/%3E%3Cline x1='45' y1='40' x2='100' y2='70'/%3E%3C/svg%3E");
  background-size: 400px 400px;
  pointer-events: none;
  opacity: 0.25;
}
.pex-faq .container { position: relative; }
.pex-faq .pex-heading { color: #fff; }
.pex-faq-item { margin-bottom: 28px; }
.pex-faq-item h4 { font-size: 17px; font-weight: 700; color: #3AC0E2; margin-bottom: 8px; }
.pex-faq-item p { font-size: 16px; color: rgba(255,255,255,0.85); line-height: 1.8; }

.pex-process { }
.pex-process-intro { font-size: 16px; color: #444; line-height: 1.8; margin-bottom: 10px; text-align: center; }

.pex-checklist { display: flex; flex-direction: column; gap: 32px; margin-top: 40px; }
.pex-check-item { display: flex; align-items: flex-start; gap: 24px; }
.pex-check-icon {
  width: 48px; height: 48px; min-width: 48px; flex-shrink: 0;
  background: #003A96; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}
.pex-check-item strong { display: block; font-size: 17px; font-weight: 600; color: #003A96; margin-bottom: 6px; }
.pex-check-item p { font-size: 16px; color: #555; line-height: 1.7; margin: 0; }

/* COA Shipping batch link */
.coa-shipping { margin-bottom: 20px; }
.coa-shipping-label { font-size: 12px; font-weight: 700; color: #003A96; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px; }
.coa-batch-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px;
  border: 1px solid #003A9630; background: #f8faff;
  color: #003A96; font-size: 14px; font-weight: 500;
  text-decoration: none; transition: background .15s, border-color .15s;
}
.coa-batch-link:hover { background: #eef2ff; border-color: #003A96; }
.coa-batch-link i:first-child { font-size: 15px; }

/* COA Lightbox Modal */
.coa-modal-overlay {
  position: fixed; inset: 0; z-index: 99000;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.coa-modal {
  background: #fff; border-radius: 12px; overflow: hidden;
  width: 100%; max-width: 780px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}
.coa-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(135deg, #003A96, #001D4B);
  color: #fff;
}
.coa-modal-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.coa-modal-close {
  background: none; border: none; color: #fff; font-size: 16px;
  cursor: pointer; padding: 4px 8px; border-radius: 4px;
  transition: background .15s;
}
.coa-modal-close:hover { background: rgba(255,255,255,0.15); }
.coa-modal-body { flex: 1; overflow: hidden; min-height: 500px; position: relative; }
.coa-modal-body iframe { width: 100%; height: 100%; min-height: 500px; display: block; border: none; }
.coa-modal-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 40px; text-align: center; color: #555; }
.coa-modal-footer { padding: 12px 20px; border-top: 1px solid #e8edf8; display: flex; justify-content: flex-end; background: #f8faff; }

/* ── Product Page Preset Calculator ──────────────────────────────────── */
.pc-preset-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 680px) { .pc-preset-row { grid-template-columns: 1fr; } }

.pc-preset-panel {
  background: #f5f7ff;
  border: 1px solid #dde5f7;
  border-radius: 12px;
  padding: 16px 14px 14px;
}
.pc-preset-title {
  font-size: 13px;
  font-weight: 700;
  color: #001D4B;
  text-align: center;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pc-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.pc-preset-btn {
  background: #fff;
  color: #1a1a1a;
  border: 1.5px solid #dddddd;
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s, color .15s;
  text-align: center;
}
.pc-preset-btn:hover {
  border-color: #003A96;
  background: #dde5f7;
  color: #003A96;
}
.pc-preset-btn.selected {
  background: #003A96;
  border-color: #003A96;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,58,150,0.25);
}
.pc-other-btn { grid-column: 1 / -1; }
.pc-custom-wrap { margin-top: 8px; display: none; }
.pc-custom-wrap.show { display: block; }
.pc-custom-wrap input {
  width: 100%;
  padding: 8px 10px;
  background: #fff;
  border: 1.5px solid #003A96;
  border-radius: 7px;
  color: #1a1a1a;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

/* ── Calculator sub-tabs ─────────────────────────────────────────────── */
.pc-subtab-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0;
}
.pc-subtab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s;
  border-radius: 0;
}
.pc-subtab-btn:hover { color: #003A96; }
.pc-subtab-btn.active {
  color: #003A96;
  border-bottom-color: #003A96;
}

/* ── Cycle Planner card ──────────────────────────────────────────────── */
.pc-cycle-card {
  background: #f5f7ff;
  border: 1px solid #dde5f7;
  border-radius: 12px;
  padding: 20px;
}
.pc-cycle-field { margin-bottom: 16px; }
.pc-cycle-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.pc-cycle-field input {
  width: 100%;
  padding: 9px 12px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.pc-cycle-field input:focus { border-color: #003A96; }
.pc-cycle-freq-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.pc-freq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
@media (max-width: 500px) { .pc-freq-grid { grid-template-columns: 1fr 1fr; } }
.pc-freq-btn {
  background: #fff;
  color: #1a1a1a;
  border: 1.5px solid #dddddd;
  border-radius: 50px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: background .15s, border-color .15s, color .15s;
}
.pc-freq-btn:hover { background: #dde5f7; border-color: #003A96; color: #003A96; }
.pc-freq-btn.selected { background: #003A96; border-color: #003A96; color: #fff; }
.pc-freq-custom { border-style: dashed; }
.pc-freq-custom.selected { border-style: solid; }
