// MobilePhoneCard.module.scss
// Mimics the dense spec-row layout from the reference image (e.g. DNS/Citilink product list)

.card {
  display: flex;
  flex-direction: row;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s ease;

  &:first-child {
    border-top: 1px solid #e8e8e8;
  }

  &:hover {
    background: #f5f8ff;
  }
}

// ── Image column ─────────────────────────────────────────────
.imageCol {
  position: relative;
  flex-shrink: 0;
  width: 250px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
}

.image {
  width: 250px;
  height: 260px;
  object-fit: contain;
}

.imagePlaceholder {
  width: 110px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: #f0f0f0;
  border-radius: 4px;
}

.outOfStockBadge {
  position: absolute;
  top: 0;
  left: 0;
  background: #999;
  color: #fff;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 1;
}

// ── Info column ──────────────────────────────────────────────
.infoCol {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.titleRow {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.name {
  font-size: 14px;
  font-weight: 600;
  color: #0645ad;
  cursor: pointer;
  line-height: 1.3;

  &:hover {
    text-decoration: underline;
  }
}

.brand {
  font-size: 11px;
  color: #888;
  font-weight: 400;
  white-space: nowrap;
}

// Dense spec paragraph — key selling point of this card
.specLine {
  margin: 0;
  font-size: 12px;
  color: #444;
  line-height: 1.6;
  word-break: break-word;
}

.specLabel {
  font-weight: 600;
  color: #222;
}

.specValue {
  font-weight: 400;
  color: #555;
}

// ── Footer ───────────────────────────────────────────────────
.footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
}

.priceBlock {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price {
  font-size: 16px;
  font-weight: 700;
  color: #c0392b;
}

.oldPrice {
  font-size: 12px;
  color: #aaa;
  text-decoration: line-through;
}

// ── Actions ──────────────────────────────────────────────────
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.iconBtn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  width: 34px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #aaa;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;

  &:hover {
    color: #888;
    border-color: #888;
  }

  &.favActive {
    color: #888;
    border-color: #888;
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

.cartBtn {
  display: flex;
  align-items: center;
  gap: 6px;
   padding-left: 0.5rem;
  padding-right: 0.5rem;
  background: #d32824;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
height: 36px;
  &:hover {
    background: #c0392b;
  }

  &:disabled {
    background: #ccc;
    cursor: not-allowed;
  }
}

// ── Quantity controls ────────────────────────────────────────
.quantityControls {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #d32824;
  background-color: #d32824;
  border-radius: 6px;
  overflow: hidden;
  min-width: 160px;
  justify-content: space-between;
}

.qtyBtn {
  background: none;
  border: none;
  width: 32px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 16px;
  transition: background 0.1s;

  &:hover {
    background: #e86064;
  }

  &:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
}

.qtyValue {
  min-width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  padding: 0 4px;
  line-height: 34px;
}

// ── Modal ────────────────────────────────────────────────────
.modalButton {
  padding: 6px 20px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;

  &:hover {
    background: #c0392b;
  }
}