/* ================================================
   Vouchers — List, tiles, badges, details, actions
   ================================================ */

/* Vouchers List Page */
.gc-vouchers-list-section {
  max-width: var(--container);
  margin: var(--space-7) auto;
  padding: 0 var(--space-6);
}

.gc-vouchers-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-bottom: var(--space-8);
}

/* --------------------------------------------------
   Voucher Card — List View
   -------------------------------------------------- */

.gc-voucher-wrapper {
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.gc-voucher-wrapper:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  z-index: 1;
}

/* The main card row */
.gc-voucher-item {
  display: flex;
  gap: 0;
  padding: 0;
  position: relative;
  align-items: stretch;
  min-height: unset;
  flex-wrap: wrap;
}

/* ---- Badge Column ---- */
.gc-voucher-badge-col {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--gc-badge-code);
  border-radius: 9px 9px 0 0;
  padding: var(--space-4) var(--space-6);
  min-height: unset;
}

.gc-voucher-badge-col--code {
  background: var(--gc-badge-code);
}

.gc-voucher-badge-col--deal {
  background: var(--gc-primary);
}

.gc-voucher-discount-badge {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  color: var(--gc-white);
  text-align: center;
  border: none;
  background: none;
  border-radius: 0;
  min-width: unset;
  gap: var(--space-3);
}

.gc-discount-value {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  line-height: 1;
  display: block;
  color: var(--gc-white);
}

.gc-discount-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: var(--space-1);
  display: block;
  color: rgba(255, 255, 255, 0.9);
}

/* ---- Logo Column ---- */
.gc-voucher-logo-col {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-6);
}

.gc-voucher-merchant-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: var(--radius);
  flex-shrink: 0;
}

/* ---- Content Area ---- */
.gc-voucher-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-1);
}

.gc-voucher-merchant {
  margin-bottom: 2px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gc-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.gc-voucher-merchant a {
  color: var(--gc-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.gc-voucher-merchant a:hover {
  color: var(--gc-text);
}

.gc-voucher-title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--gc-text);
  line-height: 1.4;
}

.gc-voucher-description {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gc-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Action Area ---- */
.gc-voucher-action {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: 0 var(--space-6) 14px;
  min-width: unset;
  width: 100%;
}

.gc-voucher-action .gc-btn {
  width: 100%;
  text-align: center;
}

.gc-voucher-verified {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--space-5);
  font-weight: var(--font-semibold);
  color: var(--gc-success);
}

.gc-icon-check {
  flex-shrink: 0;
}

.gc-voucher-usage {
  font-size: var(--space-5);
  color: var(--gc-muted);
}

.gc-voucher-usage strong {
  font-weight: var(--font-bold);
  color: var(--gc-text);
}

.gc-voucher-expiry-text {
  font-size: var(--space-5);
  color: var(--gc-muted);
  margin: 0;
}

.gc-expiry-urgent {
  color: var(--gc-danger);
  font-weight: var(--font-semibold);
}

.gc-no-results {
  text-align: center;
  padding: var(--space-10) var(--space-7);
  color: var(--gc-muted);
  font-size: 16px;
}

/* ---- Expandable Voucher Details ---- */
.gc-voucher-details-wrapper {
  border-top: 1px solid var(--gc-border);
}

.gc-voucher-toggle {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  background: var(--gc-surface);
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--gc-muted);
  font-weight: var(--font-semibold);
  transition: all 0.2s ease;
}

.gc-voucher-toggle:hover {
  background: var(--gc-bg-subtle);
  color: var(--gc-text);
}

.gc-toggle-icon {
  transition: transform 0.3s ease;
  font-size: var(--space-5);
}

.gc-voucher-toggle.active .gc-toggle-icon {
  transform: rotate(180deg);
}

.gc-voucher-details {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.gc-voucher-details-content {
  padding: var(--space-6);
  border-top: 1px solid var(--gc-border);
  background: var(--gc-bg-details);
}

.gc-detail-section {
  margin-bottom: var(--space-6);
}

.gc-detail-section:last-child {
  margin-bottom: 0;
}

.gc-detail-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gc-muted);
}

