@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* =========================================================
   LegisCore Font + Scale Refinement
   Professional sans serif and slightly smaller typography
   ========================================================= */

html {
  font-size: 15px;
}

body {
  font-family: 'Inter', 'Aptos', 'Segoe UI', Arial, sans-serif;
  font-size: 0.96rem;
  line-height: 1.55;
  letter-spacing: -0.006em;
  color: var(--charcoal, #373435);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
.nav-link,
.dropdown-toggle,
.card-btn,
.checkout-btn,
.discount-btn,
.secondary-checkout-link,
.dashboard-menu a,
.section-kicker,
.eyebrow {
  font-family: 'Inter', 'Aptos', 'Segoe UI', Arial, sans-serif;
}

h1 {
  font-size: clamp(2rem, 4.2vw, 3.7rem);
  line-height: 1.08;
  font-weight: 850;
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.18;
  font-weight: 820;
}

h3 {
  font-size: 1.06rem;
  line-height: 1.28;
  font-weight: 780;
}

p,
li,
td,
th,
label,
input,
select,
textarea {
  font-size: 0.94rem;
}

.catalog-hero h1,
.package-detail-hero h1,
.dashboard-hero h1,
.auth-content h1 {
  font-size: clamp(2rem, 4.1vw, 3.65rem);
}

.catalog-hero p,
.package-detail-hero p,
.dashboard-hero p,
.auth-content p {
  font-size: 0.98rem;
}



/* =========================================================
   Final compact balance overrides
   ========================================================= */

.catalog-hero,
.dashboard-hero,
.cart-hero,
.package-detail-hero,
.auth-hero {
  padding-top: 48px;
  padding-bottom: 48px;
}

.catalog-section,
.cart-section,
.dashboard-content,
.package-detail-section {
  padding-top: 36px;
  padding-bottom: 44px;
}

/* =========================================================
   Button & Input Sizing
   ========================================================= */

.card-btn,
.checkout-btn,
.discount-btn,
.secondary-checkout-link,
.remove-btn,
button.card-btn,
button.checkout-btn,
input[type="submit"],
input[type="button"] {
  min-height: 44px;
  height: 44px;
  font-size: 0.88rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
select {
  min-height: 44px;
  height: 44px;
  font-size: 0.92rem;
  border-radius: 999px;
  border: 1px solid var(--border, #e5e7eb);
  padding: 0 18px;
  outline: none;
  background: var(--white, #fff);
  color: var(--charcoal, #373435);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="search"]:focus,
select:focus {
  border-color: var(--teal, #22abad);
  box-shadow: 0 0 0 3px rgba(34, 171, 173, 0.15);
}

textarea {
  font-size: 0.92rem;
  border-radius: 20px;
  border: 1px solid var(--border, #e5e7eb);
  padding: 14px 18px;
  outline: none;
  background: var(--white, #fff);
  color: var(--charcoal, #373435);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

textarea:focus {
  border-color: var(--teal, #22abad);
  box-shadow: 0 0 0 3px rgba(34, 171, 173, 0.15);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* =========================================================
   Button Style Definitions (brand-consistent)
   ========================================================= */

.checkout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teal, #22abad);
  color: var(--white, #fff);
  border: none;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.22s ease, transform 0.22s ease;
  text-decoration: none;
}

.checkout-btn:hover {
  background: var(--teal-dark, #168f91);
  transform: translateY(-1px);
}

.secondary-checkout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--charcoal, #373435);
  border: 1px solid var(--border, #e5e7eb);
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.22s ease, color 0.22s ease;
  text-decoration: none;
}

.secondary-checkout-link:hover {
  border-color: var(--teal, #22abad);
  color: var(--teal-dark, #168f91);
}

.remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--danger, #dc2626);
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease;
  text-decoration: none;
}

.remove-btn:hover {
  background: var(--danger, #dc2626);
  color: var(--white, #fff);
}

.discount-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--teal-soft, rgba(34,171,173,0.12));
  color: var(--teal-dark, #168f91);
  border: 1px solid var(--teal, #22abad);
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease;
  text-decoration: none;
}

.discount-btn:hover {
  background: var(--teal, #22abad);
  color: var(--white, #fff);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
  text-decoration: none;
  border: none;
  font-size: 0.88rem;
}

.btn.btn-primary {
  background: var(--teal, #22abad);
  color: var(--white, #fff);
}

.btn.btn-primary:hover {
  background: var(--teal-dark, #168f91);
}

.btn.btn-secondary {
  background: transparent;
  color: var(--charcoal, #373435);
  border: 1px solid var(--charcoal, #373435);
}

.btn.btn-secondary:hover {
  background: var(--charcoal, #373435);
  color: var(--white, #fff);
}

.muted-btn {
  opacity: 0.65;
}

.muted-btn:hover {
  opacity: 1;
}

/* =========================================================
   Neatly Padded Table Styles (brand-consistent)
   ========================================================= */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--border, #e5e7eb);
  background: var(--white, #fff);
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white, #fff);
}

.table-wrapper thead {
  background: var(--charcoal, #373435);
}

.table-wrapper th {
  color: var(--white, #fff);
  font-weight: 700;
  text-align: left;
  padding: 16px 18px;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.table-wrapper td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-size: 0.92rem;
  vertical-align: middle;
}

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

.table-wrapper tbody tr:hover {
  background: var(--teal-soft, rgba(34,171,173,0.12));
}

.table-wrapper .empty-state {
  padding: 32px 18px;
  text-align: center;
  color: var(--medium-grey, #6b7280);
}

.table-wrapper .admin-inline-update-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-wrapper .admin-inline-update-form select {
  min-height: 36px;
  height: 36px;
  font-size: 0.82rem;
  padding: 0 32px 0 12px;
  width: auto;
}

.table-wrapper .admin-inline-update-form .card-btn {
  min-height: 36px;
  height: 36px;
  font-size: 0.82rem;
  padding: 0 14px;
}

/* =========================================================
   Category Filter Cards
   ========================================================= */

.category-card-section {
  margin-bottom: 34px;
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.section-heading-row h2 {
  margin: 4px 0 0;
  color: var(--charcoal-dark, #1f1f21);
}

.category-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.category-card {
  display: grid;
  gap: 7px;
  min-height: 116px;
  padding: 16px;
  border-radius: 18px;
  background: var(--white, #ffffff);
  border: 1px solid rgba(31, 31, 33, 0.08);
  box-shadow: 0 10px 24px rgba(31, 31, 33, 0.06);
  text-decoration: none;
  color: var(--charcoal, #373435);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.category-card strong {
  color: var(--charcoal-dark, #1f1f21);
  font-size: 0.98rem;
  line-height: 1.25;
}

.category-card span {
  color: var(--medium-grey, #6b7280);
  font-size: 0.86rem;
  line-height: 1.4;
}

.category-card:hover,
.category-card.active {
  transform: translateY(-2px);
  background: var(--teal-soft, #e7f8f8);
  border-color: rgba(34, 171, 173, 0.28);
  box-shadow: 0 14px 30px rgba(31, 31, 33, 0.09);
}

.category-card.active strong,
.category-card:hover strong {
  color: var(--teal-dark, #0f7d7f);
}

/* =========================================================
   Catalog Results Section
   ========================================================= */

.catalog-results-section {
  margin-top: 24px;
}

/* =========================================================
   Service & Package Card Grids — 3 columns desktop
   ========================================================= */

.service-card-grid,
.package-card-grid,
.catalog-grid,
.services-grid,
.packages-grid,
.compact-catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

/* =========================================================
   Service Card
   ========================================================= */

.service-card {
  display: flex;
  flex-direction: column;
  background: var(--white, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(31, 31, 33, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 44px rgba(31, 31, 33, 0.13);
}

.service-image {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.service-image img {
  width: 100%;
  height: 180px;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.service-category {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--teal, #22abad);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.service-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px;
  gap: 8px;
}

.service-card-content h3 {
  margin: 0;
  color: var(--charcoal-dark, #1f1f21);
  font-size: 1.04rem;
}

.service-card-content p {
  margin: 0;
  color: var(--medium-grey, #6b7280);
  font-size: 0.88rem;
  line-height: 1.55;
  flex: 1;
}

.service-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e5e7eb);
}

.service-price {
  color: var(--teal-dark, #168f91);
  font-size: 1.35rem;
  font-weight: 900;
}

/* =========================================================
   Package Card
   ========================================================= */

.package-listing-card {
  display: flex;
  flex-direction: column;
  background: var(--white, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(31, 31, 33, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.package-listing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 44px rgba(31, 31, 33, 0.13);
}

.package-image {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.package-image img {
  width: 100%;
  height: 180px;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.package-category {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--teal, #22abad);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.package-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px;
  gap: 8px;
}

.package-content h3 {
  margin: 0;
  color: var(--charcoal-dark, #1f1f21);
  font-size: 1.04rem;
}

.package-content p {
  margin: 0;
  color: var(--medium-grey, #6b7280);
  font-size: 0.88rem;
  line-height: 1.55;
  flex: 1;
}

.package-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e5e7eb);
  flex-wrap: wrap;
}

.package-price {
  color: var(--teal-dark, #168f91);
  font-size: 1.35rem;
  font-weight: 900;
  white-space: nowrap;
}

.package-price small {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--medium-grey, #6b7280);
}

.package-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   Homepage listing-grid override — also 3 columns
   ========================================================= */

.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

/* =========================================================
   Responsive Breakpoints
   ========================================================= */

@media (max-width: 1180px) {
  .category-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .service-card-grid,
  .package-card-grid,
  .catalog-grid,
  .services-grid,
  .packages-grid,
  .compact-catalog-grid,
  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  html {
    font-size: 14.5px;
  }

  .service-card-grid,
  .package-card-grid,
  .catalog-grid,
  .services-grid,
  .packages-grid,
  .compact-catalog-grid,
  .listing-grid,
  .category-card-grid {
    grid-template-columns: 1fr;
  }

  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-card {
    min-height: auto;
  }

  .service-image img,
  .package-image img {
    height: 200px;
    max-height: 200px;
  }

  .package-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
