/* ==========================================================================
   Bảng giá vàng — design tokens
   ========================================================================== */
#gold-price {
  --gp-bg: var(--Vivid-white-50, #fdfdfc);
  --gp-border: var(--Color-Neutral-Neutral---200, #e5e5e5);
  --gp-border-brand: var(--Color-Brand-Brand---800, #026d60);
  --gp-surface-muted: #9fc6bb14;
  --gp-surface-brand-soft: var(
    --Color-Brand-Brand---100,
    rgba(195, 255, 242, 0.4)
  );
  --gp-text: var(--Color-Brand-Brand---900, #014d40);
  --gp-text-muted: var(--Color-Neutral-Neutral---500, #737373);
  --gp-text-body: var(--Color-Neutral-Neutral---900, #171717);
  --gp-buy: var(--Color-Brand-Brand---700, #008a77);
  --gp-sale: #f3bd12;
  --gp-radius-panel: 16px;
  --gp-radius-control: 8px;
  --gp-shadow-panel: 0 4px 24px rgba(1, 77, 64, 0.06);
}

#gold-price #section-banner-final.is-empty {
  padding: 0;
  min-height: 0;
  background-image: none !important;
}

#gold-price #section-banner-final:not(.is-empty) {
  width: 100%;
  aspect-ratio: 1440 / 300;
  height: auto;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
  position: relative;
  display: block;
  background-image: none !important;
  box-sizing: border-box;
}

#gold-price .gold-price-banner-item {
  position: absolute;
  inset: 0;
}

#gold-price .gold-price-banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

#gold-price .gold-price-banner-item > h1.default-screen.page-hero-title {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  margin: 0 auto;
  padding: 0 100px;
  box-sizing: border-box;
  text-align: left;
  pointer-events: none;
}

#gold-price .section-price {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: 0;
  background: var(--gp-bg);
  padding-top: 100px;
  padding-bottom: 100px;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
  scroll-margin-top: 80px;
}

#gold-price .section-price .gold-price-page {
  width: 100%;
}

#gold-price .section-price .default-screen {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
}

.gold-price-page {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
}

.gold-price-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.gold-price-layout.is-history-hidden {
  grid-template-columns: 1fr;
}

/* ==========================================================================
   Panel & bảng giá
   ========================================================================== */
.gold-price-panel.is-hidden {
  display: none !important;
}

.gold-price-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: var(--gp-radius-panel);
  border: 1px solid var(--gp-border);
  background: var(--gp-bg);
  overflow: hidden;
  box-shadow: var(--gp-shadow-panel);
}

.gold-price-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.gold-price-panel-head {
  padding: 20px 24px;
  background: #014d40;
}

.gold-price-panel-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: var(--fs-18, 18px);
  font-weight: var(--fw-semibold, 600);
  line-height: 24px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.gold-price-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gold-price-table {
  width: 100%;
  border-collapse: collapse;
}

.gold-price-table thead th {
  padding: 12px 20px;
  text-align: center;
  font-size: var(--fs-14, 14px);
  font-weight: var(--fw-semibold, 600);
  color: var(--gp-text);
  background-color: var(--gp-surface-muted);
  border-bottom: 1px solid var(--gp-border);
  white-space: nowrap;
}

.gold-price-table thead th:first-child {
  text-align: left;
}

.gold-price-table tbody td {
  padding: 12px 20px;
  text-align: center;
  font-size: var(--fs-16, 16px);
  border-bottom: 1px solid var(--gp-border);
  vertical-align: middle;
}

.gold-price-table tbody tr:last-child td {
  border-bottom: none;
}

.gold-price-table tbody td:first-child {
  text-align: left;
  font-weight: var(--fw-semibold, 600);
  color: var(--gp-text);
}

.gold-price-table .gold-price-updated-cell {
  font-size: var(--fs-14, 14px);
  font-weight: var(--fw-normal, 400);
  color: var(--gp-text-muted);
  white-space: nowrap;
}

