/* =============================================
   NERHOR - ĐÈN SÂN KHẤU HCM
   Products & Order System v1.0
   Product cards, grids, modals, order flow
   ============================================= */

/* ===========================================
   SECTION 1: PRODUCTS SECTION & GRID
   =========================================== */

/* --- Section Wrapper --- */
.products-section {
  padding: var(--space-4xl) 0;
  position: relative;
  overflow: hidden;
}

.products-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* --- Products Grid --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  position: relative;
  z-index: 1;
}

@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 400px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}


/* ===========================================
   SECTION 2: PRODUCT CARD
   =========================================== */

.product-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition:
    transform var(--transition-slow),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 0 25px rgba(var(--accent-rgb), 0.12);
}

/* --- Card Image Container --- */
.product-card-image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-secondary);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--transition-slow);
  will-change: transform;
}

.product-card:hover .product-card-image img {
  transform: scale(1.08);
}

/* --- Card Badge (positioned over image) --- */
.product-card .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Quick view overlay on image hover */
.product-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(7, 7, 13, 0.6) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.product-card:hover .product-card-image::after {
  opacity: 1;
}

/* --- Card Body --- */
.product-card-body {
  padding: var(--space-md) var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-sm);
}

/* --- Card Category Tag --- */
.product-card-category {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* --- Card Title (2-line clamp) --- */
.product-card-title {
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
  min-height: calc(var(--fs-small) * 1.4 * 2);
}

.product-card:hover .product-card-title {
  color: var(--accent);
}

/* --- Card Price --- */
.product-card-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: auto;
}

.product-card-price .current-price {
  font-size: 1.1rem;
  font-weight: var(--fw-bold);
  color: var(--text-price);
  line-height: 1;
}

.product-card-price .original-price {
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-card-price .discount-tag {
  font-size: 0.65rem;
  font-weight: var(--fw-bold);
  color: var(--warning);
  background: rgba(255, 171, 0, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* --- Card Actions --- */
.product-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.product-card-actions .btn-order {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 10px 16px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--bg-primary);
  background: var(--accent);
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.product-card-actions .btn-order:hover {
  box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.35);
  transform: translateY(-1px);
}

.product-card-actions .btn-quick-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.product-card-actions .btn-quick-view:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.05);
}

/* Product card responsive sizing */
@media (max-width: 768px) {
  .product-card-body {
    padding: var(--space-sm) var(--space-sm) var(--space-md);
  }

  .product-card-title {
    font-size: var(--fs-xs);
    min-height: calc(var(--fs-xs) * 1.4 * 2);
  }

  .product-card-price .current-price {
    font-size: var(--fs-small);
  }

  .product-card-actions {
    flex-direction: column;
  }

  .product-card-actions .btn-order,
  .product-card-actions .btn-quick-view {
    width: 100%;
  }
}


/* ===========================================
   SECTION 3: SKELETON LOADING
   =========================================== */

/* --- Base Skeleton --- */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--border-radius-sm);
}

/* --- Skeleton Card (full placeholder) --- */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.skeleton-card .skeleton-image {
  aspect-ratio: 1 / 1;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-card .skeleton-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.skeleton-card .skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-card .skeleton-line:nth-child(1) {
  width: 45%;
  height: 10px;
}

.skeleton-card .skeleton-line:nth-child(2) {
  width: 90%;
}

.skeleton-card .skeleton-line:nth-child(3) {
  width: 70%;
}

.skeleton-card .skeleton-line:nth-child(4) {
  width: 50%;
  height: 18px;
  margin-top: var(--space-xs);
}

.skeleton-card .skeleton-btn {
  height: 38px;
  border-radius: var(--border-radius-sm);
  margin-top: var(--space-xs);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Staggered shimmer timing for skeleton cards */
.skeleton-card:nth-child(2) .skeleton-image,
.skeleton-card:nth-child(2) .skeleton-line,
.skeleton-card:nth-child(2) .skeleton-btn {
  animation-delay: 0.15s;
}
.skeleton-card:nth-child(3) .skeleton-image,
.skeleton-card:nth-child(3) .skeleton-line,
.skeleton-card:nth-child(3) .skeleton-btn {
  animation-delay: 0.3s;
}
.skeleton-card:nth-child(4) .skeleton-image,
.skeleton-card:nth-child(4) .skeleton-line,
.skeleton-card:nth-child(4) .skeleton-btn {
  animation-delay: 0.45s;
}


/* ===========================================
   SECTION 4: LOAD MORE
   =========================================== */

.load-more-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) 0 var(--space-md);
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 36px;
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.load-more-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.08),
    transparent
  );
  opacity: 0;
  transition: opacity var(--transition-base);
}

