/**
 * Pro Plus Gym - Product Detail Modal (Add to Cart)
 * Clean, modern design matching screenshot
 */

.ppg-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.ppg-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.ppg-modal[aria-hidden="true"] { visibility: hidden; }
.ppg-modal[aria-hidden="false"] { visibility: visible; }

.ppg-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.ppg-modal__container {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: #0D0D0D;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
.ppg-modal.is-open .ppg-modal__container {
  transform: scale(1);
}

.ppg-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}
.ppg-modal__close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.ppg-modal__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: 90vh;
  overflow-y: auto;
}

.ppg-modal__left {
  background: #0D0D0D;
  display: flex;
  min-height: 0;
}
.ppg-modal__img-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
}
.ppg-modal__img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
}

.ppg-modal__right {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ppg-modal__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.ppg-modal__price {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
}
.ppg-modal__desc {
  margin: 0;
  font-size: 14px;
  color: #D9D9D9;
  line-height: 1.5;
}
.ppg-modal__nutrition {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
}
.ppg-modal__nutrition-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.ppg-modal__nutrition-val {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}
.ppg-modal__nutrition-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ppg-modal__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ppg-modal__badge {
  display: inline-block;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 999px;
}
.ppg-modal__badge--new {
  background: #ff6b35;
  color: #fff;
}

/* Tabs - 2x2 grid (screenshot) */
.ppg-modal__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.ppg-modal__tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  background: #1A1A1A;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.ppg-modal__tab:hover {
  background: #1A1A1A;
  color: #fff;
}
.ppg-modal__tab.ppg-modal__tab--active {
  background: #520975;
  color: #fff;
  border-color: transparent;
}

.ppg-modal__tab-content {
  min-height: 80px;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.ppg-modal__tab-pane {
  display: none;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}
.ppg-modal__tab-pane.ppg-modal__tab-pane--active {
  display: block;
}

.ppg-modal__portions {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.ppg-modal__portion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 0;
}
.ppg-modal__portion-name {
  font-weight: 700;
  color: #ffffff;
}
.ppg-modal__portion-cal {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}
.ppg-modal__view-more {
  font-size: 13px;
  color: #a78bfa;
  font-weight: 600;
  text-decoration: none;
}
.ppg-modal__view-more:hover {
  text-decoration: none;
  color: #c4b5fd;
}

.ppg-modal__variation-wrap {
  display: grid;
  gap: 14px;
  margin: 0 0 14px;
}
.ppg-modal__variation-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}
.ppg-modal__variation-qty-row.has-quantity,
.ppg-modal__variation-qty-row.is-active {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(167, 139, 250, 0.08);
}
.ppg-modal__variation-qty-meta {
  display: flex;
  align-items: center;
}
.ppg-modal__variation-qty-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.ppg-modal__qty--variation {
  flex-shrink: 0;
}
.ppg-modal__macro-card {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.ppg-modal__macro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ppg-modal__macro-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.ppg-modal__macro-card-grid {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}
.ppg-modal__macro-card-grid strong {
  color: #fff;
}
.ppg-modal__variation-status {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
}
.ppg-modal__variation-status.is-error {
  color: #ff6b6b;
}
.ppg-modal__variation-status.is-success {
  color: #57d38c;
}
.ppg-modal__variation-status.is-muted {
  color: rgba(255, 255, 255, 0.72);
}

.ppg-modal__actions {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: auto;
  padding-top: 0;
}
.ppg-modal__qty-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ppg-modal__qty-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
}
.ppg-modal__qty {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: fit-content;
}
.ppg-modal__qty .ppg-qty__btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #1A1A1A;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.ppg-modal__qty .ppg-qty__btn:hover {
  background: #1A1A1A;
  border-color: rgba(255, 255, 255, 0.3);
}
.ppg-modal__qty .ppg-qty__input {
  width: 40px;
  height: 28px;
  border: none;
  background: transparent;
  color: #fff !important;
  font-weight: 700;
  text-align: center;
  font-size: 14px;
  -moz-appearance: textfield;
  appearance: textfield;
}
.ppg-modal__qty .ppg-qty__input::-webkit-outer-spin-button,
.ppg-modal__qty .ppg-qty__input::-webkit-inner-spin-button {
  opacity: 1;
  margin: 0;
}
/* Visible quantity number (replaces number input for reliable display) */
.ppg-modal__qty-display,
.ppg-modal__qty .ppg-modal__qty-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 28px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  line-height: 1;
  user-select: none;
}
.ppg-modal__add-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-radius: 4px;
  background: #520975 !important;
  color: #fff !important;
  border: none;
  cursor: pointer;
  transition: box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ppg-modal__add-btn:hover {
  background: #520975 !important;
  box-shadow: 0 0 0 2px rgba(0, 71, 255, 0.4);
}

@media (max-width: 768px) {
  .ppg-modal__body {
    grid-template-columns: 1fr;
    max-height: 85vh;
  }
  .ppg-modal__img-wrap {
    min-height: 200px;
  }
  .ppg-modal__right {
    padding: 24px 20px;
  }
  .ppg-modal__title {
    font-size: 18px;
  }
  .ppg-modal__price {
    font-size: 16px;
  }
  .ppg-modal__tabs {
    gap: 6px;
  }
  .ppg-modal__tab {
    padding: 8px 14px;
    font-size: 12px;
  }
  .ppg-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .ppg-modal__variation-qty-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .ppg-modal__macro-grid {
    grid-template-columns: 1fr;
  }
  .ppg-modal__add-btn {
    padding: 10px 16px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .ppg-modal {
    padding: 12px;
  }
  .ppg-modal__container {
    max-width: 100%;
    width: calc(100% - 24px);
    max-height: 90vh;
  }
  .ppg-modal__body {
    max-height: 82vh;
  }
  .ppg-modal__right {
    padding: 20px 16px;
    gap: 12px;
  }
  .ppg-modal__title {
    font-size: 16px;
  }
  .ppg-modal__price {
    font-size: 15px;
  }
  .ppg-modal__desc {
    font-size: 13px;
  }
  .ppg-modal__tab {
    padding: 8px 10px;
    font-size: 11px;
  }
  .ppg-modal__qty-wrap {
    width: 100%;
  }
  .ppg-modal__add-btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
  }
}
