/**
 * t664 PRODUCT DETAIL DRAWER — discoverability UX
 * Touch >= 44px; no nested ATC; preserves page scroll via JS.
 */

.mb-products {
  min-width: 0;
}

.mb-product {
  min-width: 0;
  max-width: 100%;
}

.mb-product__info,
.mb-product__desc,
.mb-product__detail-btn,
.lp-pack-detail__btn,
.lp-pack-details {
  min-width: 0;
  max-width: 100%;
}

.mb-product__desc {
  overflow-wrap: anywhere;
}

.mb-product__detail-btn,
.lp-pack-detail__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  width: 100%;
  margin-top: 8px;
  padding: 8px 8px;
  min-height: 44px;
  background: transparent;
  border: 1.5px solid rgba(128, 1, 32, 0.35);
  border-radius: 8px;
  color: #800120;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

@media (max-width: 390px) {
  .mb-builder-section {
    padding-left: 12px;
    padding-right: 12px;
  }
  .mb-products {
    gap: 8px;
  }
  .mb-product {
    padding-left: 6px;
    padding-right: 6px;
  }
  .mb-product__stepper {
    gap: 4px;
    max-width: 100%;
  }
  .mb-product__detail-btn,
  .lp-pack-detail__btn {
    font-size: 11px;
    padding: 8px 4px;
  }
}

.mb-product__detail-btn:hover,
.lp-pack-detail__btn:hover {
  background: rgba(128, 1, 32, 0.06);
  border-color: #800120;
}

.mb-product__detail-btn:focus-visible,
.lp-pack-detail__btn:focus-visible,
.pd-drawer__close:focus-visible {
  outline: 2px solid #d4a853;
  outline-offset: 2px;
}

.mb-product__desc {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(30, 30, 30, 0.7);
  margin: 4px 0 2px;
}

/* Keep existing Detalii → exit link but demote visually vs drawer CTA */
.mb-product__more {
  font-size: 12px !important;
  margin-top: 2px !important;
}

.lp-pack-details {
  margin: 16px 0 8px;
  padding: 14px;
  border: 1px solid rgba(35, 26, 16, 0.12);
  border-radius: 12px;
  background: #fffdf9;
}

.lp-pack-details__title {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 6px;
}

.lp-pack-details__hint {
  font-size: 13px;
  color: #6f655b;
  margin: 0 0 12px;
}

.lp-pack-details__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 480px) {
  .lp-pack-details__grid {
    grid-template-columns: 1fr 1fr;
  }
}

body.pd-drawer-open {
  overflow: hidden;
  width: 100%;
  touch-action: none;
}

.product-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  touch-action: none;
}

.product-detail-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.product-detail-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  max-height: min(85dvh, 85vh);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: #fffdf9;
  color: #19140f;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(110%);
  transition: transform 0.28s ease;
  overflow: hidden;
  overscroll-behavior: contain;
}

.product-detail-drawer.is-open {
  transform: translateY(0);
}

.pd-drawer__handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  margin: 10px auto 0;
}

.pd-drawer__top {
  flex: 0 0 auto;
  padding: 8px 16px 0;
  min-width: 0;
}

.pd-drawer__scroll {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
  flex: 1 1 auto;
  max-height: calc(min(85dvh, 85vh) - 88px);
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
}

.pd-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.pd-drawer__title-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.pd-drawer__title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pd-drawer__subtitle {
  font-size: 13px;
  color: #6f655b;
  margin-top: 2px;
}

.pd-drawer__close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.pd-drawer__image {
  margin: 0 0 12px;
  text-align: center;
}

.pd-drawer__image img {
  max-width: 160px;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.pd-specs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  min-width: 0;
}

.pd-spec {
  flex: 1 1 0;
  min-width: 0;
  background: #f5f0e8;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  overflow-wrap: anywhere;
}

.pd-spec__value {
  display: block;
  font-weight: 800;
  font-size: 16px;
}

.pd-spec__label {
  display: block;
  font-size: 11px;
  color: #6f655b;
  margin-top: 2px;
}

.pd-info-section {
  margin: 0 0 14px;
}

.pd-info-section h3 {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 6px;
}

.pd-info-section p,
.pd-notes {
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
  color: #3a322b;
  overflow-wrap: anywhere;
}

.pd-notes {
  padding-left: 18px;
}

.pd-actions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.pd-actions__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  border: 1.5px solid rgba(35, 26, 16, 0.15);
  color: #19140f;
  background: #fff;
  touch-action: manipulation;
}

.pd-actions__btn--primary {
  background: #d4a853;
  border-color: #d4a853;
  color: #1a1210;
}

@media (min-width: 768px) {
  .product-detail-drawer {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(440px, calc(100vw - 32px));
    max-height: min(80dvh, 80vh, 680px);
    border-radius: 16px;
    transform: translate(-50%, -46%) scale(0.96);
    opacity: 0;
    pointer-events: none;
  }
  .product-detail-drawer.is-open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .pd-drawer__handle {
    display: none;
  }
  .pd-drawer__scroll {
    max-height: calc(min(80dvh, 80vh, 680px) - 88px);
  }
}