.load-more-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.1);
  transform: translateY(-2px);
}

.load-more-btn:hover::before {
  opacity: 1;
}

.load-more-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Loading spinner inside load-more */
.load-more-btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(var(--accent-rgb), 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rotate-slow 0.8s linear infinite;
  display: none;
}

.load-more-btn.loading .spinner {
  display: block;
}

.load-more-btn.loading .btn-text {
  opacity: 0.5;
}


/* ===========================================
   SECTION 5: QUICK VIEW MODAL
   =========================================== */

.quick-view-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.quick-view-modal.active {
  display: flex;
  animation: fade-in 0.25s ease;
}

.quick-view-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-lg);
  max-width: 1100px; /* Tăng kích thước để chứa mô tả dài */
  width: 100%;
  height: 90vh; /* Bắt buộc cao 90vh để khung lớn nhất có thể */
  overflow: hidden; /* Xóa cuộn tổng thể */
  display: grid;
  grid-template-columns: 4fr 6fr; /* Nhỏ ảnh lại, rộng nội dung ra */
  position: relative;
  animation: scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 769px) {
  .quick-view-info {
    overflow: hidden; /* Giới hạn chiều cao info theo grid cell */
    max-height: 90vh; 
  }
  .quick-view-info .product-desc {
    flex: 1;
    overflow-y: auto;
    padding-right: 12px;
  }
  /* Thanh cuộn riêng cho phần mô tả */
  .quick-view-info .product-desc::-webkit-scrollbar {
    width: 6px;
  }
  .quick-view-info .product-desc::-webkit-scrollbar-track {
    background: transparent;
  }
  .quick-view-info .product-desc::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
  }
  .quick-view-info .product-desc::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
  }
}

/* Custom scrollbar for modal */
.quick-view-content::-webkit-scrollbar {
  width: 6px;
}

.quick-view-content::-webkit-scrollbar-track {
  background: transparent;
}

.quick-view-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.quick-view-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Gallery (left column) --- */
.quick-view-gallery {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md); /* Giảm khoảng trống */
}

.quick-view-gallery img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
}

.quick-view-gallery .badge {
  position: absolute;
  top: 16px;
  left: 16px;
}

/* --- Info (right column) --- */
.quick-view-info {
  padding: 24px; /* Giảm padding thừa */
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.quick-view-info .product-category {
  font-size: var(--fs-xs);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: var(--fw-semibold);
}

.quick-view-info .product-title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

.quick-view-info .product-price-group {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.quick-view-info .current-price {
  font-size: var(--fs-h2);
  font-weight: var(--fw-extrabold);
  color: var(--text-price);
}

.quick-view-info .original-price {
  font-size: var(--fs-body);
  color: var(--text-muted);
  text-decoration: line-through;
}

.quick-view-info .product-desc {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  line-height: var(--lh-normal);
  border-top: 1px solid var(--border-glass);
  padding-top: var(--space-md);
}

.quick-view-info .product-specs {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.quick-view-info .spec-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: var(--fs-small);
}

.quick-view-info .spec-row .spec-label {
  color: var(--text-muted);
}

.quick-view-info .spec-row .spec-value {
  color: var(--text-primary);
  font-weight: var(--fw-medium);
}

.quick-view-info .quick-view-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-md);
}

