/* ============================================================
   Điện Máy ĐTC — theme storefront (viết mới, tham chiếu bố cục
   trang gốc: xanh lá #1e9c3a, giá đỏ, lưới 5 cột)
   ============================================================ */
:root {
  --green: #1e9c3a;
  --green-dark: #17812f;
  --green-darker: #126626;
  --red: #dd0000;
  --text: #333;
  --text-light: #666;
  --muted: #999;
  --border: #e5e5e5;
  --bg-gray: #f5f5f5;
  --fb: #3b5998;
  --zalo: #0068ff;
  --container: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 10px; }
.ico { width: 16px; height: 16px; fill: currentColor; vertical-align: -3px; }
.ico.big { width: 28px; height: 28px; }
.hide-mobile { }

/* ---------------- Topbar ---------------- */
.topbar {
  background: var(--green);
  color: #fff;
  font-size: 13px;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
  flex-wrap: wrap;
}
.topbar-left { display: flex; gap: 18px; align-items: center; }
.topbar-item { display: inline-flex; align-items: center; gap: 5px; }
.topbar-right a { color: #fff; }
.topbar-right a:hover { text-decoration: underline; }
.topbar-right .sep { margin: 0 8px; opacity: .6; }

/* ---------------- Header ---------------- */
.header { background: #fff; border-bottom: 1px solid var(--border); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 10px;
}
.logo { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.logo-star { width: 26px; height: 26px; fill: var(--green); align-self: center; }
.logo-text {
  font-size: 34px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: 1px;
  line-height: 1;
}
.logo-sub { font-size: 11px; font-weight: 700; color: var(--green-dark); letter-spacing: 2px; }

.search {
  flex: 1;
  display: flex;
  max-width: 560px;
  border: 2px solid var(--green);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
}
.search input {
  flex: 1;
  border: 0;
  outline: none;
  padding: 9px 16px;
  color: var(--text);
}
.search button {
  border: 0;
  background: #fff;
  color: var(--muted);
  padding: 0 14px;
}
.search button:hover { color: var(--green); }

.header-right { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.hotline { display: flex; align-items: center; gap: 8px; color: var(--green); }
.hotline .hotline-label { display: block; font-size: 11px; color: var(--text-light); }
.hotline strong { font-size: 16px; color: var(--green); }
.cart-link { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 600; }
.cart-icon-wrap { position: relative; display: inline-block; }
.cart-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  text-align: center;
  border-radius: 9px;
  padding: 0 3px;
}
.menu-toggle { display: none; background: none; border: 0; }
.menu-toggle span { display: block; width: 22px; height: 3px; background: var(--green); margin: 4px 0; border-radius: 2px; }

/* ---------------- Main nav ---------------- */
.mainnav { background: var(--green); position: relative; z-index: 50; }
.nav-list { display: flex; flex-wrap: wrap; }
.nav-item > a {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  padding: 12px 14px;
}
.nav-item > a:hover, .nav-item:hover > a { background: var(--green-dark); }
.caret { width: 14px; height: 14px; fill: #fff; }
.nav-item { position: relative; }
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 230px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--green);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  z-index: 60;
}
.nav-item:hover .dropdown { display: block; }
.dropdown a {
  display: block;
  padding: 9px 16px;
  color: var(--text);
  font-size: 13px;
  border-bottom: 1px solid #f2f2f2;
}
.dropdown a:hover { color: var(--green); background: var(--bg-gray); padding-left: 20px; transition: padding .15s; }

/* ---------------- Slider ---------------- */
.slider { position: relative; margin-top: 12px; border-radius: 4px; overflow: hidden; }
.slide { display: none; }
.slide.active { display: block; }
.slide img { width: 100%; }
.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  padding: 0;
}
.dot.active { background: #fff; }
.sub-banner { margin-top: 12px; }
.sub-banner img { width: 100%; border-radius: 4px; }

/* ---------------- Home section ---------------- */
.home-section { margin-top: 26px; }
.section-bar {
  display: flex;
  align-items: center;
  background: var(--green);
  border-radius: 3px 3px 0 0;
  overflow: hidden;
}
.section-title {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 10px 20px;
  background: var(--green-dark);
  letter-spacing: .5px;
}
.section-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding-right: 10px;
  overflow: hidden;
  white-space: nowrap;
}
.section-links a {
  color: #eafff0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 6px 8px;
}
.section-links a:hover { color: #fff; text-decoration: underline; }
.section-links .view-all { color: #fff; font-weight: 700; }

/* ---------------- Product grid/card ---------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--border);
  border-top: 0;
}
.product-card {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 10px;
  position: relative;
  transition: box-shadow .2s;
}
.product-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,.14); z-index: 2; }
.pc-img { position: relative; display: block; }
.pc-img img { width: 100%; aspect-ratio: 1/1; object-fit: contain; }
.pc-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
}
.pc-body { display: flex; flex-direction: column; flex: 1; margin-top: 8px; }
.pc-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}
.pc-name:hover { color: var(--green); }
.pc-sku { font-size: 12px; color: var(--muted); margin: 2px 0 6px; min-height: 18px; }
.pc-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.price { color: var(--red); font-size: 16px; font-weight: 800; }
.price-old { color: var(--muted); font-size: 13px; text-decoration: line-through; }
.btn-add-cart {
  margin-top: auto;
  background: var(--green);
  color: #fff;
  border: 0;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  padding: 9px 6px;
  border-radius: 3px;
  letter-spacing: .3px;
}
.btn-add-cart:hover { background: var(--green-dark); }

/* ---------------- Collection / breadcrumb ---------------- */
.breadcrumb {
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-light);
}
.breadcrumb a:hover { color: var(--green); }
.breadcrumb .sep { margin: 0 6px; color: var(--muted); }

.collection-layout { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 30px; }
.sidebar { width: 240px; flex-shrink: 0; }
.sidebar-box { border: 1px solid var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 16px; }
.sidebar-box h3 {
  background: var(--green);
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
  padding: 10px 14px;
}
.sidebar-box ul li a {
  display: block;
  padding: 9px 14px;
  border-bottom: 1px solid #f2f2f2;
  font-size: 13px;
}
.sidebar-box ul li a:hover, .sidebar-box ul li a.active { color: var(--green); font-weight: 700; }
.collection-main { flex: 1; min-width: 0; }
.collection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.collection-head h1 { font-size: 22px; color: var(--green-dark); text-transform: uppercase; }
.sort select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 3px; }
.collection-main .product-grid { grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); }
.empty-note { padding: 40px 10px; text-align: center; color: var(--text-light); }

