/* ===== Variables ===== */
:root {
  --red: #e30613;
  --red-dark: #c4161c;
  --red-light: #fff0f0;
  --text: #1a1a1a;
  --text-muted: #666;
  --text-light: #999;
  --border: #e8e8e8;
  --bg: #f5f5f5;
  --white: #fff;
  --green: #2e9e4f;
  --blue: #1a73e8;
  --orange: #f5a623;
  --container: 1240px;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --font: "Roboto", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Top bar ===== */
.top-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.top-bar--dark {
  background: #000;
  color: #fff;
  text-align: center;
  border-bottom: none;
}

.top-bar--dark .top-bar__item i {
  color: #fff;
}

.top-bar__inner {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 8px 16px;
  flex-wrap: wrap;
}

.top-bar__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-bar__item i {
  color: var(--red);
  font-size: 14px;
}

/* ===== Header ===== */
.header {
  background: var(--red);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.logo span {
  font-weight: 400;
}

.btn-category {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--white);
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-category:hover {
  background: rgba(255, 255, 255, 0.25);
}

.location-select {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--white);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.location-select i {
  font-size: 16px;
}

.search-box {
  flex: 1;
  display: flex;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 560px;
}

.search-box input {
  flex: 1;
  border: none;
  padding: 11px 16px;
  font-size: 14px;
  outline: none;
}

.search-box button {
  background: transparent;
  border: none;
  padding: 0 16px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
}

.header__actions {
  display: flex;
  gap: 4px;
}

.header__action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--white);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: background 0.2s;
  white-space: nowrap;
}

.header__action:hover {
  background: rgba(255, 255, 255, 0.15);
}

.header__action i {
  font-size: 20px;
}

/* ===== Hero ===== */
.hero {
  background: var(--bg);
  padding: 16px 0;
}

.hero__grid {
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  gap: 12px;
  align-items: stretch;
}

.hero__grid--mega {
  grid-template-columns: minmax(260px, 280px) 1fr 220px;
}

.hero-sidebar-wrap {
  position: relative;
  z-index: 50;
}

.hero-sidebar {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hero-sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}

.hero-sidebar__item:last-child {
  border-bottom: none;
}

.hero-sidebar__item:hover,
.hero-sidebar__item.is-active {
  background: #fff5f5;
  color: var(--red);
}

.hero-sidebar__item i.fa-mobile-alt,
.hero-sidebar__item i.fa-laptop,
.hero-sidebar__item i.fa-headphones,
.hero-sidebar__item i.fa-clock,
.hero-sidebar__item i.fa-recycle,
.hero-sidebar__item i.fa-plug,
.hero-sidebar__item i.fa-tablet-alt,
.hero-sidebar__item i.fa-microchip,
.hero-sidebar__item i.fa-exchange-alt,
.hero-sidebar__item i.fa-newspaper,
.hero-sidebar__item i.fab {
  width: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
  text-align: center;
}

.hero-sidebar__item:hover i,
.hero-sidebar__item.is-active i {
  color: var(--red);
}

.hero-sidebar__label {
  flex: 1;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-sidebar__arrow {
  font-size: 10px;
  color: #ccc;
  flex-shrink: 0;
}

.hero-sidebar__item:hover .hero-sidebar__arrow,
.hero-sidebar__item.is-active .hero-sidebar__arrow {
  color: var(--red);
}

/* Mega menu panel */
.mega-menu-panels {
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 4px;
  min-width: 720px;
  max-width: calc(100vw - 320px);
  pointer-events: none;
}

.mega-menu-panel {
  display: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 20px 24px;
  min-height: 320px;
  pointer-events: auto;
}

.mega-menu-panel.is-visible {
  display: block;
}

.mega-menu-panel__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px 24px;
}

.mega-menu-panel__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.mega-menu-panel__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-menu-panel__col li {
  margin-bottom: 6px;
}

.mega-menu-panel__col a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.15s;
}