.quick-view-info .quick-view-actions .btn {
  flex: 1;
}

.quick-view-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: #ff4444; /* Đỏ rực */
  border: 2px solid #ffffff; /* Viền trắng */
  border-radius: 50%;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(255, 68, 68, 0.6);
}

.quick-view-close:hover {
  background: rgba(255, 82, 82, 0.9);
  color: white;
  border-color: rgba(255, 82, 82, 1);
  transform: rotate(90deg) scale(1.1);
}

/* Quick View Responsive (Mobile Bottom Sheet) */
@media (max-width: 768px) {
  .quick-view-modal {
    align-items: flex-end; /* Căn xuống đáy */
    padding: 0; /* Sát mép màn hình */
  }

  .quick-view-content {
    grid-template-columns: 1fr;
    height: 96vh; /* Đẩy khung cao tối đa */
    max-height: 96vh;
    border-radius: 24px 24px 0 0; /* Bo tròn góc trên */
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
  }

  @keyframes slideUpSheet {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .quick-view-gallery {
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
    min-height: auto;
    padding: var(--space-md) var(--space-sm) var(--space-xs); /* Padding trên nhiều hơn xíu để tránh chạm nút đóng */
  }

  .quick-view-close {
    top: -18px; /* Đẩy nút đóng lồi hẳn lên mép trên */
    right: 16px;
    background: #ff4444;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(255, 68, 68, 0.6);
    border: 2px solid #ffffff;
  }

  .quick-view-gallery img {
    max-height: 100%;
    object-fit: cover;
  }

  .quick-view-info {
    padding: var(--space-md);
    flex: 1;
    overflow-y: auto; /* Cho phép cuộn nội dung nếu quá dài */
    padding-bottom: 90px; /* Nhường chỗ cho thanh action bar dính đáy */
  }

  .quick-view-info .product-title {
    font-size: var(--fs-h3);
  }

  /* Ghim nút mua hàng xuống đáy màn hình điện thoại */
  .quick-view-info .quick-view-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-glass);
    padding: var(--space-md);
    margin: 0;
    display: flex;
    flex-direction: row; /* Để 2 nút nằm ngang */
    gap: var(--space-sm);
    z-index: 20;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
  }

  .quick-view-info .quick-view-actions .btn {
    padding: 12px 10px;
    font-size: 14px;
  }
  
  .quick-view-info .quick-view-actions .btn-buy-now {
    flex: 1.5; /* Nút Mua ngay to hơn chút */
    background: linear-gradient(135deg, #ff0f7b, #f89b29);
    border: none;
  }

  .quick-view-close {
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    border: none;
    z-index: 30;
  }
}



/* ===========================================
   SECTION 6: ORDER FORM MODAL
   =========================================== */

/* --- Full Screen Modal Overlay --- */
.order-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 2500;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-lg);
  overflow-y: auto;
}

.order-modal.active {
  display: flex;
  animation: fade-in 0.2s ease;
}

/* --- Order Form Container --- */
.order-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-lg);
  max-width: 680px;
  width: 100%;
  margin: var(--space-xl) auto;
  padding: var(--space-2xl);
  position: relative;
  animation: scale-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.order-form-header {
  text-align: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-glass);
}

.order-form-header h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-xs);
}

.order-form-header p {
  color: var(--text-secondary);
  font-size: var(--fs-small);
}

/* Order form close */
.order-form-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.order-form-close:hover {
  background: rgba(255, 82, 82, 0.2);
  color: var(--danger);
  border-color: rgba(255, 82, 82, 0.3);
}

/* --- Form Steps / Sections --- */
.order-step {
  margin-bottom: var(--space-xl);
}

.order-step-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.order-step-label .step-number {
  width: 28px;
  height: 28px;
  background: var(--accent-dim);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--accent);
  flex-shrink: 0;
}

