/* ===== RESET & ROOT ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: 'Rajdhani', 'Montserrat', Arial, sans-serif;
  background: linear-gradient(to bottom right, #010326, #577480);
  color: #E0E6ED;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== HEADER - FIX: Thêm margin-bottom để tách banner ===== */
header {
  position: relative;
  background: linear-gradient(135deg, #010326 0%, #0A0F2B 50%, #1A1F2E 100%);
  border-bottom: 2px solid #2E4A6A;
  box-shadow: 0 4px 15px rgba(1, 3, 38, 0.8), 0 0 20px rgba(87, 116, 128, 0.2);
  padding: 1rem 1.5rem;
  overflow: hidden;
  z-index: 1000;
  margin-bottom: 1.5rem; /* FIX: Tách banner, không dính */
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(87, 116, 128, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  gap: 1rem;
}

header .logo {
  height: clamp(45px, 6vw, 65px); /* Tăng nhẹ */
  max-height: 70px;
  width: auto;
  object-fit: contain; /* Giữ tỷ lệ ảnh hoàn hảo */
  position: relative;
  filter: 
    drop-shadow(0 0 8px rgba(212, 175, 55, 0.4)) /* Glow vàng cơ bản */
    drop-shadow(0 0 16px rgba(255, 215, 0, 0.3)) /* Glow vàng nhạt lan tỏa */
    drop-shadow(0 0 24px rgba(255, 69, 0, 0.2)); /* Glow cam nóng */
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
  animation: float 7s ease-in-out infinite, energyBuild 4s ease-in-out infinite; /* FIX: Chữ thường 'float' */
  border-radius: 12px; 
  overflow: hidden;
}

header .logo:hover {
  transform: scale(1.1) translateY(-4px);
}

@keyframes float { /* FIX: Keyframe khớp với animation */
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

header h1 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #B0C4DE, #D4AF37, #E0E6ED);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 6px rgba(212, 175, 55, 0.3);
  animation: softShimmer 5s ease-in-out infinite;
  white-space: nowrap;
  margin: 0;
}

@keyframes softShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

header nav {
  display: flex;
  gap: clamp(0.8rem, 1.5vw, 1.2rem);
  flex-wrap: wrap;
  justify-content: center;
}

header nav a {
  color: #B0C4DE;
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(0.85rem, 1.5vw, 0.95rem);
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

header nav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: #D4AF37;
  box-shadow: 0 0 6px #D4AF37;
  transition: width 0.3s ease;
  transform: translateX(-50%);
}

header nav a:hover {
  color: #fff;
  background: rgba(87, 116, 128, 0.2);
}

header nav a:hover::after {
  width: 80%;
}

/* Scanline nhẹ */
header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(1,3,38,.03) 0px, rgba(1,3,38,.03) 1px, transparent 1px, transparent 2px);
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
}

/* ===== BANNER COSMIC ===== */
.banner.cosmic {
  position: relative;
  height: clamp(280px, 50vw, 380px);
  margin: 0 auto 2rem auto; /* FIX: Không dính, căn giữa */
  max-width: 1400px;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid #D4AF37;
  box-shadow: 0 10px 30px rgba(1,3,38,.9);
  z-index: 900;
  clear: both;
  background-color: #010326; /* Fallback nếu ảnh không load */
}

.banner-bg-image {
  position: absolute;
  inset: 0;
  background: url('DanteAwk.jpg') center/cover no-repeat;
  background-color: #0A0F2B; /* FIX: Fallback màu nếu ảnh fail */
  filter: brightness(0.92) contrast(1.08);
  transform: scale(1.03);
  transition: transform 0.6s ease;
  z-index: 1;
}

.banner.cosmic:hover .banner-bg-image {
  transform: scale(1.06);
}

.glow-pulse {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, #FFD70033, transparent 60%);
  opacity: 0;
  animation: pulse 4s ease-in-out infinite;
  z-index: 2;
}

@keyframes pulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.35; }
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, #01032688 100%);
  z-index: 3;
}

.banner-content {
  position: relative;
  z-index: 4;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
  padding: 1rem;
}

.banner-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #B0C4DE, #FFD700, #E0E6ED);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px #FFD70044;
  animation: shimmer 5s ease-in-out infinite;
  margin-bottom: 0.5rem;
}

.banner-subtitle {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: #B0C4DE;
  margin: 0.5rem 0 1rem;
  text-shadow: 0 1px 3px #010326;
}

.banner-btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  background: linear-gradient(45deg, #D4AF37, #FFD700);
  color: #010326;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 50px;
  text-transform: uppercase;
  box-shadow: 0 5px 15px #D4AF3755;
  transition: all .3s ease;
}

.banner-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px #D4AF3788;
}

@keyframes shimmer {
  50% { background-position: 100% 50%; }
}

