/* Guide NFC Page Styles - Matching React App Design */
:root {
  --guide-nfc-primary: #183756;
  --guide-nfc-primary-rgb: 24, 55, 86;
  --guide-nfc-success: #28a745;
  --guide-nfc-danger: #dc3545;
  --guide-nfc-section-bg: #f4f6f8;
  --guide-nfc-border: rgba(0, 0, 0, 0.15);
  --guide-nfc-border-light: rgba(0, 0, 0, 0.1);
  --guide-nfc-text: #111827;
  --guide-nfc-text-light: #6b7280;
  --guide-nfc-gray-50: #f9fafb;
  --guide-nfc-gray-100: #f3f4f6;
  --guide-nfc-gray-400: #9ca3af;
}

/* Integrate with standards page layout */
.ega-store-locator .container.ega-section {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
  line-height: 1.6;
  color: var(--guide-nfc-text);
  background-color: var(--guide-nfc-section-bg);
  min-height: 100vh;
  padding: 1rem 0;
}

.ega-store-locator .title_page {
  font-size: 2.5rem;
  color: var(--guide-nfc-primary);
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Introduction section */
.guide-nfc-intro {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  text-align: center;
  color: #000;
  background-color: var(--guide-nfc-section-bg);
  padding: 1.5rem;
  border-radius: 0.5rem;
}

.guide-nfc-intro p {
  margin: 0;
}

.welcome-message {
  font-size: 1rem;
  color: var(--guide-nfc-primary);
  margin-top: 15px;
  font-weight: 500;
  text-align: center;
}

/* Search Form Section - Matching React App Style */
.guide-nfc-search-section {
  background: white;
  border-radius: 0.5rem;
  border: 0.5px solid var(--guide-nfc-border);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.guide-nfc-search-form {
  width: 100%;
}

.search-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--guide-nfc-text);
}

.search-input-wrapper {
  display: flex;
  gap: 0.75rem;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--guide-nfc-border);
  border-radius: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}

.search-input:focus {
  outline: none;
  border-color: var(--guide-nfc-primary);
  box-shadow: 0 0 0 3px rgba(var(--guide-nfc-primary-rgb), 0.1);
}

.search-button {
  padding: 0.75rem 1.5rem;
  background: var(--guide-nfc-primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.search-button:hover {
  background: #0f2537;
}

.search-button:active {
  transform: scale(0.98);
}

/* Results Section */
.guide-nfc-results {
  margin-bottom: 3rem;
  max-width: 100%;
}

.section-title {
  font-size: 1.25rem;
  color: var(--guide-nfc-text);
  margin-bottom: 1rem;
  font-weight: 600;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--guide-nfc-border-light);
}

/* Products Section - Matching my-orders style */
.guide-nfc-products-section {
  margin-bottom: 3rem;
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 100%;
}

.product-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: white;
  border-radius: 0.5rem;
  border: 0.5px solid var(--guide-nfc-border);
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  padding: 1rem;
}

.product-image-small {
  flex-shrink: 0;
  width: 4rem;
  height: 4rem;
  min-width: 4rem;
  background: var(--guide-nfc-gray-100);
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-small .product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-placeholder {
  color: var(--guide-nfc-gray-400);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.5rem;
}

.product-list-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--guide-nfc-text);
  margin: 0 0 0.25rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-list-info p {
  margin: 0.25rem 0;
  font-size: 0.75rem;
  color: var(--guide-nfc-text-light);
  line-height: 1.4;
}

.product-list-info strong {
  color: var(--guide-nfc-text);
  font-weight: 600;
}

.product-eligibility {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
  text-align: center;
  font-size: 0.75rem;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 0.25rem;
}

.product-eligibility.eligible {
  background: #d1fae5;
  color: #065f46;
}

.product-eligibility.not-eligible {
  background: var(--guide-nfc-gray-100);
  color: #4b5563;
}

/* Voucher Section - Matching vouchers.tsx style */
.guide-nfc-vouchers-section {
  margin-bottom: 3rem;
}

.vouchers-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
}

.voucher-gift-card {
  position: relative;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  padding: 1.25rem;
}

/* Phần lõm 2 bên như voucher thật */
.voucher-gift-card::before,
.voucher-gift-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  background: var(--guide-nfc-section-bg);
  border-radius: 50%;
  z-index: 10;
  margin-left: -0.75rem;
}

.voucher-gift-card::after {
  left: auto;
  right: 0;
  margin-left: 0;
  margin-right: -0.75rem;
}

.voucher-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.voucher-expired-badge {
  padding: 0.25rem 0.5rem;
  background: #fee2e2;
  color: #dc2626;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.25rem;
}

.voucher-code-container {
  margin-bottom: 1rem;
}

.voucher-code-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 2px dashed rgba(var(--guide-nfc-primary-rgb), 0.3);
  border-radius: 0.5rem;
  background: rgba(var(--guide-nfc-primary-rgb), 0.05);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.voucher-code-box:hover {
  background: rgba(var(--guide-nfc-primary-rgb), 0.1);
  border-color: rgba(var(--guide-nfc-primary-rgb), 0.5);
}

