/* =========================
   Meherun PDP - Phase 1 + Phase 4
   ========================= */

.meherun-size-buttons-block {
  margin: 0 0 18px;
}

.meherun-size-buttons-label {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 10px;
}

.meherun-size-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meherun-size-btn {
  min-width: 46px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  line-height: 40px;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.meherun-size-btn:hover {
  border-color: #111827;
}

.meherun-size-btn.is-active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.meherun-size-btn.is-disabled,
.meherun-size-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.meherun-size-chart-wrap {
  margin: 10px 0 18px;
}

.meherun-size-chart-btn {
  border: 1px solid #111827;
  background: transparent;
  color: #111827;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.meherun-size-chart-btn:hover {
  background: #111827;
  color: #fff;
}

.meherun-estimated-delivery {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

/* Modal */
body.meherun-modal-open {
  overflow: hidden;
}

.meherun-size-chart-modal {
  display: none;
}

.meherun-size-chart-modal.is-open {
  display: block;
}

.meherun-size-chart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  z-index: 9998;
}

.meherun-size-chart-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(92vw, 820px);
  max-height: 88vh;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 24px;
  z-index: 9999;
  border-radius: 8px;
  overflow: auto;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.meherun-size-chart-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  color: #111827;
}

.meherun-size-chart-modal-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 10px auto 0;
}

/* Improve summary spacing */
.single-product .summary .price {
  margin-bottom: 14px;
}

.single-product form.cart {
  margin-top: 10px;
}

/* Premium add to cart */
.single-product .single_add_to_cart_button {
  height: 46px;
  font-weight: 600;
  font-size: 15px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.single-product .single_add_to_cart_button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Hide default WooCommerce size dropdown row */
.single-product form.variations_form table.variations tr td.value:has(select[name="attribute_pa_size"]),
.single-product form.variations_form table.variations tr td.value:has(select[name="attribute_size"]) {
  display: none !important;
}

.single-product form.variations_form table.variations tr:has(select[name="attribute_pa_size"]),
.single-product form.variations_form table.variations tr:has(select[name="attribute_size"]) {
  display: none !important;
}

/* Fallback: hide the actual select itself */
.single-product form.variations_form select[name="attribute_pa_size"],
.single-product form.variations_form select[name="attribute_size"] {
  display: none !important;
}

/* Hide reset variations link if only size is being used visually as buttons */
.single-product form.variations_form .reset_variations {
  display: none !important;
}

/* ==========================================
   Phase 2 - Custom PDP Accordion
   ========================================== */

.single-product .woocommerce-tabs,
.single-product .wc-tabs-wrapper,
.single-product ul.tabs.wc-tabs {
  display: none !important;
}

.meherun-pdp-accordion-section {
  width: 100%;
  margin: 40px 0 0;
}

.meherun-pdp-accordion {
  border-top: 1px solid #e5e7eb;
}

.meherun-accordion-item {
  border-bottom: 1px solid #e5e7eb;
}

.meherun-accordion-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  color: #111827;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.meherun-accordion-trigger:hover {
  color: #000;
}

.meherun-accordion-title {
  display: inline-block;
}

.meherun-accordion-icon {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.meherun-accordion-icon::before,
.meherun-accordion-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1.5px;
  background: #111827;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.meherun-accordion-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.meherun-accordion-trigger[aria-expanded="true"] .meherun-accordion-icon::after {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scaleX(0);
}

.meherun-accordion-panel {
  display: none;
  padding: 0 0 18px;
}

.meherun-accordion-panel.is-open {
  display: block;
}

.meherun-accordion-panel-inner {
  color: #374151;
  font-size: 15px;
  line-height: 1.8;
}

.meherun-accordion-panel-inner > *:first-child {
  margin-top: 0;
}

.meherun-accordion-panel-inner > *:last-child {
  margin-bottom: 0;
}

.meherun-accordion-panel-inner p,
.meherun-accordion-panel-inner ul,
.meherun-accordion-panel-inner ol {
  margin-bottom: 14px;
}

.meherun-accordion-panel-inner ul,
.meherun-accordion-panel-inner ol {
  padding-left: 20px;
}

/* ==========================================
   Reviews below accordion
   ========================================== */

.meherun-pdp-reviews-section {
  width: 100%;
  margin: 48px 0 0;
}

.meherun-pdp-reviews-inner {
  width: 100%;
}

.meherun-pdp-reviews-title {
  margin: 0 0 18px;
  font-size: 22px;
  line-height: 1.3;
  color: #111827;
}

.meherun-pdp-reviews-section #reviews,
.meherun-pdp-reviews-section #review_form_wrapper,
.meherun-pdp-reviews-section .commentlist,
.meherun-pdp-reviews-section .woocommerce-Reviews,
.meherun-pdp-reviews-section .woocommerce-Reviews-title {
  width: 100%;
}

/* ==========================================
   Related Products Premium Polish
   ========================================== */

.related.products {
  margin-top: 50px;
}

.related.products ul.products li.product {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.related.products ul.products li.product:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
}

.related.products ul.products li.product img {
  transition: transform 0.35s ease;
}

.related.products ul.products li.product:hover img {
  transform: scale(1.03);
}

/* Mobile */
@media (max-width: 767px) {
  .meherun-size-btn {
    min-width: 44px;
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 38px;
  }

  .meherun-size-chart-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .meherun-size-chart-dialog {
    width: calc(100vw - 24px);
    padding: 18px;
  }

  .meherun-estimated-delivery {
    font-size: 13px;
  }

  .meherun-pdp-accordion-section {
    margin-top: 26px;
  }

  .meherun-accordion-trigger {
    padding: 16px 0;
    font-size: 15px;
  }

  .meherun-accordion-panel-inner {
    font-size: 14px;
    line-height: 1.75;
  }

  .meherun-pdp-reviews-section {
    margin-top: 30px;
  }

  .meherun-pdp-reviews-title {
    font-size: 20px;
    margin-bottom: 16px;
  }

  .related.products {
    margin-top: 36px;
  }

  .related.products ul.products li.product:hover {
    transform: none;
    box-shadow: none;
  }

  .related.products ul.products li.product:hover img {
    transform: none;
  }
}