/*
 Theme Name:   Electro Child — Dien May Truc Tuyen
 Template:     electro
 Version:      1.0.0
*/

/* ═══════════════════════════════════════════════════════════════════
   DESIGN TOKENS — dễ thay đổi toàn bộ màu tại 1 chỗ
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --dmtt-navy:       #0F1B2D;
  --dmtt-navy-mid:   #1A2F48;
  --dmtt-blue:       #1A73E8;
  --dmtt-red:        #E24B4A;
  --dmtt-green:      #1D9E75;
  --dmtt-amber:      #EF9F27;
  --dmtt-gray-bg:    #F5F6F8;
  --dmtt-border:     rgba(0,0,0,0.09);
  --dmtt-text:       #111827;
  --dmtt-text-muted: #6B7280;
  --dmtt-radius:     10px;
  --dmtt-radius-sm:  6px;
}

/* ═══════════════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════════════ */
.dmtt-topbar {
  background: var(--dmtt-navy);
  padding: 7px 0;
  font-size: 12px;
}
.dmtt-topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dmtt-topbar__left,
.dmtt-topbar__right {
  display: flex;
  gap: 20px;
  align-items: center;
}
.dmtt-topbar__left a,
.dmtt-topbar__left span,
.dmtt-topbar__right a {
  color: #9BB3CC;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}
.dmtt-topbar__left a:hover,
.dmtt-topbar__right a:hover { color: #fff; }

/* ═══════════════════════════════════════════════════════════════════
   TRUST BADGES
   ═══════════════════════════════════════════════════════════════════ */
.dmtt-trust-badges {
  background: #fff;
  border-top: 1px solid var(--dmtt-border);
  border-bottom: 1px solid var(--dmtt-border);
  padding: 14px 0;
  margin: 16px 0;
}
.dmtt-trust-badges__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.dmtt-trust-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  border-right: 1px solid var(--dmtt-border);
}
.dmtt-trust-badge:last-child { border-right: none; }
.dmtt-trust-badge__icon { font-size: 28px; flex-shrink: 0; }
.dmtt-trust-badge strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dmtt-text);
  line-height: 1.3;
}
.dmtt-trust-badge span {
  font-size: 12px;
  color: var(--dmtt-text-muted);
}

/* ═══════════════════════════════════════════════════════════════════
   FLASH SALE SECTION
   ═══════════════════════════════════════════════════════════════════ */
.dmtt-flash-sale {
  background: #fff;
  border: 1px solid var(--dmtt-border);
  border-radius: var(--dmtt-radius);
  padding: 18px 20px;
  margin: 0 0 20px;
}
.dmtt-flash-sale__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.dmtt-flash-sale__title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dmtt-flash-sale__title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--dmtt-text);
  margin: 0;
}

/* Countdown */
.dmtt-countdown {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dmtt-countdown__label {
  font-size: 13px;
  color: var(--dmtt-text-muted);
}
.dmtt-countdown__blocks {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dmtt-countdown__block {
  background: var(--dmtt-navy);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  padding: 4px 9px;
  border-radius: var(--dmtt-radius-sm);
  min-width: 36px;
  text-align: center;
}
.dmtt-countdown__block--red { background: var(--dmtt-red); }
.dmtt-countdown__sep {
  font-size: 18px;
  font-weight: 700;
  color: var(--dmtt-navy);
}

/* ═══════════════════════════════════════════════════════════════════
   FEATURED BY CATEGORY SECTION
   ═══════════════════════════════════════════════════════════════════ */
.dmtt-featured-cats {
  background: #fff;
  border: 1px solid var(--dmtt-border);
  border-radius: var(--dmtt-radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.dmtt-featured-cats__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}
.dmtt-featured-cats__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dmtt-text);
  margin: 0;
}

/* Category tabs */
.dmtt-cat-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--dmtt-border);
  margin: 12px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.dmtt-cat-tabs::-webkit-scrollbar { display: none; }

.dmtt-cat-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--dmtt-text-muted);
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.dmtt-cat-tab:hover { color: var(--dmtt-blue); }
.dmtt-cat-tab.is-active {
  color: var(--dmtt-blue);
  border-bottom-color: var(--dmtt-blue);
  font-weight: 600;
}

/* Brand pills */
.dmtt-brand-pills {
  display: flex;
  gap: 8px;
  padding: 12px 0 8px;
  flex-wrap: wrap;
}
.dmtt-brand-pill {
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--dmtt-border);
  background: transparent;
  color: var(--dmtt-text-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dmtt-brand-pill:hover { border-color: var(--dmtt-blue); color: var(--dmtt-blue); }
.dmtt-brand-pill.is-active {
  background: var(--dmtt-navy);
  color: #fff;
  border-color: var(--dmtt-navy);
}

/* ═══════════════════════════════════════════════════════════════════
   HORIZONTAL PRODUCT SCROLL (dùng chung cho Flash Sale + Featured)
   ═══════════════════════════════════════════════════════════════════ */
.dmtt-scroll-wrap {
  position: relative;
}
.dmtt-product-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  cursor: grab;
}
.dmtt-product-scroll:active { cursor: grabbing; }

