/* ══════════════════════════════════════
   DM Nuevos Productos
   modules/dm_newproducts/views/css/dm_newproducts.css
══════════════════════════════════════ */

/* ── Sección ── */
.dm-products {
  background: var(--dm-blue-ice);
  padding: 72px 48px;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}

.dm-products__inner {
  max-width: 1320px;
  margin: 0 auto;
}

/* ── Header ── */
.dm-products__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

/* ── Tabs ── */
.dm-products__tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--dm-border);
}

.dm-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--dm-text-mid);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.dm-tab-btn:hover,
.dm-tab-btn.active {
  color: var(--dm-blue-bright);
  border-bottom-color: var(--dm-blue-bright);
}

/* ── Grid (con y sin tabs) ── */
.dm-products__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.dm-tab-panel {
  display: none;
}

.dm-tab-panel.active {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* ── Product card ── */
.dm-product-card {
  background: var(--dm-white);
  border: 1.5px solid var(--dm-border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.dm-product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(70,164,170,0.13);
  border-color: var(--dm-blue-bright);
}

/* ── Badge ── */
.dm-product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 2;
}

.dm-product-badge--new {
  background: var(--dm-blue-bright);
  color: white;
}

.dm-product-badge--sale {
  background: #e63b3b;
  color: white;
  top: 40px;
}

/* ── Imagen ── */
.dm-product-card__img-wrap {
  display: block;
  background: var(--dm-white);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--dm-border);
}

.dm-product-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 0.3s;
}

.dm-product-card:hover .dm-product-card__img-wrap img {
  transform: scale(1.04);
}

.dm-product-card__no-img {
  width: 100%;
  height: 100%;
  background: var(--dm-blue-ice);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dm-border);
}

/* ── Body ── */
.dm-product-card__body {
  padding: 20px;
  background: var(--dm-blue-ice);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dm-product-card__brand {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dm-blue-bright);
}

.dm-product-card__name {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: var(--dm-text-dark) !important;
  line-height: 1.35 !important;
  margin: 4px 0 !important;
}

.dm-product-card__name a {
  color: var(--dm-text-dark) !important;
  text-decoration: none !important;
}

.dm-product-card__name a:hover {
  color: var(--dm-blue-bright) !important;
}

.dm-product-card__ref {
  font-size: 0.7rem;
  color: var(--dm-slate);
  margin-bottom: 8px;
}

/* ── Footer: precio + botón ── */
.dm-product-card__footer {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dm-product-card__price {
  display: flex;
  flex-direction: column;
}

.dm-product-card__price-current {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  color: var(--dm-navy);
  line-height: 1;
}

.dm-product-card__price-old {
  font-size: 0.75rem;
  color: var(--dm-slate);
  text-decoration: line-through;
  margin-top: 2px;
}

/* ── Botón agregar ── */
.dm-product-card__atc {
  padding: 9px 16px;
  background: var(--dm-blue-bright);
  color: white !important;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none !important;
}

.dm-product-card__atc:hover {
  background: var(--dm-blue-deep);
  transform: scale(1.03);
  color: white !important;
}

.dm-product-card__atc--outline {
  background: transparent;
  border: 1.5px solid var(--dm-blue-bright);
  color: var(--dm-blue-bright) !important;
}

.dm-product-card__atc--outline:hover {
  background: var(--dm-blue-bright);
  color: white !important;
}

.dm-atc-form {
  margin: 0;
  padding: 0;
}

/* ── Empty state ── */
.dm-products__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--dm-slate);
  padding: 48px;
  font-size: 0.9rem;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .dm-products {
    padding: 48px 24px;
  }
  .dm-tab-panel.active {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .dm-tab-panel.active {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .dm-tab-panel.active {
    grid-template-columns: 1fr;
  }
}
