@import "variables.css";

/* Product Detail Page Layout */
.product-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

.product-img-container {
  height: 480px;
  background: var(--grad-panel);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
}

.product-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid rgba(255, 204, 102, .35);
  background: rgba(255, 204, 102, .14);
  color: var(--warn);
}

.product-info h1 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.3;
}

.product-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 20px;
  flex-wrap: wrap;
}

/* Comparison Modal (Pure CSS implementation) */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, .85);
  backdrop-filter: blur(14px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all .4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
}

.overlay:target {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  width: min(900px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  transition: transform .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay:target .modal {
  transform: translateY(0);
}

.mhead {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mhead b {
  font-size: 18px;
}

.close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  transition: all 0.2s;
}

.close:hover {
  border-color: var(--accent);
  background: rgba(110, 168, 255, .1);
}

/* Comparison Table */
.modal table {
  width: 100%;
  border-collapse: collapse;
}

.modal th, .modal td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.modal th {
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  font-size: 14px;
}

.modal tr:last-child td {
  border-bottom: none;
}

/* Responsive adjustments */
@media (max-width: 980px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .product-img-container {
    height: 360px;
  }

  .product-info h1 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .product-img-container {
    height: 280px;
  }

  .product-details-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal th, .modal td {
    padding: 12px;
    font-size: 13px;
  }
}
