/* css/style.css */
:root { --primary-color: #722F37; --secondary-color: #f8f9fa; --text-dark: #2c3e50; --accent-color: #e74c3c; }
body { background-color: #f0f2f5; font-family: 'Segoe UI', Tahoma, sans-serif; padding-top: 110px; }


/* --- Z-INDEX FIX & HEADER --- */
.fixed-header { position: fixed; top: 0; left: 0; width: 100%; z-index: 1050; background: white; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.dropdown-menu { z-index: 1060; max-height: 300px; overflow-y: auto; font-size: 0.9rem; }
#loading { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.95); z-index: 2000; display: flex; justify-content: center; align-items: center; flex-direction: column; }

.main-nav { padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; background-color: var(--primary-color); color: white;}
.main-nav .fw-bold {
  color: white !important;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2); /* Đổ bóng nhẹ cho chữ thêm sang */
}
.nav-actions { display: flex; align-items: center; gap: 15px; }



/* --- EXPANDABLE SEARCH --- */
.search-container { position: relative; display: flex; align-items: center; }
.search-input { width: 0; opacity: 0; border: none; border-bottom: 1px solid rgba(255, 255, 255, 0.5); padding: 5px; background: transparent; color: white; transition: all 0.3s ease; outline: none; font-size: 0.9rem; }
.search-input::placeholder { color: rgba(255, 255, 255, 0.7); }
.search-input.active { width: 200px; opacity: 1; padding-right: 30px; }
@media (max-width: 576px) { .search-input.active { width: 140px; } }
.search-icon-toggle { font-size: 1.2rem; color: white; cursor: pointer; position: absolute; right: 0; z-index: 10; padding: 5px; }

.cart-btn { position: relative; color: white; font-size: 1.4rem; cursor: pointer; }
.cart-badge { position: absolute; top: -5px; right: -8px; background: #f1c40f; color: #333; border-radius: 50%; padding: 2px 6px; font-size: 0.7rem; }

/* --- FILTERS --- */
.filter-bar { padding: 8px 15px; background: white; display: flex; gap: 10px; flex-wrap: wrap;; border-bottom: 1px solid #eee; }
.filter-btn { border-radius: 20px; font-size: 0.9rem; padding: 5px 15px; border: 1px solid #ddd; background: white; color: #555; white-space: nowrap; }
.filter-btn.active { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }

/* --- PRODUCT GRID & CARDS --- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; padding: 15px; }
@media (min-width: 992px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }

.product-card { background: white; border-radius: 12px; border: 1px solid #eee; display: flex; flex-direction: column; height: 100%; overflow: hidden;}
.product-img-wrapper { position: relative; padding-top: 100%; background: #fff; cursor: pointer; }
.product-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; transition: transform 0.2s; }
.product-img:hover { transform: scale(1.05); }

.product-info { padding: 10px; flex-grow: 1; display: flex; flex-direction: column; }
.product-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; color: var(--text-dark); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 42px; }
.product-meta { font-size: 0.8rem; color: #666; margin-bottom: 8px; line-height: 1.5; }

/* [MỚI] STYLE CHO TAG GIỐNG NHO */
.tag-varietal { display: inline-block; background: #e9ecef; color: #495057; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; cursor: pointer; margin-top: 4px; transition: all 0.2s; }
.tag-varietal:hover { background: var(--primary-color); color: white; }

.price-row { display: flex; align-items: center; gap: 10px; margin-top: auto; margin-bottom: 10px; flex-wrap: wrap;}
.price-sell { color: var(--primary-color); font-weight: 800; font-size: 1.1rem; }
.price-original { font-size: 0.85rem; text-decoration: line-through; color: #999; }

/* --- CONTROLS --- */
.add-to-cart-group { display: flex; gap: 5px; }
.qty-input-group { display: flex; align-items: center; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.qty-btn-mini { width: 28px; height: 32px; border: none; background: #f1f1f1; font-weight: bold; color: #555; cursor: pointer;}
.qty-btn-mini:hover { background: #e2e2e2; }
.qty-input-mini { width: 30px; height: 32px; border: none; text-align: center; font-size: 0.9rem; outline: none; background: white; padding: 0; }
.btn-add-final { flex-grow: 1; border: none; background-color: var(--primary-color); color: white; border-radius: 6px; font-weight: 600; font-size: 0.85rem; cursor: pointer;}
.btn-add-final:hover { background-color: #5a232b; }

/* --- UTILS --- */
.cart-item { display: flex; justify-content: space-between; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.cart-summary { background: #f9f9f9; padding: 15px; border-radius: 10px; margin-top: 20px; }

/* --- ACTIVE FILTERS BAR --- */
.active-filters-bar {
  padding: 10px 15px;
  background-color: #f1f3f5;
  border-bottom: 1px solid #ddd;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 40px;
}
.active-filters-bar:empty {
  display: none; /* Ẩn đi nếu không có bộ lọc nào */
}
.active-filter-tag {
  background-color: var(--primary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
}
.active-filter-tag i {
  cursor: pointer;
  opacity: 0.8;
}
.active-filter-tag i:hover {
  opacity: 1;
}
.btn-clear-filters {
  font-size: 0.8rem;
  color: var(--accent-color);
  background: none;
  border: 1px solid var(--accent-color);
  padding: 3px 10px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-clear-filters:hover {
  background: var(--accent-color);
  color: white;
}

/* --- POPUP CHECK YOUR CART --- */
.cart-popup {
    position: absolute;
    top: 45px;
    right: 0;
    background: #f1c40f; /* Nền vàng */
    color: #000; /* Chữ đen */
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 1060;
    transform: translateY(10px);
}
.cart-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* Mũi tên trỏ lên Giỏ hàng */
.cart-popup::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 15px;
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent #f1c40f transparent;
}