.gold-price-table th:nth-child(2),
.gold-price-table th:nth-child(3),
.gold-price-table td:nth-child(2),
.gold-price-table td:nth-child(3) {
  width: 24%;
}

.gold-price-table th:nth-child(4),
.gold-price-table td:nth-child(4) {
  width: 28%;
}

.gold-price-buy {
  color: var(--gp-buy);
  font-weight: var(--fw-semibold, 600);
}

.gold-price-sale {
  color: var(--gp-sale);
  font-weight: var(--fw-semibold, 600);
}

.gold-price-empty,
.gold-price-loading {
  padding: 48px 24px;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--gp-text);
  font-size: var(--fs-16, 16px);
}

/* ==========================================================================
   Bộ lọc & lịch sử giá
   ========================================================================== */
.gold-price-filters {
  padding: 16px 24px;
  margin-bottom: 16px;
}

.gold-price-filters-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.gold-price-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.gold-price-field-label {
  font-size: var(--fs-14, 14px);
  font-weight: var(--fw-semibold, 600);
  line-height: 16px;
  letter-spacing: 0.02em;
  color: var(--gp-text);
}

.gold-price-field--type {
  grid-column: 1 / -1;
}

.gold-price-select-wrap {
  position: relative;
  display: block;
}

.gold-price-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 12px;
  height: 12px;
  pointer-events: none;
  transform: translateY(-50%);
  transition: transform 0.2s ease;
}

.gold-price-select-wrap:has(select:focus)::after {
  transform: translateY(-50%) rotate(180deg);
}

.gold-price-select-wrap select {
  width: 100%;
  min-height: 40px;
  padding: 8px 40px 8px 16px;
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-control);
  font-size: var(--fs-14, 14px);
  font-weight: var(--fw-medium, 500);
  line-height: 20px;
  font-family: inherit;
  color: var(--gp-text-body);
  background-color: var(--gp-bg);
  box-shadow: 0 4px 8px rgba(1, 77, 64, 0.04);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.gold-price-select-wrap select:hover:not(:disabled) {
  border-color: var(--gp-border-brand);
  background-color: var(--gp-bg);
}

.gold-price-select-wrap select:focus {
  outline: none;
  border-color: var(--gp-border-brand);
  box-shadow: 0 0 0 4px rgba(2, 109, 96, 0.12);
}

.gold-price-select-wrap select:disabled {
  cursor: not-allowed;
  opacity: 0.64;
  background-color: var(--Color-Neutral-Neutral---100, #f5f5f5);
}

.gold-price-filters-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 4px;
}

.gold-price-filter-btn {
  min-height: 40px;
  padding: 8px 24px;
  border: none;
  border-radius: 100px;
  background: var(--gp-border-brand);
  color: var(--Vivid-white-50, #fdfdfc);
  font-size: var(--fs-14, 14px);
  font-weight: var(--fw-semibold, 600);
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 8px rgba(2, 109, 96, 0.2);
  transition:
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.gold-price-filter-btn:hover {
  background: var(--gp-text);
  box-shadow: 0 4px 12px rgba(2, 109, 96, 0.28);
}

.gold-price-filter-btn:active {
  transform: translateY(4px);
}

.gold-price-filter-btn.is-secondary {
  background: var(--gp-bg);
  color: var(--gp-border-brand);
  border: 1px solid var(--gp-border-brand);
  box-shadow: none;
}

.gold-price-filter-btn.is-secondary:hover {
  background: var(--gp-surface-brand-soft);
  border-color: var(--gp-text);
}

.gold-price-history-list {
  flex: 1;
  min-height: 0;
  border-top: 1px solid var(--gp-border);
  overflow-y: auto;
  padding: 0 0 16px;
}

.gold-price-history-list .gold-price-empty,
.gold-price-history-list .gold-price-loading {
  padding: 48px 20px;
}

.gold-price-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 12px 20px;
  font-size: var(--fs-14, 14px);
  border-bottom: 1px solid var(--gp-border);
  align-items: center;
}

.gold-price-history-row.is-header {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: var(--fs-14, 14px);
  font-weight: var(--fw-semibold, 600);
  color: var(--gp-text);
  background-color: var(--gp-surface-muted);
  border-bottom: 1px solid var(--gp-border);
}

/* ==========================================================================
   CTA & sản phẩm liên quan
   ========================================================================== */
.gold-price-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  text-align: center;
}