/* Form row layout */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}


/* ===========================================
   SECTION 7: PAYMENT METHODS
   =========================================== */

.payment-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-sm);
}

.payment-method-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.payment-method-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(var(--accent-rgb), 0.2);
}

.payment-method-card.selected {
  background: rgba(var(--accent-rgb), 0.06);
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow:
    0 0 15px rgba(var(--accent-rgb), 0.12),
    inset 0 0 15px rgba(var(--accent-rgb), 0.04);
}

.payment-method-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.payment-method-card .payment-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--accent-rgb), 0.08);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-base);
}

.payment-method-card.selected .payment-icon {
  background: rgba(var(--accent-rgb), 0.15);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.2);
}

.payment-method-card .payment-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.payment-method-card.selected .payment-label {
  color: var(--accent);
  font-weight: var(--fw-semibold);
}

/* Check indicator for selected */
.payment-method-card .check-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-glass);
  background: transparent;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-method-card.selected .check-indicator {
  background: var(--accent);
  border-color: var(--accent);
}

.payment-method-card.selected .check-indicator::after {
  content: '✓';
  font-size: 10px;
  color: var(--bg-primary);
  font-weight: var(--fw-bold);
}


/* ===========================================
   SECTION 8: QR CODE
   =========================================== */

.qr-code-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(var(--accent-rgb), 0.2);
  border-radius: var(--border-radius);
  margin-top: var(--space-md);
}

.qr-code-wrapper img {
  max-width: 220px;
  border-radius: var(--border-radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-sm);
  background: #fff;
}

.qr-code-wrapper .qr-label {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  text-align: center;
}

.qr-code-wrapper .qr-amount {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  color: var(--accent);
}

.qr-code-wrapper .qr-note {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-align: center;
  max-width: 300px;
}


/* ===========================================
   SECTION 9: ORDER SUMMARY
   =========================================== */

.order-summary {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.order-summary-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-glass);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.order-summary-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  align-items: center;
  font-size: var(--fs-small);
  transition: background var(--transition-fast);
}

.order-summary-item:last-child {
  border-bottom: none;
}

.order-summary-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.order-summary-item .item-name {
  color: var(--text-primary);
  font-weight: var(--fw-medium);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.order-summary-item .item-name img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  flex-shrink: 0;
}

.order-summary-item .item-qty {
  color: var(--text-secondary);
  text-align: center;
}

.order-summary-item .item-price {
  color: var(--text-secondary);
  text-align: right;
}

.order-summary-item .item-total {
  color: var(--text-price);
  font-weight: var(--fw-semibold);
  text-align: right;
}

/* Remove item button */
.order-summary-item .item-remove {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
  margin-left: var(--space-xs);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.order-summary-item .item-remove:hover {
  color: var(--danger);
  background: rgba(255, 82, 82, 0.12);
}

/* Summary totals */
.order-summary-totals {
  padding: var(--space-md);
  border-top: 1px solid var(--border-glass);
  background: rgba(var(--accent-rgb), 0.02);
}

.order-summary-totals .total-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xs) 0;
  font-size: var(--fs-small);
}

.order-summary-totals .total-row .total-label {
  color: var(--text-secondary);
}

.order-summary-totals .total-row .total-value {
  color: var(--text-primary);
  font-weight: var(--fw-medium);
}

.order-summary-totals .total-row.grand-total {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-glass);
}

