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

/* -----------------------------------------
   Main Layout & Grid
   ----------------------------------------- */
.ep-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--ep-border);
  padding: 40px 40px 48px;
  border-radius: 20px;
  box-shadow: var(--ep-shadow-md);
}

/* -----------------------------------------
   Media / Gallery Section
   ----------------------------------------- */
.ep-detail-media {
  border: 1px solid #c2d8ef;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 300px;
}

.ep-detail-media img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

.ep-detail-media__placeholder {
  opacity: .55;
  width: 40%;
}

/* Brand logo fallback styling */
.ep-detail-media__brand {
  width: 100%;
  height: 100%;
  min-height: 300px;
  padding: 15%;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.ep-detail-media__brand img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: .85;
}

/* -----------------------------------------
   Product Info Header
   ----------------------------------------- */
.ep-detail-title {
  margin: 0 0 14px;
  font-size: 1.9rem;
  line-height: 1.15;
  letter-spacing: .5px;
  color: var(--ep-text);
}

.ep-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ep-text-soft);
  font-weight: 700;
  margin-bottom: 18px;
  align-items: center;
}

/* Unify badge styling for brand links, category and identifiers */
.ep-detail-meta a span,
.ep-detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef4fa;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

/* -----------------------------------------
   Product Statuses
   ----------------------------------------- */
.ep-product-statuses {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.ep-status-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 4px solid;
  font-size: .75rem;
  font-weight: 500;
  color: var(--ep-text);
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}

.ep-status-note.refurbished {
  border-left-color: #ffc107;
  color: #856404;
  background: #fff3cd;
  border-color: #ffeaa7;
}

.ep-status-note.discontinued {
  border-left-color: #dc3545;
  color: #721c24;
  background: #f8d7da;
  border-color: #f5c6cb;
}

.ep-status-icon {
  font-size: 1rem;
}

/* -----------------------------------------
   Offers & Pricing
   ----------------------------------------- */
.ep-offers-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f7fafd;
  border: 1px solid #d6e4f1;
  padding: 22px 22px 26px;
  border-radius: 18px;
}

.ep-offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid #e3edf5;
  border-radius: 12px;
  background: #ffffff;
}

.ep-offer-row[data-empty='1'] {
  border-style: solid;
  background: #ffffff;
}

.ep-offer-price {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ep-primary);
}

/* Subtle inline stat pills */
.ep-offer-stats {
  font-size: .78rem;
  color: var(--ep-text);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.ep-stat {
  padding: 4px 8px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--ep-text-soft);
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.86rem;
}

.ep-stat--muted {
  color: var(--ep-text-soft);
  opacity: 0.95;
  font-weight: 500;
}

.ep-stat--reserved {
  color: var(--ep-primary);
  font-weight: 700;
}

/* -----------------------------------------
   Quantity Box & Buttons
   ----------------------------------------- */
.ep-qty-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--ep-border);
  border-radius: 10px;
  overflow: hidden;
}

.ep-qty-box button {
  background: #f0f4f8;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: .75rem;
}

.ep-qty-box input {
  width: 40px;
  text-align: center;
  padding: 6px 4px;
  border: none;
  font-size: .7rem;
}

/* Hide native number input spinners */
.ep-qty-box input[type=number]::-webkit-outer-spin-button,
.ep-qty-box input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.ep-qty-box input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.ep-buy-btn {
  background: var(--ep-gradient-primary);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
}

.ep-buy-btn[disabled] {
  background: #d0d7de;
  cursor: not-allowed;
}

/* -----------------------------------------
   Description & Details
   ----------------------------------------- */
.ep-desc {
  margin-top: 38px;
}

.ep-desc h4 {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: .5px;
}

.ep-desc p,
.ep-desc li {
  font-size: .8rem;
  line-height: 1.5;
  color: var(--ep-text-soft);
}

/* -----------------------------------------
   Core Exchange Section
   ----------------------------------------- */
.ep-core-exchange {
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border: 1px solid #a5d6a7;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.ep-core-exchange-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ep-core-icon {
  font-size: 1.4rem;
}

.ep-core-title {
  font-size: 1rem;
  font-weight: 700;
  color: #2e7d32;
  letter-spacing: .3px;
}

.ep-core-exchange-body p {
  margin: 0 0 12px;
  font-size: .82rem;
  color: #33691e;
  line-height: 1.4;
}

.ep-core-value {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid #c8e6c9;
}

.ep-core-label {
  font-size: .78rem;
  color: #558b2f;
  font-weight: 500;
}

.ep-core-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2e7d32;
}

/* -----------------------------------------
   Packaging Info
   ----------------------------------------- */
.ep-packaging-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.ep-pack-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border: 1px solid #90caf9;
  border-radius: 12px;
  padding: 14px 18px;
  flex: 1;
  min-width: 180px;
}

.ep-pack-badge--min {
  background: linear-gradient(135deg, #fff3e0 0%, #fff8e1 100%);
  border-color: #ffcc80;
}

.ep-pack-icon {
  font-size: 1.6rem;
}

.ep-pack-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ep-pack-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #5c6bc0;
  font-weight: 600;
}

.ep-pack-badge--min .ep-pack-label {
  color: #ef6c00;
}

.ep-pack-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1565c0;
}

.ep-pack-badge--min .ep-pack-value {
  color: #e65100;
}

/* -----------------------------------------
   Copyable Elements
   ----------------------------------------- */
.ep-copyable {
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
}

.ep-copyable:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.ep-copy-icon {
  opacity: .5;
  vertical-align: middle;
  margin-left: 4px;
  transition: opacity .2s;
}

.ep-copyable:hover .ep-copy-icon {
  opacity: 1;
}

.ep-copied {
  background: #d1fae5 !important;
  border-color: #6ee7b7 !important;
}

.ep-copied::after {
  content: '✓';
  position: absolute;
  right: -8px;
  top: -8px;
  background: #10b981;
  color: #fff;
  font-size: .6rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn .3s ease;
}

/* -----------------------------------------
   Tooltip Styling
   ----------------------------------------- */
.ep-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e3f2fd;
  color: #1976d2;
  font-size: 11px;
  font-weight: 600;
  cursor: help;
  margin-left: 6px;
  border: 1px solid #bbdefb;
  transition: all 0.2s ease;
  position: relative;
  text-decoration: none;
}

.ep-tooltip:hover {
  transform: scale(1.2);
  background: #bbdefb;
  color: #0d47a1;
}

.ep-tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #64748b;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.2);
  pointer-events: none;
}

.ep-tooltip::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #64748b;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}

.ep-tooltip:hover::before,
.ep-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* -----------------------------------------
   Animations
   ----------------------------------------- */
@keyframes cartPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.15); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.cart-pulse {
  animation: cartPulse 0.6s ease-in-out;
}

@keyframes popIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* -----------------------------------------
   Responsive Media Queries
   ----------------------------------------- */
@media (max-width: 960px) {
  .ep-detail-grid {
    grid-template-columns: 1fr;
    padding: 26px 26px 38px;
  }
}

@media (max-width: 668px) {
  .ep-offer-row {
    display: block;
  }
}