/* ===== MAIN & PRODUCTS - FIX: Đảm bảo hiển thị sản phẩm ===== */
main {
  padding: 2rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 800;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* FIX: auto-fit để luôn hiển thị, không trống */
  gap: 1.5rem;
  padding: 1rem 0; /* FIX: Padding dọc để không sát main */
  justify-items: center;
  align-items: start; /* FIX: Căn đầu để sản phẩm không lệch */
  min-height: 200px; /* FIX: Tránh collapse nếu không có sản phẩm */
}

.product-list:empty::after { /* FIX: Placeholder nếu không có sản phẩm */
  content: "Chưa có sản phẩm nào... Hãy thêm Sinner plushie!";
  grid-column: 1 / -1;
  text-align: center;
  color: #B0C4DE;
  font-style: italic;
  padding: 2rem;
}

.product {
  background: linear-gradient(to bottom, #010326, #577480);
  border: 2px solid #2E4A6A;
  border-radius: 12px;
  padding: 1.2rem;
  width: 100%;
  max-width: 300px;
  min-width: 220px; /* FIX: Min-width để grid không co quá nhỏ */
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
  opacity: 1; /* FIX: Đảm bảo visible */
  visibility: visible; /* FIX: Không bị ẩn */
}

.product:hover {
  transform: translateY(-8px);
}

.product img {
  width: 100%;
  height: auto;
  min-height: 150px; /* FIX: Ảnh không co dẹt */
  object-fit: cover; /* FIX: Giữ tỷ lệ ảnh đẹp */
  border-radius: 8px;
  margin-bottom: 0.8rem;
}

.product h2, .product h3 {
  font-size: 1.1rem;
  margin: 0.5rem 0;
  color: #E0E6ED;
  line-height: 1.2; /* FIX: Không bị cắt chữ */
}

.product p {
  color: #B0C4DE;
  font-weight: 600;
  margin-bottom: 1rem; /* FIX: Khoảng cách nút */
}

button {
  background: linear-gradient(to right, #D4AF37, #FFD700);
  color: #010326;
  border: none;
  padding: 0.7rem 1.2rem;
  margin-top: 0.8rem;
  font-weight: bold;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(212, 175, 55, 0.4);
}

button:active {
  transform: scale(0.98);
}

/* ===== FORM ===== */
form {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid #D4AF37;
  border-radius: 12px;
  backdrop-filter: blur(5px);
}

form label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #E0E6ED;
}

input, select, textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border: 2px solid #2E4A6A;
  border-radius: 8px;
  background: rgba(1, 3, 38, 0.7);
  color: #E0E6ED;
  font-size: 1rem;
  transition: border 0.3s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: #D4AF37;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
  outline: none;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
@media (max-width: 992px) {
  .header-container {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  header nav {
    justify-content: center;
  }
  .banner.cosmic {
    height: 340px;
    margin: 1rem auto;
  }
  .product-list {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* FIX: Co hơn trên tablet */
  }
}

@media (max-width: 576px) {
  header {
    padding: 0.8rem;
  }
  header .logo {
    height: 40px;
  }
  header h1 {
    font-size: 1.5rem;
  }
  header nav a {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
  .banner.cosmic {
    height: 280px;
  }
  .product-list {
    grid-template-columns: 1fr; /* FIX: 1 cột mobile */
    padding: 0.5rem;
    gap: 1rem;
  }
  .product {
    max-width: 100%;
    min-width: auto; /* FIX: Full width mobile */
  }
  form {
    padding: 1.5rem;
  }
}


/* Product Section - Grid layout like wiki tables/cards */
.product-section {
  margin-bottom: 2rem;
}

.product-section h3 {
  color: #d4af37;
  font-family: 'Orbitron', monospace;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  text-align: center;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.product {
  background-color: #1e1e1e; /* Card bg */
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.2); /* Gold glow on hover */
}

.product img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #555;
}

.product h3 {
  color: #d4af37;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.product p {
  color: #b0b0b0;
  margin: 0.5rem 0;
}

.product a {
  display: inline-block;
  color: #e74c3c; /* Red link like wiki */
  text-decoration: none;
  margin: 0.5rem 0;
  font-weight: 600;
}

.product a:hover {
  text-decoration: underline;
}

.product button {
  background-color: #d4af37;
  color: #1f1f1f;
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
  width: 100%;
}

.product button:hover {
  background-color: #b8932f;
}

/* Pagination for Product Lists - Simple wiki-style nav */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.pagination button,
.pagination span {
  padding: 0.5rem 1rem;
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
}

.pagination button:hover {
  background-color: #d4af37;
  color: #1f1f1f;
}

/* Product Detail Pages - Structured sections like wiki infoboxes */
.product-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  animation: sectionAwaken 0.8s ease-out;
}

.product-image-name {
  text-align: center;
}

.product-image-name img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(1, 3, 38, 0.5);
  transition: transform 0.3s ease;
  object-fit: cover; /* SỬA: Giữ tỷ lệ ảnh tốt hơn, tránh distort */
  will-change: transform; /* SỬA: Optimize hover */
}

.product-image-name img:hover {
  transform: scale(1.05);
}

