/* ==== Base Styles ==== */
html, body {
  font-family: Arial, sans-serif;
  background: #1e2a38;
  color: #fff;
  margin: 0;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

.container {
  max-width: 1300px;
  margin: auto;
  padding: 20px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  background: #0d1b2a;
  padding: 10px 0;
  flex-wrap: wrap;
  margin: 0;
}

nav li {
  margin: 5px;
  padding: 8px 16px;
  background: #ffd60a;
  border-radius: 6px;
}

nav a {
  color: #000;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
}

/* ==== Grid for SIM cards ==== */
.sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Điều chỉnh minmax cho chiều rộng tối thiểu của mỗi sim */
  gap: 10px; /* Khoảng cách giữa các sim */
  padding: 20px; /* Padding xung quanh khu vực chứa sim */
}

.sim-card {
  background: #0d1b2a;
  border: 2px solid gold;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.sim-card h3 {
  color: gold;
  font-size: 28px;
  margin: 5px 0;
  word-break: break-word;
}

.sim-card .gia {
  font-size: 14px;
  color: white;
}

.sim-card .state {
  font-size: 13px;
  color: #ccc;
}

/* ==== Filter Form ==== */
form.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

form.filter-form input,
form.filter-form select,
form.filter-form button {
  padding: 10px;
  border-radius: 5px;
  border: none;
  width: 100%;
  max-width: 260px;
  box-sizing: border-box;
  font-size: 16px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  line-height: 1.4;
  min-width: 140px;
}

button {
  background: orange;
  color: white;
  cursor: pointer;
  font-weight: bold;
}

/* ==== Popup Fixed Box (TÆ° váº¥n sim) ==== */
.popup-fixed {
  background: #1e2a38;
  border: 2px solid #ffd60a;
  padding: 10px;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 20px;
  z-index: 1;
  position: relative;
}

/* ==== Sidebar ==== */
.sidebar {
  width: 260px;
  padding-right: 15px;
  box-sizing: border-box;
  align-self: flex-start;
  z-index: 2;
  position: relative;
}

.sidebar h4 {
  color: gold;
  margin: 10px 0 5px 0;
}

.sidebar .filter-group {
  margin-bottom: 20px;
}

.sidebar ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 8px;
  background: #1e2a38;
  color: #fff;
  padding: 10px;
  border: 1px solid #ffd60a;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.sidebar li:hover {
  background: #ffd60a;
  color: #000;
}

.sidebar .dropdown-toggle {
  background: #ffd60a;
  color: #000;
  font-weight: bold;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 10px;
  width: 100%;
  text-align: left;
}

.sidebar .dropdown-content {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-top: 5px;
}

.sidebar .dropdown.open .dropdown-content {
  display: flex;
}

.sidebar a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}
.filter-dropdown {
  list-style: none;
  padding-left: 0;
  margin-top: 5px;
  border: 1px solid gold;
  border-radius: 5px;
  background: #0d1b2a;
  display: none; /* Ẩn mặc định */
}

.filter-dropdown.open {
  display: block; /* Hiển thị khi được nhấp vào */
}

.filter-title {
  background: #1e2a38;
  color: gold;
  padding: 10px;
  border: 1px solid gold;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.filter-group {
  margin-bottom: 15px; /* Thêm khoảng cách giữa các nhóm lọc */
}
.filter-group {
  margin-bottom: 15px;
}

.filter-title {
  background: #1e2a38;
  color: gold;
  padding: 10px;
  border: 1px solid gold;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  display: flex; /* Để căn chỉnh biểu tượng mũi tên */
  justify-content: space-between; /* Đẩy tiêu đề và mũi tên ra hai đầu */
  align-items: center; /* Căn chỉnh dọc các phần tử */
}

.filter-dropdown {
  list-style: none;
  padding-left: 0;
  margin-top: 5px;
  border: 1px solid gold;
  border-radius: 5px;
  background: #0d1b2a;
  display: none; /* Ẩn mặc định */
}

.filter-dropdown.open {
  display: block; /* Hiển thị khi được nhấp vào */
}

.filter-dropdown li {
  padding: 8px 10px;
}

.filter-dropdown li a {
  color: #fff;
  text-decoration: none;
}

.dropdown-arrow {
  color: gold;
  font-size: 0.8em;
}
/* ==== JS Toggle Dropdown ==== */
.sidebar .dropdown-toggle::after {
  content: "â–¼";
  float: right;
  margin-left: 10px;
}

/* ==== Responsive Fixes ==== */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: center;
  }

  .container {
    padding: 10px;
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    padding: 0;
    position: relative;
    top: auto;
    z-index: 2;
  }

  .popup-fixed {
    position: relative !important;
    top: auto;
    left: auto;
    max-width: 100%;
    z-index: 1;
  }

  .popup-fixed input[type="text"][name="ngay_sinh"],
  .popup-fixed select {
    width: 100%;
    box-sizing: border-box;
    max-width: none;
    padding: 8px;
    margin-bottom: 8px;
  }

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

  form.filter-form {
    flex-direction: column;
    align-items: center;
  }

  form.filter-form input,
  form.filter-form select,
  form.filter-form button {
    width: 90% !important;
    max-width: 100% !important;
  }
}

/* ==== Safari Fixes ==== */
input, select, button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-size: 16px;
  line-height: 1.4;
}

/* ==== Fix popup vÃ  thanh filter bá»‹ trÃ n trÃªn mobile ==== */
@media (max-width: 480px) {
  .popup-fixed {
    width: 100%;
    margin: 0 auto 20px auto;
  }

  form.filter-form input,
  form.filter-form select,
  form.filter-form button {
    font-size: 16px;
    width: 100%;
  }

  nav ul {
    flex-direction: column;
    padding: 5px 0;
  }
}

/* ==== Fix Safari tá»± nháº­n diá»‡n sá»‘ Ä‘iá»‡n thoáº¡i ==== */
a[href^="tel"] {
  color: gold !important;
  text-decoration: none !important;
}

/* ==== Fix sidebar box background white ==== */
.sidebar li,
.sidebar .dropdown-toggle {
  background-color: #1e2a38 !important;
  color: #fff !important;
  border: 1px solid #ffd60a !important;
}

.sidebar li:hover,
.sidebar .dropdown-toggle:hover {
  background: #ffd60a !important;
  color: #000 !important;
}

/* ==== New Sticky Dropdowns for AreaCode and State ==== */
.sidebar .dropdown-section {
  position: sticky;
  top: 0;
  background: #1e2a38;
  padding-top: 10px;
  z-index: 10;
}

.sidebar .dropdown .dropdown-content div {
  padding: 8px;
  background: #1e2a38;
  border: 1px solid #ffd60a;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.sidebar .dropdown .dropdown-content div:hover {
  background: #ffd60a;
  color: #000;
}
button.add-to-cart {
  background: silver;
  color: #000;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 6px;
  font-weight: 600;
}
/* ==== Style for the "Thêm vào giỏ" button ==== */
.sim-card button[onclick^="addToCart"] {
  background: silver; /* Màu bạc */
  color: #000; /* Chữ đen */
  font-size: 13px; /* Kích thước chữ nhỏ hơn */
  padding: 4px 8px; /* Padding nhỏ hơn */
  border-radius: 6px;
  margin-top: 6px;
  font-weight: 600;
  border: none; /* Loại bỏ viền mặc định */
  cursor: pointer; /* Thêm con trỏ chuột */
}

.sim-card button[onclick^="addToCart"]:hover {
  background: #d3d3d3; /* Màu bạc sáng hơn khi hover */
  
}