.mega-menu-panel__col a:hover {
  color: var(--red);
}

.mega-menu-panel__empty {
  padding: 24px;
  font-size: 14px;
}

.hero-slide--fallback {
  background: linear-gradient(135deg, #1a1a2e, #e30613);
  min-height: 320px;
}

.hero-slide--fallback .hero-slide__content {
  min-height: 320px;
}

.hero-slide--banner.hero-slide--fallback img {
  display: none;
}

.hero-carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--white);
  min-height: 320px;
}

.hero-slide {
  display: none;
  height: 100%;
  min-height: 320px;
}

.hero-slide.active {
  display: block;
}

.hero-slide__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 40px;
  height: 100%;
  min-height: 320px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: var(--white);
}

.hero-slide__text h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-slide__text p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 16px;
}

.hero-slide__price {
  font-size: 36px;
  font-weight: 700;
  color: #ffd700;
}

.hero-slide__price small {
  font-size: 18px;
}

.hero-slide__visual {
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}

.hero-slide--watch .hero-slide__content {
  background: linear-gradient(135deg, #2d1b4e, #1a0a2e);
}

.hero-slide--laptop .hero-slide__content {
  background: linear-gradient(135deg, #0d3b2e, #1a5c40);
}

.hero-tabs {
  display: flex;
  gap: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
}

.hero-tab {
  flex: 1;
  padding: 10px 8px;
  font-size: 12px;
  text-align: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.hero-tab:hover,
.hero-tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  background: var(--red-light);
}

.hero-promos {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.promo-card {
  flex: 1;
  border-radius: var(--radius);
  padding: 16px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
}

.promo-card:hover {
  transform: translateY(-2px);
}

.promo-card h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.promo-card .price {
  font-size: 22px;
  font-weight: 700;
}

.promo-card .warranty {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 4px;
}

.promo-card--blue {
  background: linear-gradient(135deg, #1565c0, #0d47a1);
}

.promo-card--green {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
}

.promo-card--orange {
  background: linear-gradient(135deg, #e65100, #bf360c);
}

/* ===== Banner strip ===== */
.banner-strip {
  margin: 16px 0;
}

.banner-strip__inner {
  background: linear-gradient(90deg, #ff6b35, #f7931e, #ffcd3c);
  border-radius: var(--radius);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  font-weight: 600;
}

.banner-strip__title {
  font-size: 18px;
}

.banner-strip__offers {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.banner-strip__offers span {
  background: rgba(255, 255, 255, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
}

/* ===== Section ===== */
.section {
  padding: 24px 0;
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
}

.section__title::before {
  content: "";
  width: 4px;
  height: 22px;
  background: var(--red);
  border-radius: 2px;
}

.section__tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.section__tabs a {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  background: #f0f0f0;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.section__tabs a:hover,
.section__tabs a.active {
  color: var(--red);
  background: #fff0f0;
  font-weight: 500;
}

.section__tabs .view-all {
  color: var(--red);
  font-weight: 600;
  background: transparent;
}

.section__tabs .view-all:hover {
  background: transparent;
  text-decoration: underline;
}

/* ===== Product carousel ===== */
.product-carousel {
  position: relative;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  overflow: hidden;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  color: var(--text-muted);
  transition: all 0.2s;
}

.carousel-btn:hover {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.carousel-btn--prev {
  left: -18px;
}

.carousel-btn--next {
  right: -18px;
}

/* ===== Product card ===== */
.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product-card__badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  z-index: 1;
}

.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
}

.badge--sale {
  background: var(--red);
  color: var(--white);
}

.badge--installment {
  background: var(--blue);
  color: var(--white);
}

.badge--genuine {
  background: var(--green);
  color: var(--white);
}

.product-card__img {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  background: #fafafa;
  border-radius: 6px;
  font-size: 56px;
}

.product-card__img img {
  max-height: 120px;
  object-fit: contain;
}

.product-card__title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

.product-card__meta {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.meta-tag {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-tag--time {
  color: var(--red);
}

.meta-tag--warranty {
  color: var(--green);
}

.product-card__price {
  margin-bottom: 6px;
}

.price-current {
  font-size: 16px;
  font-weight: 700;
  color: var(--red);
}

.price-old {
  font-size: 12px;
  color: var(--text-light);
  text-decoration: line-through;
  margin-left: 6px;
}

.product-card__member {
  font-size: 11px;
  color: var(--blue);
  background: #e8f4fd;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.product-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

.stars {
  color: var(--orange);
}

/* ===== Category icons ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.category-item {
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.category-item:hover {
  transform: translateY(-4px);
}

.category-item__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 8px;
  background: #f8f8f8;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  border: 1px solid var(--border);
}

.category-item span {
  font-size: 12px;
  color: var(--text);
}

/* ===== Promo banners row ===== */
.promo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0;
}

.promo-banner {
  border-radius: var(--radius);
  overflow: hidden;
  height: 120px;
  display: flex;
  align-items: center;
  padding: 20px;
  color: var(--white);
  cursor: pointer;
  transition: transform 0.2s;
}

.promo-banner:hover {
  transform: scale(1.02);
}

.promo-banner h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.promo-banner p {
  font-size: 12px;
  opacity: 0.9;
}

.promo-banner--bank1 {
  background: linear-gradient(135deg, #1e88e5, #1565c0);
}

.promo-banner--bank2 {
  background: linear-gradient(135deg, #43a047, #2e7d32);
}

.promo-banner--bank3 {
  background: linear-gradient(135deg, #8e24aa, #6a1b9a);
}

/* ===== News ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.news-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
  cursor: pointer;
}

.news-card:hover {
  box-shadow: var(--shadow);
}

.news-card__img {
  height: 160px;
  background: linear-gradient(135deg, #37474f, #263238);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.news-card__body {
  padding: 12px;
}

.news-card__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Footer ===== */
.footer {
  background: #f0f0f0;
  margin-top: 40px;
  padding-top: 40px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}

.footer__logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 16px;
}

.footer__contact p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.footer__contact i {
  color: var(--red);
  margin-top: 3px;
}

.footer h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.footer ul li {
  margin-bottom: 10px;
}

.footer ul a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer ul a:hover {
  color: var(--red);
}

.newsletter {
  margin-top: 20px;
}

.newsletter h4 {
  margin-bottom: 12px;
}

.newsletter__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.newsletter__form input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 12px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--red-dark);
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.social-links a:hover {
  transform: scale(1.1);
}

.footer__seo {
  background: var(--white);
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.footer__seo p {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.8;
}

.footer__bottom {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 16px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Floating buttons ===== */
.floating-actions {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 999;
}

.btn-call {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(225, 27, 34, 0.4);
  transition: transform 0.2s;
}

.btn-call:hover {
  transform: scale(1.05);
}

.btn-float {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.btn-float:hover {
  transform: scale(1.1);
}

.btn-float--zalo {
  background: #0068ff;
  color: var(--white);
}

.btn-float--top {
  background: var(--red);
  color: var(--white);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.btn-float--top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .hero__grid,
  .hero__grid--mega {
    grid-template-columns: 1fr;
  }

  .hero-sidebar-wrap {
    display: none;
  }

  .mega-menu-panels {
    display: none;
  }

  .hero-promos {
    flex-direction: row;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .top-bar__inner {
    display: none;
  }

  .location-select {
    display: none;
  }

  .header__action span {
    display: none;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .promo-row {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }

  .carousel-btn {
    display: none;
  }

  .product-carousel .product-grid {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    grid-template-columns: repeat(5, 160px);
  }
}

@media (max-width: 480px) {
  .search-box {
    display: none;
  }

  .banner-strip__offers {
    flex-direction: column;
    gap: 8px;
  }
}
