/**
 * NHAN AUDIO - Transparent Header Integration
 * Version: 3.0 - Added Search Page Support
 * Thêm file này nếu website sử dụng transparent header
 * 
 * Note: Cart Panel styles đã được xử lý trong header.twig
 */

/* ============================================
   Transparent Header Support
   ============================================ */

/* Điều chỉnh hero banner cho transparent header */
.page-hero-banner {
  padding-top: 100px; /* Điều chỉnh theo chiều cao header */
  height: 350px; /* Tăng chiều cao để bù cho padding */
}

@media (max-width: 991px) {
  .page-hero-banner {
    padding-top: 80px;
    height: 280px;
  }
}

@media (max-width: 767px) {
  .page-hero-banner {
    padding-top: 70px;
    height: 250px;
  }
}

/* Đảm bảo header hiển thị đúng */
header,
#header,
.header {
  z-index: 1000 !important;
}

/* ============================================
   Header Cart Button Enhancement
   ============================================ */

/* Style cho nút giỏ hàng trên header */
.header-cart-btn,
#cart > button,
.cart-trigger {
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.header-cart-btn:hover,
#cart > button:hover,
.cart-trigger:hover {
  color: #7c3aed;
}

/* Badge số lượng trên icon giỏ hàng - Gradient style */
.cart-badge,
#cart-total .badge,
.header-cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: cartBadgePop 0.3s ease;
}

@keyframes cartBadgePop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ============================================
   Search Page Specific Enhancements
   ============================================ */

/* Search input với icon */
#product-search .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
}

#product-search .has-search-icon #input-search {
  padding-left: 45px;
}

/* Search results animation */
#product-search .product-layout {
  animation: searchFadeIn 0.5s ease forwards;
  animation-delay: calc(var(--item-index, 0) * 0.05s);
}

@keyframes searchFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* No results styling */
#product-search .no-results {
  text-align: center;
  padding: 60px 30px;
  background: #f8f8f8;
  border-radius: 12px;
  margin: 30px 0;
}

#product-search .no-results h3 {
  font-size: 1.5rem;
  color: #1a1a1a;
  margin-bottom: 15px;
}

#product-search .no-results p {
  color: #888;
  margin-bottom: 20px;
}

#product-search .no-results .suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

#product-search .no-results .suggestion-tag {
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

#product-search .no-results .suggestion-tag:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(124, 58, 237, 0.3);
}

/* ============================================
   Smooth Scroll Behavior
   ============================================ */

html {
  scroll-behavior: smooth;
}

/* ============================================
   Enhanced Focus States - Gradient colors
   ============================================ */

a:focus,
button:focus {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .cart-panel-overlay,
  .menu-overlay,
  .search-overlay,
  .page-hero-banner {
    display: none !important;
  }
  
  #product-search #content,
  #checkout-checkout #content,
  #checkout-cart #content {
    margin-top: 0;
    box-shadow: none;
  }
}

/* ============================================
   Reduced Motion Support
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .page-hero-content {
    animation: none;
  }
  
  #product-search .product-layout {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
  /* Uncomment nếu muốn hỗ trợ dark mode */
  /*
  :root {
    --na-light: #1a1a1a;
    --na-secondary: #f0f0f0;
    --na-border: #333;
  }
  
  #product-search .product-thumb {
    background: #2a2a2a;
  }
  
  #product-search .product-thumb .caption h4 a {
    color: #f0f0f0;
  }
  */
}