/* Scrollbar mỏng, đẹp */
.dmtt-product-scroll::-webkit-scrollbar { height: 3px; }
.dmtt-product-scroll::-webkit-scrollbar-track { background: var(--dmtt-gray-bg); border-radius: 2px; }
.dmtt-product-scroll::-webkit-scrollbar-thumb { background: var(--dmtt-navy); border-radius: 2px; }

/* Scroll arrows */
.dmtt-scroll-arrows { display: flex; gap: 6px; }
.dmtt-scroll-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--dmtt-border);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--dmtt-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.dmtt-scroll-arrow:hover {
  background: var(--dmtt-navy);
  color: #fff;
  border-color: var(--dmtt-navy);
}

/* Flash sale có arrow gắn cạnh scroll container */
.dmtt-flash-sale__scroll-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dmtt-flash-sale__scroll-wrap .dmtt-product-scroll { flex: 1; }

/* Progress dots */
.dmtt-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 12px 0 4px;
}
.dmtt-dot {
  height: 4px;
  border-radius: 2px;
  background: var(--dmtt-border);
  transition: width 0.2s ease, background 0.2s ease;
  width: 6px;
}
.dmtt-dot.is-active {
  width: 22px;
  background: var(--dmtt-navy);
}

/* Loading overlay */
.dmtt-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--dmtt-radius);
  z-index: 10;
}
.dmtt-loading__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--dmtt-border);
  border-top-color: var(--dmtt-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════
   PRODUCT CARD
   ═══════════════════════════════════════════════════════════════════ */
.dmtt-product-card {
  min-width: 175px;
  max-width: 175px;
  border: 1px solid var(--dmtt-border);
  border-radius: var(--dmtt-radius);
  overflow: hidden;
  scroll-snap-align: start;
  flex-shrink: 0;
  background: #fff;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.dmtt-product-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}
.dmtt-product-card__inner {
  text-decoration: none;
  color: inherit;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.dmtt-product-card__img {
  position: relative;
  aspect-ratio: 1;
  background: var(--dmtt-gray-bg);
  overflow: hidden;
}
.dmtt-product-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.dmtt-product-card:hover .dmtt-product-card__img img { transform: scale(1.05); }

/* Badges */
.dmtt-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  z-index: 2;
  letter-spacing: 0.04em;
}
.dmtt-badge--sale { background: var(--dmtt-red);   color: #fff; }
.dmtt-badge--new  { background: var(--dmtt-green); color: #fff; }
.dmtt-badge--hot  { background: var(--dmtt-amber); color: #fff; }

/* Wishlist button */
.dmtt-wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--dmtt-border);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
}
.dmtt-product-card:hover .dmtt-wishlist-btn { opacity: 1; }
.dmtt-wishlist-btn:hover { background: var(--dmtt-red); color: #fff; border-color: var(--dmtt-red); }
.dmtt-wishlist-btn.is-active { color: var(--dmtt-red); opacity: 1; }

.dmtt-product-card__body {
  padding: 10px;
  flex: 1;
}
.dmtt-product-card__brand {
  font-size: 11px;
  color: var(--dmtt-text-muted);
  margin: 0 0 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dmtt-product-card__name {
  font-size: 13px;
  color: var(--dmtt-text);
  margin: 0 0 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dmtt-product-card__price { margin: 0 0 4px; }
.dmtt-product-card__price .price ins {
  font-size: 15px;
  font-weight: 700;
  color: var(--dmtt-red);
  text-decoration: none;
}
.dmtt-product-card__price .price del {
  font-size: 11px;
  color: var(--dmtt-text-muted);
}
.dmtt-product-card__price .price > .amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--dmtt-text);
}
.dmtt-product-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}
.dmtt-product-card__rating .star-rating { font-size: 11px; }
.dmtt-product-card__reviews { color: var(--dmtt-text-muted); }

/* Add to cart button */
.dmtt-add-to-cart-btn {
  width: 100%;
  padding: 9px;
  background: var(--dmtt-navy);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.03em;
}
.dmtt-add-to-cart-btn:hover { background: var(--dmtt-blue); }
.dmtt-add-to-cart-btn.is-loading { background: var(--dmtt-text-muted); pointer-events: none; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .dmtt-trust-badges__inner { grid-template-columns: repeat(2, 1fr); }
  .dmtt-trust-badge:nth-child(2) { border-right: none; }
  .dmtt-trust-badge:nth-child(3) { border-top: 1px solid var(--dmtt-border); }
}
@media (max-width: 575px) {
  .dmtt-topbar__left span { display: none; }
  .dmtt-trust-badges__inner { grid-template-columns: repeat(2, 1fr); }
  .dmtt-product-card { min-width: 145px; max-width: 145px; }
  .dmtt-featured-cats { padding: 14px; }
  .dmtt-cat-tab { padding: 8px 12px; font-size: 12px; }
}