.voucher-code-box.expired {
  border-color: #d1d5db;
  background: var(--guide-nfc-gray-50);
  cursor: default;
}

.voucher-code-box.expired:hover {
  background: var(--guide-nfc-gray-50);
  border-color: #d1d5db;
}

.voucher-code-label {
  font-size: 0.75rem;
  color: var(--guide-nfc-text-light);
  margin: 0 0 0.25rem 0;
}

.voucher-code-value {
  font-size: 1.125rem;
  font-weight: 700;
  font-family: monospace;
  color: var(--guide-nfc-primary);
  letter-spacing: 0.05em;
}

.voucher-code-box.expired .voucher-code-value {
  color: var(--guide-nfc-gray-400);
}

.copy-button-icon {
  flex-shrink: 0;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: rgba(var(--guide-nfc-primary-rgb), 0.1);
  color: var(--guide-nfc-primary);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
}

.copy-button-icon:hover {
  background: rgba(var(--guide-nfc-primary-rgb), 0.15);
}

.copy-button-icon:active {
  transform: scale(0.95);
}

.voucher-code-box.expired .copy-button-icon {
  display: none;
}

.voucher-content {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--guide-nfc-primary);
}

.voucher-code-box.expired + .voucher-content {
  color: var(--guide-nfc-gray-400);
}

.voucher-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--guide-nfc-gray-100);
  margin-top: 1rem;
}

.voucher-expiry-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--guide-nfc-text-light);
}

.voucher-expiry-icon {
  width: 1rem;
  height: 1rem;
  color: var(--guide-nfc-text-light);
}

.use-now-button {
  padding: 0.5rem 1rem;
  background: var(--guide-nfc-primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.use-now-button:hover {
  background: #0f2537;
}

.use-now-button:active {
  transform: scale(0.98);
}

.voucher-gift-card.expired .use-now-button {
  display: none;
}

/* Guide Section */
.guide-nfc-guide-section {
  background: white;
  border-radius: 0.5rem;
  padding: 2.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  margin-top: 2rem;
}

.guide-description {
  font-size: 1rem;
  color: var(--guide-nfc-text-light);
  text-align: center;
  margin: 15px 0 30px 0;
  font-style: italic;
}

.guide-images-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.875rem;
  margin-top: 1.875rem;
}

.guide-image-wrapper {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.guide-image-wrapper:hover {
  transform: scale(1.02);
}

.guide-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Loading State */
.guide-nfc-loading {
  text-align: center;
  padding: 3.75rem 1.25rem;
}

.loading-spinner {
  width: 4rem;
  height: 4rem;
  border: 4px solid var(--guide-nfc-gray-100);
  border-top-color: var(--guide-nfc-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.25rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.guide-nfc-loading p {
  font-size: 1rem;
  color: var(--guide-nfc-text-light);
  font-weight: 500;
}

/* Error State */
.guide-nfc-error {
  background: #fee2e2;
  border: 2px solid var(--guide-nfc-danger);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.guide-nfc-error p {
  color: #991b1b;
  font-size: 1rem;
  margin: 0;
}

/* No Data Message */
.no-data {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--guide-nfc-text-light);
  font-size: 1rem;
  background: var(--guide-nfc-gray-50);
  border-radius: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .ega-store-locator .container.ega-section {
    padding: 0.5rem;
  }

  .ega-store-locator .title_page {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }

  .guide-nfc-intro {
    padding: 1.25rem;
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .guide-nfc-search-section {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .section-title {
    font-size: 1.125rem;
  }

  .search-input-wrapper {
    flex-direction: column;
  }

  .search-button {
    width: 100%;
  }

  .product-list-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .product-image-small {
    width: 3.5rem;
    height: 3.5rem;
    min-width: 3.5rem;
  }

  .product-name {
    font-size: 0.8125rem;
  }

  .product-list-info p {
    font-size: 0.6875rem;
  }

  .voucher-gift-card {
    padding: 1rem;
  }

  .guide-nfc-guide-section {
    padding: 1.25rem;
  }

  .guide-images-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .ega-store-locator .title_page {
    font-size: 1.5rem;
  }

  .guide-nfc-search-section {
    padding: 0.75rem;
  }

  .product-image-small {
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
  }

  .product-list-item {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .voucher-gift-card {
    padding: 0.875rem;
  }

  .voucher-code-box {
    padding: 0.75rem;
  }

  .voucher-code-value {
    font-size: 1rem;
  }

  .guide-nfc-guide-section {
    padding: 1rem;
  }
}

/* Desktop optimizations */
@media (min-width: 769px) {
  .guide-nfc-results {
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
  }

  .vouchers-list {
    max-width: 448px;
    margin-left: auto;
    margin-right: auto;
  }
}