.gc-detail-section p strong {
  font-size: 14px;
  font-weight: var(--font-bold);
  color: var(--gc-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gc-no-details {
  color: var(--gc-muted);
  font-style: italic;
  font-size: var(--text-sm);
}

/* --- ≥481px --- */
@media (min-width: 481px) {
  .gc-voucher-action {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .gc-voucher-action .gc-btn {
    flex: 1;
    min-width: 140px;
    width: auto;
  }
}

/* --- ≥769px — desktop list layout --- */
@media (min-width: 769px) {
  .gc-vouchers-list-section {
    padding: 0 var(--space-7);
  }

  .gc-vouchers-list {
    gap: var(--space-5);
    margin-top: var(--space-8);
    padding-bottom: var(--space-10);
  }

  .gc-voucher-item {
    flex-wrap: nowrap;
    min-height: 110px;
  }

  .gc-voucher-badge-col {
    width: 100px;
    border-radius: 5px 0 0 0;
    padding: var(--space-6) var(--space-4);
  }

  .gc-voucher-discount-badge {
    flex-direction: column;
    gap: 0;
    padding: var(--space-6) var(--space-4);
  }

  .gc-discount-value {
    font-size: var(--text-3xl);
  }

  .gc-voucher-logo-col {
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-4);
  }

  .gc-voucher-content {
    padding: var(--space-6) 0;
    flex: 1;
  }

  .gc-voucher-title {
    font-size: 16px;
  }

  .gc-voucher-action {
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-7) var(--space-6) var(--space-6);
    min-width: 170px;
    width: auto;
  }

  .gc-voucher-action .gc-btn {
    width: auto;
  }

  .gc-voucher-toggle {
    padding: var(--space-5) var(--space-7);
    font-size: 14px;
  }

  .gc-voucher-details-content {
    padding: var(--space-7);
  }
}

/* ================================================
   Voucher Tile View (Grid/Card Layout)
   ================================================ */

.gc-vouchers-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: var(--space-5);
  margin-top: var(--space-8);
  padding-bottom: var(--space-8);
}

/* Tile wrapper */
.gc-voucher-tile-wrapper {
  display: flex;
  flex-direction: column;
}

.gc-voucher-tile-wrapper .gc-voucher-tile {
  border-radius: var(--radius) var(--radius) 0 0;
}

.gc-voucher-tile {
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  isolation: isolate;
}

.gc-voucher-tile:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* Tile Header */
.gc-voucher-tile-header {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--gc-border);
}

.gc-voucher-tile-badge-inline {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  background: var(--gc-badge-code);
  border-radius: 5px 0 0 0;
}

.gc-voucher-tile-badge-inline--code {
  background: var(--gc-badge-code);
}

.gc-voucher-tile-badge-inline--deal {
  background: var(--gc-primary);
}

.gc-voucher-tile-discount-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: var(--space-5) var(--space-3);
  color: var(--gc-white);
  text-align: center;
  background: none;
  border: none;
  border-radius: 0;
  min-width: unset;
}

.gc-voucher-tile-discount-badge .gc-discount-value {
  font-size: 18px;
  color: var(--gc-white);
}

.gc-voucher-tile-discount-badge .gc-discount-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.9);
}

.gc-voucher-tile-merchant-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  min-width: 0;
}

.gc-voucher-tile-merchant-info .gc-voucher-merchant-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
}

.gc-voucher-tile-merchant {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gc-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.gc-voucher-tile-merchant a {
  color: var(--gc-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-voucher-tile-merchant a:hover {
  color: var(--gc-text);
}

/* Tile Body */
.gc-voucher-tile-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 14px;
  flex: 1;
}

.gc-voucher-tile-title {
  margin: 0;
  font-size: 14px;
  font-weight: var(--font-semibold);
  color: var(--gc-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gc-voucher-tile-description {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--gc-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tile Footer */
.gc-voucher-tile-footer {
  margin-top: auto;
  padding: var(--space-5) 14px;
  border-top: 1px solid var(--gc-border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-4);
}

.gc-voucher-tile-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.gc-voucher-tile-expiry {
  font-size: var(--space-5);
  color: var(--gc-muted);
  margin: 0;
  text-align: center;
}

.gc-btn-small {
  padding: var(--space-4) var(--space-7);
  font-size: var(--text-sm);
  width: 100%;
}

/* Tile Expandable Details */
.gc-voucher-tile-wrapper .gc-voucher-details-wrapper {
  border: 1px solid var(--gc-border);
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--gc-surface);
}

/* --- ≥481px --- */
@media (min-width: 481px) {
  .gc-vouchers-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
  }

  .gc-voucher-tile-badge-inline {
    width: 80px;
  }

  .gc-voucher-tile-discount-badge .gc-discount-value {
    font-size: 22px;
  }

  .gc-voucher-tile-discount-badge .gc-discount-label {
    font-size: 10px;
  }

  .gc-voucher-tile-body {
    padding: var(--space-6);
  }

  .gc-voucher-tile-title {
    font-size: var(--text-base);
  }

  .gc-voucher-tile-footer {
    padding: 14px var(--space-6);
  }

  .gc-btn-small {
    width: auto;
  }
}

/* --- ≥769px --- */
@media (min-width: 769px) {
  .gc-vouchers-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-7);
    padding-bottom: var(--space-10);
  }
}