.product-image-name h2 {
  margin-top: 1rem;
  font-size: 2rem;
  color: #D4AF37;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.product-description h3,
.product-specs h3 {
  color: #E0E6ED;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.product-description p {
  color: #B0C4DE;
  line-height: 1.7;
}

.product-specs ul {
  list-style: none;
  padding: 0;
}

.product-specs li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(87, 116, 128, 0.3);
  color: #B0C4DE;
}

.product-specs button {
  margin-top: 1.5rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #D4AF37, #FF4500);
  color: #010326;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.product-specs button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4); /* SỬA: Thêm shadow cho consistency */
}
/* Responsive Design for Products - Wiki-like adaptability */
@media (max-width: 768px) {
  .product-list {
    grid-template-columns: 1fr;
  }

  .product-detail {
    padding: 1rem;
  }

  .product img {
    height: 150px; /* Smaller images on mobile */
  }
}

/* Additional Wiki-like Touches for Products: Links */
a {
  color: #e74c3c; /* Red links */
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #d4af37; /* Gold on hover */
  text-decoration: underline;
}

/* For product tables if needed (e.g., specs in grid) */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: #2c2c2c;
  margin: 1rem 0;
}

th, td {
  border: 1px solid #555;
  padding: 0.8rem;
  text-align: left;
}

th {
  background-color: #1f1f1f;
  color: #d4af37;
}
/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 1rem;
  background: #010326;
  color: #B0C4DE;
  font-size: 0.9rem;
  width: 100%;
  margin-top: 2rem;
}

/* ===== NEWS SECTION(Dystopian Vibes) ===== */
.news-section {
  position: relative;
  max-width: 900px;
  margin: 3rem auto;
  padding: 2.5rem;
  background: linear-gradient(135deg, rgba(1, 3, 38, 0.9) 0%, rgba(26, 31, 46, 0.8) 100%);
  border: 2px solid #D4AF37;
  border-radius: 16px;
  box-shadow: 
    0 8px 25px rgba(212, 175, 55, 0.3),
    inset 0 0 20px rgba(1, 3, 38, 0.5);
  overflow: hidden;
  animation: sectionAwaken 1.5s ease-out forwards;
  z-index: 1;
}

.news-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(212, 175, 55, 0.02) 2px, rgba(212, 175, 55, 0.02) 4px);
  pointer-events: none;
  z-index: 0;
}

.news-section h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 1.5rem;
  background: linear-gradient(90deg, #E0E6ED, #D4AF37, #FF4500, #D4AF37, #E0E6ED);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 100%;
  text-shadow: 
    0 0 15px rgba(212, 175, 55, 0.6),
    0 0 25px rgba(255, 69, 0, 0.4),
    0 4px 8px rgba(1, 3, 38, 0.9);
  animation: dramaticShimmer 3s ease-in-out infinite, titlePulse 2s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.news-section p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  text-align: center;
  margin-bottom: 2rem;
  color: #B0C4DE;
  text-shadow: 0 2px 4px rgba(1, 3, 38, 0.8);
  line-height: 1.6;
  animation: fadeInUp 1s ease-out 0.5s both;
  position: relative;
  z-index: 2;
}

.news-section ul {
  list-style: none;
  padding: 0;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.news-section li {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(10, 15, 43, 0.6);
  border-left: 3px solid #D4AF37;
  border-radius: 0 8px 8px 0;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  opacity: 0;
  transform: translateX(-30px);
  animation: staggerIn 0.8s ease-out forwards;
  position: relative;
  overflow: hidden;
}

.news-section li:nth-child(1) { animation-delay: 0.8s; }
.news-section li:nth-child(2) { animation-delay: 1s; }
.news-section li:nth-child(3) { animation-delay: 1.2s; }

.news-section li:hover {
  transform: translateX(0) scale(1.02);
  background: rgba(212, 175, 55, 0.1);
  box-shadow: 
    0 5px 15px rgba(212, 175, 55, 0.3),
    inset 0 0 10px rgba(212, 175, 55, 0.1);
  border-left-color: #FF4500;
}

.news-section li::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #D4AF37, #FF4500);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.news-section li:hover::before {
  transform: scaleY(1);
}

.news-section li a {
  color: #E0E6ED;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  display: block;
  transition: color 0.3s ease;
  position: relative;
  z-index: 1;
}

.news-section li a:hover {
  color: #D4AF37;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

/* ===== ANIMATIONS ===== */
@keyframes sectionAwaken {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes dramaticShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 200% 50%; }
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 15px rgba(212, 175, 55, 0.6), 0 0 25px rgba(255, 69, 0, 0.4); }
  50% { text-shadow: 0 0 25px rgba(212, 175, 55, 0.9), 0 0 35px rgba(255, 69, 0, 0.6), 0 0 45px rgba(212, 175, 55, 0.3); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes staggerIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .news-section {
    padding: 1.5rem;
    margin: 2rem auto;
  }
  .news-section h2 {
    font-size: 1.8rem;
    letter-spacing: 1px;
  }
  .news-section li {
    padding: 0.8rem;
    margin-bottom: 1rem;
  }
}