.order-summary-totals .total-row.grand-total .total-label {
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.order-summary-totals .total-row.grand-total .total-value {
  font-size: 1.25rem;
  font-weight: var(--fw-extrabold);
  color: var(--text-price);
}

/* Order summary responsive */
@media (max-width: 600px) {
  .order-summary-header {
    display: none;
  }

  .order-summary-item {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
    padding: var(--space-md);
  }

  .order-summary-item .item-name {
    font-size: var(--fs-small);
  }

  .order-summary-item .item-qty,
  .order-summary-item .item-price {
    text-align: left;
    font-size: var(--fs-xs);
  }

  .order-summary-item .item-qty::before {
    content: 'SL: ';
    color: var(--text-muted);
  }

  .order-summary-item .item-price::before {
    content: 'Đơn giá: ';
    color: var(--text-muted);
  }

  .order-summary-item .item-total {
    text-align: left;
    font-size: var(--fs-body);
  }

  .order-summary-item .item-total::before {
    content: 'Tổng: ';
    color: var(--text-muted);
    font-weight: var(--fw-regular);
  }
}


/* ===========================================
   SECTION 10: ORDER SUCCESS
   =========================================== */

.order-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  animation: fade-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Checkmark circle */
.order-success .success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0, 230, 118, 0.1);
  border: 2px solid rgba(0, 230, 118, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  animation: scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.order-success .success-icon svg {
  width: 40px;
  height: 40px;
  stroke: var(--success);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  animation: checkmark-draw 0.6s ease-out 0.3s forwards;
}

.order-success .success-icon .checkmark-emoji {
  font-size: 2rem;
  animation: scale-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.order-success h3 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  color: var(--success);
  margin-bottom: var(--space-sm);
}

.order-success p {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  max-width: 400px;
  margin-bottom: var(--space-lg);
  line-height: var(--lh-normal);
}

.order-success .order-id {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--space-xl);
  font-family: monospace;
  letter-spacing: 1px;
}

.order-success .success-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Confetti burst (purely CSS) --- */
.order-success::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--success);
  border-radius: 50%;
  box-shadow:
    -30px -40px 0 var(--accent),
    30px -50px 0 var(--warning),
    -50px -20px 0 var(--success),
    50px -30px 0 var(--danger),
    -20px -60px 0 var(--info),
    40px -15px 0 var(--accent),
    -60px -45px 0 var(--warning),
    60px -55px 0 var(--success),
    0 -70px 0 var(--danger),
    -40px -10px 0 var(--info);
  opacity: 0;
  animation: fade-in 0.3s ease 0.6s forwards;
  pointer-events: none;
}


/* ===========================================
   SECTION 11: FORM ENHANCEMENTS (for order)
   =========================================== */

/* Submit button full width */
.order-form .btn-submit {
  width: 100%;
  padding: 16px;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  border-radius: var(--border-radius-sm);
  position: relative;
  overflow: hidden;
}

.order-form .btn-submit::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.order-form .btn-submit:hover::after {
  transform: translateX(100%);
}

/* Terms / note text */
.order-form .form-note {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-md);
  line-height: 1.5;
}

.order-form .form-note a {
  color: var(--accent);
  text-decoration: underline;
}

/* Order form responsive */
@media (max-width: 600px) {
  .order-form {
    padding: var(--space-lg);
    margin: var(--space-md) auto;
    border-radius: var(--border-radius);
  }

  .order-form-header h2 {
    font-size: var(--fs-h3);
  }

  .payment-methods {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .payment-methods {
    grid-template-columns: 1fr;
  }
}


/* ===========================================
   SECTION 12: PRODUCT EMPTY / NO RESULTS
   =========================================== */

.products-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl) var(--space-xl);
  text-align: center;
}

.products-empty .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  opacity: 0.4;
}

.products-empty h3 {
  font-size: var(--fs-h3);
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.products-empty p {
  font-size: var(--fs-small);
  color: var(--text-muted);
  max-width: 400px;
}


/* ===========================================
   SECTION 13: PRODUCT FILTER BAR
   =========================================== */

.product-filters {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-glass);
}

.filter-btn {
  padding: 8px 18px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.05);
}

.filter-btn.active {
  color: var(--bg-primary);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.25);
}

.filter-count {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-left: auto;
}

@media (max-width: 768px) {
  .product-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-sm);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .product-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-count {
    display: none;
  }
}
