/* ===== CSS Variables ===== */
:root {
  --sand-light: #F7F3EE;
  --sand: #E8DFD4;
  --coral: #C4856A;
  --ocean: #3A8C96;
  --ocean-light: #5DB8C4;
  --seafoam: #8EC5C0;
  --sunset: #D4956B;
  --driftwood: #A69580;
  --text-dark: #2B3A42;
  --text-mid: #5A6872;
  --white: #FFFFFF;
  --shadow: rgba(43, 58, 66, 0.06);
  --shadow-hover: rgba(43, 58, 66, 0.14);
  --radius: 14px;
  --nav-height: 56px;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--sand-light);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--ocean);
  text-decoration: none;
}

/* ===== Sticky Tab Bar ===== */
.tab-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--sand);
  box-shadow: 0 1px 6px var(--shadow);
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  height: var(--nav-height);
  min-height: 44px;
  border: none;
  background: none;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}

.tab-btn:hover {
  color: var(--ocean);
}

.tab-btn.active {
  color: var(--ocean);
  border-bottom-color: var(--ocean);
}

.tab-label {
  display: none;
}

.tab-icon {
  font-size: 1.15rem;
  color: var(--driftwood);
}

.tab-btn.active .tab-icon,
.tab-btn:hover .tab-icon {
  color: var(--ocean);
}

.section-icon {
  color: var(--coral);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(160deg, #2B3A42 0%, #3A8C96 40%, #5DB8C4 65%, #C4856A 100%);
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
  color: var(--white);
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.5px;
}

.hero-subtitle {
  font-size: 1.05rem;
  font-weight: 400;
  opacity: 0.9;
  letter-spacing: 0.3px;
}

/* ===== Sections ===== */
.category-section {
  padding: 2rem 1rem 1rem;
}

.section-heading {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--ocean);
  margin-bottom: 1rem;
  padding-left: 4px;
}

.section-heading .section-icon {
  margin-right: 8px;
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

/* ===== Collapsed Grid (2 rows) ===== */
.card-grid.collapsed {
  --visible-rows: 2;
  max-height: calc(var(--visible-rows) * (280px + 1.25rem));
  overflow: hidden;
  position: relative;
}

/* Fade at bottom when collapsed */
.card-grid.collapsed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--sand-light));
  pointer-events: none;
}

.show-more-wrap {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.75rem;
}

.show-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--white);
  color: var(--ocean);
  border: 1.5px solid var(--ocean);
  border-radius: 24px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}

.show-more-btn:hover {
  background: var(--ocean);
  color: var(--white);
}

/* ===== Card ===== */
.card {
  display: block;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 2px 12px var(--shadow);
  transition: transform 200ms ease, box-shadow 200ms ease;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-hover);
}

.card:active {
  transform: scale(0.98);
}

.card-img-wrap {
  position: relative;
}

.card-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--sand);
}

.card-price {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--white);
  color: var(--ocean);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  letter-spacing: 0.5px;
}

.card-body {
  padding: 1rem 1.1rem 1.2rem;
}

.card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.35rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.55;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.85rem;
  color: var(--driftwood);
  border-top: 1px solid var(--sand);
}

/* ===== Responsive: Tablet ===== */
@media (min-width: 600px) {
  .tab-label {
    display: inline;
  }

  .tab-icon {
    font-size: 1rem;
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid.collapsed {
    max-height: calc(var(--visible-rows) * (300px + 1.25rem));
  }

  .hero-title {
    font-size: 2.8rem;
  }

  .category-section {
    padding: 2.5rem 2rem 1.5rem;
  }
}

/* ===== Responsive: Desktop ===== */
@media (min-width: 960px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
    margin: 0 auto;
  }

  .card-grid.collapsed {
    max-height: calc(var(--visible-rows) * (320px + 1.25rem));
  }

  .hero {
    padding: 4rem 2rem 3rem;
  }

  .hero-title {
    font-size: 3.2rem;
  }

  .category-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 2rem 1.5rem;
  }

  .section-heading {
    font-size: 1.8rem;
  }
}

/* ===== Accessibility: Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card {
    transition: none;
  }

  .card:hover {
    transform: none;
  }

  .card:active {
    transform: none;
  }

  .tab-btn {
    transition: none;
  }

  .show-more-btn {
    transition: none;
  }
}
