/* Vertical rhythm spacing system (4px base unit) */
:root {
  --td-card-spacing-xs: 0.25rem;  /* 4px */
  --td-card-spacing-sm: 0.5rem;   /* 8px */
  --td-card-spacing-md: 0.75rem;  /* 12px */
  --td-card-spacing-lg: 1rem;     /* 16px */
  --td-card-spacing-xl: 1.25rem;  /* 20px */
}

.td-cards-list {
  display: none;
}

.td-mobile-card,
.td-mobile-card-v2 {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background-color: var(--td-card-bg, #FFFFFF);
  height: 100%;
}

.td-card-focus-visible,
.td-mobile-card:focus-visible,
.td-mobile-card-v2:focus-visible {
  outline: 2px solid var(--td-focus, #2563EB);
  outline-offset: 2px;
}

.td-mobile-card-top {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.td-mobile-card-headline-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.td-mobile-card-content-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.td-mobile-card-media {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  flex-shrink: 0;
}

.td-mobile-card-accent {
  width: 4px;
  height: 96px;
  border-radius: 0;
  flex-shrink: 0;
}

.td-mobile-card-thumb {
  width: 96px;
  height: 96px;
  background-color: var(--td-softGray, #F7F7F9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0;
}

.td-mobile-card-price-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
}


.td-mobile-card-header {
  display: flex;
  align-items: stretch;
  gap: var(--td-card-spacing-sm);
  padding: var(--td-card-spacing-md);
  padding-bottom: 0;
}

.td-mobile-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 var(--td-card-spacing-md);
}

.td-mobile-card-components {
  border-radius: 0rem;
  background-color: transparent;
  padding: var(--td-card-spacing-md) 0;
}

.td-mobile-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--td-card-spacing-md);
  margin-top: auto;
  padding: var(--td-card-spacing-md);
  padding-top: var(--td-card-spacing-sm);
  min-height: 60px;
}

.td-mobile-card-cta {
  display: flex;
  align-items: center;
}

.td-mobile-card-cta .td-btn-compact-primary {
  min-width: 60px;
  padding: 0.375rem 0.75rem;
  text-align: center;
}

/* Grid view for deals page (desktop toggle) - Match component listing format */
.deals-card-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.deals-card-grid > * {
  border: 2px solid var(--td-border, #D0D3D8);
  padding: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  background-color: #FFFFFF;
}

@media (min-width: 640px) {
  .deals-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .deals-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .deals-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile and tablet: favor cards over the comparison table */
@media (max-width: 1023px) {
  .td-table {
    display: none !important;
  }

  /* Show the table view container but hide the table itself */
  .deals-table-view {
    display: block !important;
  }

  .deals-table-view .overflow-x-auto {
    display: none;
  }

  /* Show mobile cards container */
  .td-cards-list {
    display: flex !important;
    flex-direction: column;
    gap: 0.75rem;
  }

  .td-mobile-card,
  .td-mobile-card-v2 {
    border: 1px solid var(--td-border, #D0D3D8);
    border-radius: 0;
  }

  /* Hide desktop grid view on mobile */
  .deals-grid-view {
    display: none !important;
  }
}

