/**
 * Rates Embed Styles
 * Styles for embedded rate tables on product pages
 * These tables are injected from the main rates page via rates-embed.js
 */

/* CMS Placeholder (shown in editor, hidden on live site) */
.cms-rates-placeholder {
  border: 1px dashed #adb5bd;
  border-radius: .5rem;
  padding: .75rem;
  background: #f8f9fa;
  color: #495057;
  font-size: .9375rem;
  line-height: 1.4;
}
.cms-rates-placeholder code {
  background: #eef1f4;
  padding: .1rem .25rem;
  border-radius: .25rem;
}
.cms-rates-placeholder a {
  text-decoration: underline;
}

/* Rate Card Styling */
.rate-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .08);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(0, 0, 0, .05);
  transition: box-shadow .3s ease, transform .3s ease;
}
.rate-card:hover {
  box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .12);
  transform: translateY(-2px);
}
.rate-card-alt {
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
}
.rate-card h3 {
  color: #014890;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: .25rem;
}
.rate-card h3 a {
  color: #014890;
  text-decoration: none;
  transition: color .2s ease;
}
.rate-card h3 a:hover {
  color: #9fbe3b;
  text-decoration: none;
}
.rate-card .table {
  margin-bottom: 0;
}
.rate-card .disclosure {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, .05);
  font-size: .85rem;
  color: #666;
}
.rate-card .disclosure a {
  color: #014890;
  text-decoration: underline;
}
.rate-card .disclosure a:hover {
  color: #9fbe3b;
}

/* Rates Effective Date Badge */
.rates-effective {
  display: inline-block;
  font-size: .75rem;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  padding: .2rem .6rem;
  border-radius: 2rem;
  margin-bottom: .75rem;
}

/* Responsive Rate Table Styling */
.rates table {
  width: 100% !important;
  table-layout: auto;
}
.rates th,
.rates td {
  width: auto !important;
  height: auto !important;
  white-space: normal;
}

/* Table Base Styling */
.rates .table {
  color: #000 !important;
  width: 100%;
  border-spacing: 0;
}
.rates .table thead th {
  padding-top: .75rem;
  padding-bottom: .75rem;
  font-size: .95rem !important;
  text-transform: uppercase;
  vertical-align: middle;
  letter-spacing: 1px;
  background-color: #014890 !important;
  color: #fff !important;
  font-weight: 600 !important;
  border-bottom-width: 1px;
}
.rates .table td,
.rates .table th {
  font-size: 1rem;
  padding: .5em;
}
.rates .table tr {
  border-bottom: 1px solid #f0f0f0;
}
.rates .table thead tr {
  border-bottom: 2px solid #f0f0f0;
}
.rates .table td a {
  color: #003a5d !important;
}
.rates .table th {
  text-align: left;
}

/* Header styling */
.rates .table thead,
.rates .table thead th,
.rates .table thead td {
  background: #014890 !important;
  color: #fff !important;
  border-color: rgba(0, 0, 0, .1) !important;
  white-space: nowrap;
}

/* Mobile: Stacked card layout */
@media (max-width: 576px) {
  .rates .table thead {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
  }
  .rates .table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, .125);
    border-radius: .5rem;
    background: #fff;
  }
  .rates .table tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: .75rem;
    border-top: 0;
  }
  .rates .table tbody tr td+td {
    border-top: 1px solid rgba(0, 0, 0, .075);
  }
  .rates .table td::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 1rem;
  }
  .rates .table tbody tr td:first-child,
  .rates .table tbody tr td.dataheadertype {
    background: #014890 !important;
    color: #fff !important;
    border-top-left-radius: .5rem;
    border-top-right-radius: .5rem;
  }
  .rates .table tbody tr td:first-child::before,
  .rates .table tbody tr td.dataheadertype::before {
    content: none; /* Hide label - first cell acts as card title */
  }
  /* Show label for balance-tier tables where first cell is a dollar range */
  .rates .table.balance-tiers tbody tr td:first-child::before {
    content: attr(data-label);
    color: #fff;
    margin-right: .5rem;
  }
  .rates .table tbody tr td:first-child a,
  .rates .table tbody tr td.dataheadertype a {
    color: #fff !important;
    text-decoration: underline;
  }
}

/* Desktop/Tablet: Standard table layout */
@media (min-width: 576px) {
  .rates .table thead {
    display: table-header-group !important;
    position: static !important;
    clip: auto !important;
    height: auto !important;
    margin: 0 !important;
    width: auto !important;
    overflow: visible !important;
    visibility: visible !important;
  }
  .rates .table tbody {
    display: table-row-group !important;
  }
  .rates .table thead tr,
  .rates .table tbody tr {
    display: table-row !important;
  }
  .rates .table thead th,
  .rates .table thead td,
  .rates .table tbody th,
  .rates .table tbody td {
    display: table-cell !important;
    vertical-align: middle !important;
  }
  .rates .table tbody tr {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0 !important;
  }
  .rates .table tbody tr td {
    padding: .75rem !important;
    border-top: 1px solid rgba(0, 0, 0, .125) !important;
  }
  .rates .table td::before {
    content: none !important;
  }
  .rates .table tbody tr td:first-child,
  .rates .table tbody tr td.dataheadertype {
    background: transparent !important;
    color: inherit !important;
  }
}