.gold-price-cta .product-subscribe-btn {
  display: inline-flex;
  font-size: var(--fs-16, 16px);
  padding: 12px 40px;
  text-decoration: none;
}

#gold-price .gold-price-products-section {
  background: var(--gp-bg);
  padding-bottom: 100px;
}

#gold-price .gold-price-products-intro {
  padding: 0 100px;
}

#gold-price .gold-price-products-intro .home-history-title-container {
  margin-bottom: 0;
}

@media screen and (min-width: 1200px) {
  #gold-price .section-price {
    padding-left: 100px;
    padding-right: 100px;
  }
}

@media screen and (min-width: 1700px) {
  #gold-price .section-price .default-screen,
  #gold-price .gold-price-banner-item > h1.default-screen.page-hero-title {
    width: 75%;
    margin-left: auto;
    margin-right: auto;
  }
}

@media screen and (max-width: 1200px) {
  #gold-price .gold-price-banner-item > h1.default-screen.page-hero-title {
    padding: 0 32px;
  }

  #gold-price .section-price {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  #gold-price .section-price .default-screen {
    padding-left: 32px;
    padding-right: 32px;
  }

  #gold-price .gold-price-products-intro {
    padding: 0 32px;
  }

  #gold-price .gold-price-products-section {
    padding-bottom: 32px;
  }

  .gold-price-layout {
    grid-template-columns: 1fr;
  }

  .gold-price-panel {
    min-height: 0;
  }

  .gold-price-history-list {
    flex: none;
    min-height: 160px;
    max-height: 360px;
  }

  .gold-price-filters {
    padding: 16px 20px;
  }

  .gold-price-history-row {
    padding: 12px 16px;
  }

  .gold-price-filters-actions {
    justify-content: stretch;
  }

  .gold-price-filters-actions .gold-price-filter-btn {
    flex: 1;
    min-width: 0;
  }
}

@media screen and (max-width: 810px) {
  /* Mobile: 16:9 like home BST — taller frame, cover shows more of the asset */
  #gold-price #section-banner-final:not(.is-empty) {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  #gold-price .gold-price-banner-image {
    object-fit: cover;
    object-position: center center;
  }

  #gold-price .gold-price-banner-item > h1.default-screen.page-hero-title {
    padding: 0 16px;
    font-size: 20px;
  }

  #gold-price .section-price {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  #gold-price .section-price .default-screen {
    padding-left: 16px;
    padding-right: 16px;
  }

  #gold-price .gold-price-products-intro {
    padding: 0 16px;
  }

  #gold-price .gold-price-products-section {
    padding-bottom: 24px;
  }

  .gold-price-filters {
    padding: 16px;
  }

  .gold-price-filters-inner {
    grid-template-columns: 1fr 1fr;
  }

  .gold-price-field--type,
  .gold-price-field--year {
    grid-column: 1 / -1;
  }

  .gold-price-panel-head h2 {
    font-size: var(--fs-16, 16px);
    line-height: 24px;
  }

  .gold-price-table thead th,
  .gold-price-table tbody td {
    padding: 12px 16px;
    font-size: var(--fs-14, 14px);
  }

  .gold-price-history-list {
    min-height: 140px;
    max-height: 300px;
  }

  .gold-price-history-row {
    padding: 12px 16px;
  }

  .gold-price-page {
    gap: 32px;
  }

  .gold-price-empty,
  .gold-price-loading {
    min-height: 200px;
  }
}
