* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #222;
  background: #f5f5f5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

/* =========================
   HEADER TOP
========================= */
.header-top {
  background: #3f4299;
  color: #fff;
}

.hotline-email {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.hotline-email li {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}

.hotline-email li:last-child {
  margin-bottom: 0;
}

.hotline-email a {
  color: #fff;
  font-weight: 700;
}

.email {
  padding-left: 0;
}

/* =========================
   NAVBAR
========================= */
.navbar-menu {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.navbar-menu .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 72px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.menu-toggle {
  display: block;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 8px 4px;
  user-select: none;
}

#cssmenu {
  width: 100%;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0 0 10px;
  width: 100%;
  display: none;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 768px) {
  .menu {
    display: flex !important;
  }
}

.menu.active {
  display: flex;
}

.menu li {
  position: relative;
  border-top: 1px solid #eee;
}

.menu li a {
  display: block;
  padding: 14px 8px;
  font-size: 15px;
  font-weight: 600;
  color: #222;
}

.menu li a:hover {
  color: #2f3e9e;
}

.sub-menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0 0 8px 12px;
  background: #f8f8f8;
}

.menu li.open > .sub-menu {
  display: block;
}

.sub-menu li {
  border-top: 1px solid #ececec;
}

.sub-menu li a {
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 500;
}

/* =========================
   CART ICON
========================= */
.cart-icon {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  background: #ff5a2c;
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

/* =========================
   PRODUCT LIST
========================= */
#list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  align-items: start;
}

.product-card {
  background: #fff;
  border: 1px solid #e9e9e9;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  object-position: center;
  background: #fff;
  padding: 10px;
}

.product-card div {
  padding: 0 12px;
  margin-top: 8px;
  font-size: 13px;
}

.product-card div:last-child {
  padding-bottom: 14px;
}

.product-card b {
  display: block;
  line-height: 1.45;
}

/* =========================
   POPUP
========================= */
.popup-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2000;
  padding: 10px;
}

.popup-box {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  border-radius: 14px;
  padding: 18px;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #f1f1f1;
  font-size: 20px;
  cursor: pointer;
}

.popup-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.left-info,
.right-option {
  width: 100%;
}

.product-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  object-position: center;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.left-info p {
  margin: 8px 0;
  font-size: 14px;
}

.right-option fieldset {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
}

.right-option legend {
  padding: 0 6px;
  font-weight: 700;
}

.right-option label {
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
}

.bottom-buy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.qty-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-box button {
  width: 38px;
  height: 38px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}

.qty-box input {
  width: 60px;
  height: 38px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.btn-cart {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: #ff5a2c;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* =========================
   CART POPUP
========================= */
.cart-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2200;
  padding: 10px;
}

.cart-box {
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  margin: 0 auto;
  padding: 18px;
  border-radius: 14px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.cart-left img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.cart-right {
  flex: 1;
}

.cart-footer {
  margin-top: 14px;
  text-align: right;
}

/* =========================
   FOOTER
========================= */
#footer {
  margin-top: 32px;
  background: #111;
  color: #fff;
  padding-top: 28px;
}

#footer .footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

#footer .footer-col h3,
#footer .footer-col h4 {
  margin: 0 0 12px;
}

#footer .footer-col p,
#footer .footer-col li,
#footer .footer-col a {
  color: #ddd;
  font-size: 14px;
}

#footer .footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#footer .footer-col li {
  margin-bottom: 8px;
}

#footer .footer-col a:hover {
  color: #fff;
}

#footer .footer-bottom {
  margin-top: 24px;
  border-top: 1px solid #2b2b2b;
  padding: 16px 0;
  text-align: center;
  color: #ccc;
  font-size: 13px;
}

/* =========================
   TABLET
========================= */
@media (min-width: 768px) {
  .hotline-email {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 0;
  }

  .hotline-email li {
    margin-bottom: 0;
    font-size: 13px;
  }

  #list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 16px 12px;
  }

  .product-card img {
    aspect-ratio: 16 / 10;
  }

  .popup-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .left-info,
  .right-option {
    width: 50%;
  }

  .bottom-buy {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .btn-cart {
    width: auto;
    min-width: 180px;
    padding: 0 18px;
  }

  #footer .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================
   DESKTOP
========================= */
@media (min-width: 992px) {
  .navbar-menu .container {
    min-height: 80px;
    flex-wrap: nowrap;
  }

  .menu-toggle {
    display: none;
  }

  #cssmenu {
    width: auto;
  }

  .menu {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    width: auto;
    padding: 0;
    gap: 0;
  }

  .menu li {
    border-top: none;
  }

  .menu li a {
    padding: 28px 18px;
  }

  .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding: 8px 0;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    border-radius: 0 0 10px 10px;
  }

  .sub-menu li {
    border-top: none;
  }

  .sub-menu li a {
    padding: 12px 16px;
  }

  .menu li:hover > .sub-menu {
    display: block;
  }

  #list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #footer .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .cart-icon {
    top: 20px;
    bottom: auto;
    right: 20px;
    border-radius: 10px;
  }
}

.searchproduct {
  margin-left: auto;
}

.searchproduct form {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.searchproduct input {
  width: 200px;
  padding: 6px 10px;
}

.searchproduct button {
  padding: 6px 12px;
  cursor: pointer;
}