
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  /* Định nghĩa màu sắc thương hiệu */
  :root {
    --blue-cdv-dark: #004b93;    
    --blue-cdv-medium: #0056b3;  
    --blue-cdv-light: #007bff;   
    --gold-cdv: #ffc107;         
    --gold-cdv-hover: #ffb300;   
    --gris-claro: #f8f9fa;
    --gris-medio: #e9ecef;
    --texto: #212529;
    --red-discount: #dc3545;     
  }

  /* CHỮ RESPONSIVE TOÀN CỤC: Tránh rớt chữ, tràn lề trên Mobile */
  html {
    font-size: 100%; /* Chuẩn 16px */
  }

  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #fff;
    color: var(--texto);
    line-height: 1.5;
    font-size: clamp(0.85rem, 2vw, 1rem); /* Tự động thu nhỏ chữ phù hợp mobile */
    overflow-x: hidden;
  }

  .container {
    width: 100%;
    max-width: 1200px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 15px;
    padding-left: 15px;
  }

/* HEADER */
  .header {
    background: linear-gradient(135deg, var(--blue-cdv-dark) 0%, var(--blue-cdv-medium) 100%);
    color: white;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* Khóa không cho các phần tử rớt dòng */
    gap: 10px;
  }

  .logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0; /* Giúp nội dung chữ bên trong có thể co giãn */
  }

  .logo {
    height: 50px;
    width: auto;
    background: white;
    padding: 3px;
    border-radius: 8px;
    flex-shrink: 0; /* Giữ nguyên kích thước logo không bị bóp méo */
  }

  .empresa-info {
    min-width: 0; /* Hỗ trợ xử lý text tràn */
  }

  .empresa-info h4 {
    font-size: 14px;
    margin-bottom: 0;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    white-space: normal; /* Cho phép tự động xuống dòng nếu màn hình quá nhỏ */
    line-height: 1.2;
  }

  .cart-btn {
    background: var(--gold-cdv);
    color: #111;
    border: none;
    padding: clamp(6px, 1.5vw, 10px) clamp(12px, 2vw, 20px);
    border-radius: 25px;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
  }

  .cart-btn:hover {
    background: var(--gold-cdv-hover);
    transform: translateY(-1px);
  }

  .cart-badge {
    background: var(--blue-cdv-dark);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    min-width: 20px;
  }

  /* BANNER CHÀO MỪNG - Đã thu nhỏ tối đa diện tích chiếm dụng */
  .banner {
    background: linear-gradient(135deg, var(--blue-cdv-light) 0%, var(--blue-cdv-medium) 100%);
    color: white;
    padding: 12px 15px !important; /* Siêu mỏng để tập trung xem sản phẩm */
    text-align: center;
  }

  .banner-content h2 {
    font-size: clamp(1.05rem, 4.5vw, 1.4rem) !important; /* Chữ tiêu đề vừa phải, không lấn lướt */
    margin-bottom: 2px;
    font-weight: 700;
  }

  .banner-content p {
    font-size: clamp(0.8rem, 2.8vw, 0.95rem) !important;
    opacity: 0.9;
    margin-bottom: 0;
  }

  /* BỘ LỌC DANH MỤC */
  .filters-section {
    background: white;
    padding: 15px 0;
    border-bottom: 1px solid var(--gris-medio);
  }

  .filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
  }

  .filter-btn {
    background: white;
    border: 1px solid var(--blue-cdv-light);
    color: var(--blue-cdv-dark);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
  }

  .filter-btn:hover, .filter-btn.active {
    background: var(--blue-cdv-light);
    color: white;
  }

  .search-box {
    max-width: 450px;
    margin: 0 auto;
    padding: 0 10px;
  }

  .search-box input {
    width: 100%;
    padding: 8px 16px;
    border: 1px solid var(--gris-medio);
    border-radius: 20px;
    font-size: 14px;
  }

  /* SẢN PHẨM GRID */
  .productos-section {
    padding: 20px 0;
  }

  .producto-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    margin-bottom: 20px;
    border: 1px solid #eee;
    transition: transform 0.2s;
  }

  .producto-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  }

  .producto-imagen {
    width: 100%;
    height: clamp(130px, 35vw, 200px); /* Tự co giãn chiều cao ảnh */
    object-fit: cover;
    background: var(--gris-claro);
  }

  .badge-discount {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--red-discount);
    color: white;
    padding: 3px 8px;
    font-weight: bold;
    border-radius: 10px;
    font-size: 11px;
    z-index: 10;
  }

  .producto-info {
    padding: 12px;
  }

  .producto-categoria {
    display: inline-block;
    background: #e1f5fe;
    color: #0288d1;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 600;
    margin-bottom: 6px;
  }

  .producto-nombre {
    font-size: clamp(0.8rem, 2.5vw, 0.85rem);
    font-weight: 550;
    color: var(--blue-cdv-dark);
    margin-bottom: 5px;
    line-height: 1.3;
    height: 2.6em; /* Cố định 2 dòng để thẳng hàng card */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .producto-descripcion {
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .producto-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
  }

  .producto-unidad {
    font-size: 11px;
    color: #666;
  }

  .btn-agregar {
    background: var(--blue-cdv-light);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }

  .btn-agregar:hover {
    background: var(--blue-cdv-medium);
  }

  .stock-info {
    font-size: 11px;
    color: #888;
  }

  /* 3 MỨC GIÁ SẢN PHẨM */
.product-prices-container {
  margin: 8px 0;
  padding: 8px;
  background-color: #f9f9f9;
  border-radius: 6px;
  border: 1px dashed #e5e5e5;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.price-row:last-child {
  margin-bottom: 0;
}

/* --- ĐIỀU CHỈNH FONT SIZE CHO MOBILE (Mặc định) --- */
.price-row .price-label {
  font-size: 11px; /* Tăng nhẹ từ 9px lên 11px cho dễ đọc trên điện thoại */
  color: #666;
}

.price-ban .price-value {
  color: #555;
  text-decoration: line-through;
  font-size: 12px;
}

.price-cnms .price-value {
  color: var(--blue-cdv-medium);
  font-weight: 600;
  font-size: 12px;
}

.price-cdv {
  border-top: 1px solid #eaeaea;
  padding-top: 4px;
  margin-top: 4px;
}

.price-cdv .price-label {
  font-weight: bold;
  color: #333;
}

.price-cdv .price-value {
  color: var(--red-discount);
  font-weight: 800;
  font-size: 0.9rem; /* Khoảng 14px trên mobile */
}


/* --- TỰ ĐỘNG PHÓNG TO KHI LÊN PC / MÀN HÌNH LỚN (>= 768px) --- */
@media (min-width: 768px) {
  .product-prices-container {
    padding: 10px; /* Thêm chút không gian thở trên PC */
  }

  .price-row .price-label {
    font-size: 13px; /* Trên PC nhãn giá sẽ to rõ ràng */
  }

  .price-ban .price-value {
    font-size: 14px; /* Giá gốc to hơn */
  }

  .price-cnms .price-value {
    font-size: 14px; /* Giá KM CNMS to hơn */
  }

  .price-cdv .price-value {
    font-size: 1.15rem; /* Giá khuyến mãi CĐV (mức giá quan trọng nhất) nổi bật hẳn lên */
  }
}

  /* SIDEBAR GIỎ HÀNG */
  .carrito-sidebar {
    position: fixed;
    right: -100%;
    top: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 12px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
  }

  .carrito-sidebar.active {
    right: 0;
  }

  .carrito-header {
    background: var(--blue-cdv-dark);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .carrito-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
  }

  .carrito-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
  }

  .btn-cantidad {
    background: var(--blue-cdv-light);
    color: white;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
  }

  .carrito-footer {
    border-top: 1px solid var(--gris-medio);
    padding: 15px;
  }

  .btn-finalizar {
    width: 100%;
    background: var(--gold-cdv);
    color: #111;
    border: none;
    padding: 12px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
  }

  /* MODAL */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 10px;
  }

  .modal.active {
    display: flex;
  }

  .modal-content {
    background: white;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-header {
    background: var(--blue-cdv-dark);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .form-group {
    margin-bottom: 12px;
  }

  .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
  }

  .form-group input, .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gris-medio);
    border-radius: 6px;
  }

  /* OVERLAY (MÀN CHE CHUNG) */
  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }

  .overlay.active {
    display: block;
  }

  /* FOOTER */
  .footer {
    background: var(--blue-cdv-dark);
    color: white;
    padding: 30px 0 15px;
    margin-top: 40px;
    font-size: 13px;
  }

  .footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 20px;
  }
  /* NÚT QUAY LẠI ĐẦU TRANG (BACK TO TOP) */
  .back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 45px;
    height: 45px;
    background-color: var(--blue-cdv-dark);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: none; /* Sẽ hiện ra khi cuộn chuột qua JS */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 998;
    transition: all 0.3s ease;
  }

  .back-to-top:hover {
    background-color: var(--gold-cdv);
    color: #111;
    transform: translateY(-3px);
  }

  /* THỜI GIAN KHUYẾN MÃI TRÊN BANNER (Đã căn chỉnh lại khoảng trống nhỏ hơn) */
  .promo-date {
    font-size: clamp(0.72rem, 2.6vw, 0.9rem) !important;
    font-weight: 600;
    color: var(--gold-cdv);
    background: rgba(0, 0, 0, 0.3);
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    margin-top: 4px !important;
    border: 1px dashed rgba(255, 193, 7, 0.4);
    transition: all 0.3s ease;
  }
  
  /* Class bổ sung khi hết hạn */
  .promo-expired {
    color: #a8ffb2 !important; /* Đổi sang màu xanh lá dịu mắt dễ thương */
    border: 1px dashed rgba(168, 255, 178, 0.4) !important;
  }

  /* NÚT GIỎ HÀNG THU GỌN TRÊN MOBILE */
  .cart-btn-mobile {
    background: var(--gold-cdv);
    color: #111;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  }

  .cart-badge-mobile {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--red-discount);
    color: white;
    border: 1px solid white;
    border-radius: 50%;
    padding: 1px 5px;
    font-size: 10px;
    min-width: 18px;
    font-weight: bold;
    text-align: center;
  }

  /* CẤU HÌNH TỐI ƯU RIÊNG CHO MOBILE */
  @media (max-width: 576px) {
    .logo {
      height: 38px; /* Thu nhỏ logo lại một chút trên điện thoại */
    }
    
    .empresa-info h4 {
      font-size: 11px !important; /* Thu nhỏ chữ tiêu đề xuống 11px */
      line-height: 1.2;
      display: -webkit-box;
      -webkit-line-clamp: 2; /* Giới hạn tối đa 2 dòng, không sợ làm phình header */
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .header-right {
      flex-shrink: 0; /* Đảm bảo cụm nút giỏ hàng luôn giữ nguyên dạng tròn */
    }
  }