.pagination { display: flex; gap: 6px; justify-content: center; margin: 22px 0; }
.pagination a, .pagination .current, .pagination span {
  min-width: 34px;
  height: 34px;
  line-height: 32px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 3px;
  display: inline-block;
  padding: 0 6px;
}
.pagination a:hover { border-color: var(--green); color: var(--green); }
.pagination .current { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }

/* ---------------- Product detail ---------------- */
.product-detail { display: flex; gap: 30px; margin-bottom: 30px; }
.pd-gallery { width: 46%; flex-shrink: 0; }
.pd-gallery img { width: 100%; aspect-ratio: 1/1; object-fit: contain; border: 1px solid var(--border); border-radius: 4px; }
.pd-info { flex: 1; min-width: 0; }
.pd-info h1 { font-size: 22px; line-height: 1.35; margin-bottom: 8px; }
.pd-meta { color: var(--text-light); font-size: 13px; margin-bottom: 12px; }
.pd-price-box {
  background: var(--bg-gray);
  border: 1px dashed var(--green);
  border-radius: 4px;
  padding: 14px 16px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}
.pd-price { color: var(--red); font-size: 28px; font-weight: 800; }
.pd-price-old { color: var(--muted); font-size: 16px; text-decoration: line-through; }
.pd-save { color: var(--green-dark); font-weight: 700; font-size: 13px; }
.pd-actions { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.qty-box { display: flex; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.qty-box button { width: 34px; border: 0; background: var(--bg-gray); font-size: 16px; }
.qty-box input { width: 50px; text-align: center; border: 0; outline: none; }
.btn-buy {
  background: var(--red);
  color: #fff;
  border: 0;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: 3px;
}
.btn-buy:hover { background: #b80000; }
.btn-cart2 {
  background: var(--green);
  color: #fff;
  border: 0;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 3px;
}
.btn-cart2:hover { background: var(--green-dark); }
.pd-hotline {
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 10px 14px;
  color: var(--green-dark);
  font-size: 14px;
  margin-bottom: 16px;
}
.pd-hotline strong { font-size: 18px; }
.pd-specs { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.pd-specs td { border: 1px solid var(--border); padding: 8px 12px; }
.pd-specs td:first-child { background: var(--bg-gray); width: 40%; font-weight: 600; }

.pd-desc { margin-bottom: 30px; }
.pd-desc h2, .section-heading {
  font-size: 16px;
  text-transform: uppercase;
  color: #fff;
  background: var(--green);
  padding: 10px 16px;
  border-radius: 3px 3px 0 0;
}
.pd-desc-body { border: 1px solid var(--border); border-top: 0; padding: 16px; }
.pd-desc-body ul { list-style: disc; padding-left: 20px; }
.pd-desc-body p { margin-bottom: 10px; }

.related { margin-bottom: 30px; }
.related .product-grid { border-top: 1px solid var(--border); }

/* ---------------- Cart / checkout ---------------- */
.page-title { font-size: 22px; margin: 18px 0; color: var(--green-dark); text-transform: uppercase; }
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.cart-table th {
  background: var(--green);
  color: #fff;
  padding: 10px;
  font-size: 13px;
  text-transform: uppercase;
  text-align: left;
}
.cart-table td { border: 1px solid var(--border); padding: 10px; vertical-align: middle; }
.cart-item-img { width: 70px; }
.cart-item-img img { width: 60px; height: 60px; object-fit: contain; }
.cart-qty-form { display: flex; gap: 6px; align-items: center; }
.cart-qty-form input { width: 56px; padding: 6px; border: 1px solid var(--border); border-radius: 3px; text-align: center; }
.btn-mini { background: var(--green); border: 0; color: #fff; padding: 7px 10px; border-radius: 3px; font-size: 12px; }
.btn-mini.danger { background: var(--red); }
.cart-total-row { display: flex; justify-content: flex-end; align-items: baseline; gap: 12px; font-size: 16px; margin: 14px 0; }
.cart-total-row .grand { color: var(--red); font-size: 24px; font-weight: 800; }
.cart-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }

.checkout-layout { display: flex; gap: 26px; align-items: flex-start; margin-bottom: 30px; }
.checkout-form { flex: 1; }
.checkout-form label { display: block; font-weight: 600; margin: 12px 0 4px; }
.checkout-form input, .checkout-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  outline: none;
}
.checkout-form input:focus, .checkout-form textarea:focus { border-color: var(--green); }
.checkout-summary { width: 340px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 4px; padding: 16px; background: var(--bg-gray); }
.checkout-summary h3 { margin-bottom: 10px; font-size: 15px; }
.cs-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.cs-total { display: flex; justify-content: space-between; padding-top: 10px; font-weight: 800; color: var(--red); font-size: 17px; }
.alert-error { background: #fdecea; border: 1px solid #f5c6c3; color: #b71c1c; border-radius: 4px; padding: 10px 14px; margin: 12px 0; }
.alert-error ul { list-style: disc; padding-left: 18px; }
.order-success { text-align: center; padding: 50px 10px; }
.order-success .big-check { width: 70px; height: 70px; fill: var(--green); margin: 0 auto 14px; display: block; }
.order-success h1 { color: var(--green-dark); margin-bottom: 8px; }

/* ---------------- Static page/contact ---------------- */
.static-page { max-width: 860px; margin-bottom: 40px; }
.static-page h2 { color: var(--green-dark); margin: 14px 0 8px; }
.static-page p { margin-bottom: 10px; }
.static-page ul { list-style: disc; padding-left: 22px; margin-bottom: 10px; }
.contact-grid { display: flex; gap: 26px; margin-bottom: 40px; flex-wrap: wrap; }
.contact-card { flex: 1; min-width: 260px; border: 1px solid var(--border); border-radius: 4px; padding: 20px; }
.contact-card h3 { color: var(--green-dark); margin-bottom: 10px; }
.contact-card li { padding: 6px 0; }

/* ---------------- Footer ---------------- */
.footer { background: #222; color: #bbb; margin-top: 40px; font-size: 13px; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 30px 10px;
}
.footer h4 {
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--green);
  display: inline-block;
}
.footer h4.mt { margin-top: 16px; }
.footer-col li { padding: 4px 0; }
.footer-col a:hover { color: var(--green); }
.footer-contact li { display: flex; gap: 8px; align-items: flex-start; }
.footer-contact .ico { flex-shrink: 0; margin-top: 2px; fill: var(--green); }
.cert-badge {
  display: inline-block;
  border: 1px solid var(--green);
  color: #7fd694;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 3px;
  line-height: 1.5;
}
.pay-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-badges span {
  background: #333;
  border: 1px solid #444;
  color: #ddd;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 3px;
}
.footer-bottom { background: #1a1a1a; padding: 12px 0; font-size: 12px; color: #888; }

/* ---------------- Floating widgets ---------------- */
@keyframes ring {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(-18deg); }
  20% { transform: rotate(14deg); }
  30% { transform: rotate(-10deg); }
  40% { transform: rotate(6deg); }
  50% { transform: rotate(0); }
}
.float-phone {
  position: fixed;
  left: 18px;
  bottom: 18px;
  width: 54px;
  height: 54px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 8px rgba(221, 0, 0, .18);
  z-index: 200;
}
.float-phone svg { width: 26px; height: 26px; fill: #fff; animation: ring 1.6s infinite; }
.float-side {
  position: fixed;
  right: 0;
  top: 45%;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 4px 0 0 4px;
  line-height: 1.25;
}
.fs-hotline { background: var(--green); }
.fs-facebook { background: var(--fb); }
.fs-zalo { background: var(--zalo); }
.zalo-txt {
  background: #fff;
  color: var(--zalo);
  font-size: 10px;
  font-weight: 800;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.back-top {
  position: fixed;
  right: 16px;
  bottom: 18px;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 0;
  background: var(--green);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.back-top.show { display: flex; }
.back-top .ico { width: 22px; height: 22px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .collection-main .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .logo-text { font-size: 26px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .menu-toggle { display: block; }
  .mainnav { display: none; }
  .mainnav.open { display: block; }
  .nav-list { flex-direction: column; }
  .dropdown { position: static; display: none; box-shadow: none; }
  .nav-item.open .dropdown { display: block; }
  .product-grid, .collection-main .product-grid { grid-template-columns: repeat(2, 1fr); }
  .collection-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .product-detail { flex-direction: column; }
  .pd-gallery { width: 100%; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .checkout-layout { flex-direction: column; }
  .checkout-summary { width: 100%; }
  .section-title { font-size: 14px; padding: 9px 12px; }
  .cart-table .hide-sm { display: none; }
}
@media (max-width: 480px) {
  .footer-cols { grid-template-columns: 1fr; }
  .topbar-inner { justify-content: center; }
}
