/* Custom styles for the Shop page */
body.shop-page-layout .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px; /* Consistent padding */
}

body.shop-page-layout .logo-container {
    flex: 1;
    justify-content: flex-start;
}

body.shop-page-layout .main-menu {
    flex: 2;
    justify-content: center;
    gap: 40px; /* Increased gap */
    margin: 0; /* Remove auto margins */
}

body.shop-page-layout .header-right-section {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.shop-hero-section {
  position: relative;
  color: #fff;
  background-color: rgba(5, 10, 22, 0.1); /* Semi-transparent background */
  backdrop-filter: blur(1px);
  border-bottom: 1px solid var(--border-color);
  /* ใช้ padding-top หลบ Header ให้สมบูรณ์แบบที่สุด (70px คือความสูงของ Header) */
  padding-top: 70px;
  padding-bottom: 0; /* เปลี่ยนจาก 3rem เป็น 0 เพื่อให้การจัดกลางแม่นยำ */
  margin-top: 0;
  /* กำหนดความสูงให้ตรงกับขนาดภาพ 1920x400 โดยไม่ต้องใช้ min-height เพราะจะทำให้เกิดปัญหา flex center */
  height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* กันเนื้อหาเกิน */
}

#shop-hero-logo {
    height: 200px; /* Reduced size to be more proportionate */
    max-width: 100%;
    margin-bottom: 1rem;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    animation: logo-float 6s ease-in-out infinite;
    transition: transform 0.3s ease;
    will-change: transform; /* Optimization for browsers */
}

#shop-hero-logo:hover {
    animation-play-state: paused;
    transform: scale(1.05);
}

.shop-hero-background {
  position: absolute;
  /* ดันรูปให้ลงมาพ้น Header (70px) เพื่อไม่ให้สัดส่วนด้านบนถูกขโมยไปทับ Header */
  top: 70px;
  left: 0;
  width: 100%;
  /* ความสูงรูปให้เอา 100% ลบด้วยความสูงของ Header ออก เพื่อให้ไม่เลยกรอบล่าง */
  height: calc(100% - 70px);
  /* เปลี่ยนจาก 100% 100% เป็น cover เหมือนเดิมแต่บังคับ top เพื่อให้สัดส่วนสมบูรณ์ */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 1;
  z-index: -1;
}

.shop-page-title {
  font-family: 'Minecraft Ten', 'Kanit', sans-serif;
  text-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.shop-page-description {
  font-size: 1.5rem; /* Reduced font size */
  background: linear-gradient(to right, #ffffff, #ff7eb3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-weight: bold;
  text-shadow: 0 0 0.01em rgb(0, 60, 255), 0 0 10em rgb(251, 87, 250);
  max-width: 800px;
  margin: 0 auto;
}


.hero-cta.btn-primary {
  background: var(--gradient-main);
  border: none;
  border-radius: 12px;
  padding: 12px 30px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 210, 255, 0.3);
}
.hero-cta.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 35px rgba(255, 126, 179, 0.4);
}

.search-filter-bar {
  background-color: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
}

.search-input-group .input-group-text {
  background-color: #374151; /* Darker gray */
  border-color: #4b5563;
  color: var(--text-muted);
}
.search-input-group .form-control {
  background-color: #1f2937;
  border-color: #4b5563;
  color: var(--text-color);
}
.search-input-group .form-control:focus {
  background-color: #1f2937;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(0, 210, 255, 0.25);
  color: var(--text-color);
}

.custom-select {
  background-color: #1f2937;
  border-color: #4b5563;
  color: var(--text-color);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.custom-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(0, 210, 255, 0.25);
}

.view-swapper-buttons .btn {
  background-color: #374151;
  border-color: #4b5563;
  color: var(--text-muted);
}
.view-swapper-buttons .btn.active {
  background: var(--gradient-main);
  border-color: transparent;
  color: #fff;
}

.shop-product-card {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}
.shop-product-card:hover {
  transform: translateY(-10px) scale(1.01);
  box-shadow: 0 15px 35px rgba(0,0,0,0.6), 0 0 20px rgba(0, 210, 255, 0.15);
  border-color: rgba(255, 126, 179, 0.3);
}

.product-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 3;
}
.product-badges .badge {
  font-size: 0.75rem;
  padding: 4px 8px;
}
.product-badges .badge.new { background-color: var(--primary-color); color: #000; }
.product-badges .badge.sale { background-color: var(--accent-color); color: #fff; }

.product-image-container {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 70%);
}
.product-item-icon {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
  transition: transform 0.3s ease;
}
.shop-product-card:hover .product-item-icon {
  transform: scale(1.2);
}

.product-name {
  font-family: 'Kanit', sans-serif;
  color: var(--text-color);
}
.product-description {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.product-meta {
  border-color: var(--border-color) !important;
}
.product-price {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
}
.btn-buy {
  background: var(--gradient-main);
  border: none;
  color: #fff !important;
  font-weight: bold;
  border-radius: 8px;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.2);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.btn-buy:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 126, 179, 0.3);
}
.btn-buy:active {
    transform: translateY(0) !important;
    filter: brightness(0.9) !important;
}

.btn-login-card {
  background-color: #374151;
  border-color: #4b5563;
  color: var(--text-muted);
}

.empty-state-shop {
  background-color: var(--content-bg);
  border-radius: 12px;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
}
.floating-ghost {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* Responsive Adjustments for Shop Header */
@media (max-width: 767px) {
    .shop-hero-section {
        /* ความสูง Header บนมือถือคือ 60px */
        padding-top: 60px;
        height: 250px;
    }
    .shop-hero-background {
        top: 60px;
        height: calc(100% - 60px);
    }
    #shop-hero-logo {
        height: 100px;
    }
    .shop-page-description {
        font-size: 1.2rem;
        padding: 0 15px;
    }
}