/*
  Component Styles — Crumble & Co.
  Reusable component patterns using BEM naming.
  All values reference design tokens from tokens.css.
*/

/* ========================================
   Navigation
   ======================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header--scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: transparent;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
  height: 72px;
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
}

.nav__logo:hover {
  color: var(--color-accent);
}

.nav__logo-img {
  height: 44px;
  width: auto;
  display: block;
}

@media (min-width: 1024px) {
  .nav__logo-img {
    height: 56px;
  }
}

.nav__links {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__link {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-primary);
  text-decoration: none;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 200ms ease;
}

.nav__link:hover::after {
  width: 100%;
}

.nav__link--active {
  color: var(--color-accent);
}

.nav__link--active::after {
  width: 100%;
  background: var(--color-accent);
}

.nav__hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font-size: 1.5rem;
}

.nav__mobile-menu {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
  z-index: 99;
}

.nav__mobile-menu.is-open {
  display: block;
}

.nav__mobile-menu .nav__link {
  display: block;
  padding: var(--space-3) 0;
  font-size: var(--text-lg);
}

@media (min-width: 1024px) {
  .nav {
    height: 80px;
    padding: 0 var(--gutter);
  }

  .nav__logo {
    font-size: 1.5rem;
  }

  .nav__links {
    display: flex;
    gap: var(--space-6);
    align-items: center;
  }

  .nav__hamburger {
    display: none;
  }
}

/* ========================================
   Page Banner
   ======================================== */

.page-banner {
  position: relative;
  overflow: hidden;
  padding: var(--space-16) 0;
  text-align: center;
  color: var(--color-bg);
}

.page-banner__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

@supports (background-attachment: fixed) {
  .page-banner--parallax .page-banner__image {
    display: none;
  }

  .page-banner--parallax::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center center;
    z-index: 0;
  }
}

.page-banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(44, 24, 16, 0.75), rgba(61, 31, 46, 0.7));
  z-index: 1;
}

.page-banner__content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.page-banner__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-bg);
  margin-bottom: var(--space-2);
  letter-spacing: var(--tracking-tight);
}

.page-banner__subtitle {
  color: rgba(253, 248, 243, 0.85);
  max-width: 520px;
  margin: 0 auto;
  font-size: var(--text-base);
}

@media (min-width: 768px) {
  .page-banner {
    padding: var(--space-20) 0;
  }

  .page-banner__content {
    padding: 0 var(--gutter);
  }

  .page-banner__title {
    font-size: var(--text-4xl);
  }

  .page-banner__subtitle {
    font-size: var(--text-lg);
  }
}

/* ========================================
   Product Card
   ======================================== */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  border-top: 2px solid transparent;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-top-color: var(--color-accent);
}

.card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  transition: transform var(--transition-base);
}

.card:hover .card__image {
  transform: scale(1.03);
}

.card__body {
  padding: var(--space-6);
}

.card__title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.card__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__price {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-accent);
  margin-top: var(--space-3);
}

/* ========================================
   Footer
   ======================================== */

.footer {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(123, 45, 78, 0.3), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(212, 165, 116, 0.15), transparent 50%),
    linear-gradient(135deg, #2C1810, #3D1F2E);
  color: var(--color-bg);
  padding: var(--space-16) 0 var(--space-8);
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.footer__grid {
  /* Single column on mobile by default */
}

.footer__logo-img {
  height: 48px;
  width: auto;
  margin-bottom: var(--space-4);
}

.footer__tagline {
  font-size: var(--text-sm);
  color: rgba(253, 248, 243, 0.7);
  line-height: 1.7;
  margin-bottom: var(--space-5);
  max-width: 300px;
}

.footer__heading {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-bg);
  margin-bottom: var(--space-4);
  position: relative;
  padding-bottom: var(--space-2);
}

.footer__heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--color-warm);
  border-radius: 1px;
}

.footer__links {
  list-style: none;
  padding: 0;
}

.footer__link {
  display: inline-block;
  font-size: var(--text-sm);
  color: rgba(253, 248, 243, 0.8);
  text-decoration: none;
  padding: var(--space-1) 0;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.footer__link:hover {
  color: var(--color-warm);
  padding-left: var(--space-1);
}

.footer__social {
  display: flex;
  gap: var(--space-3);
}

.footer__social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  color: var(--color-bg);
  background: rgba(253, 248, 243, 0.1);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.footer__social-icon:hover {
  color: var(--color-bg);
  background: rgba(253, 248, 243, 0.2);
  transform: translateY(-2px);
}

.footer__hours-list {
  list-style: none;
  padding: 0;
}

.footer__hours-item {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: rgba(253, 248, 243, 0.8);
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(253, 248, 243, 0.1);
  max-width: 220px;
}

.footer__hours-item:last-child {
  border-bottom: none;
}

.footer__contact-list {
  list-style: none;
  padding: 0;
}

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: rgba(253, 248, 243, 0.8);
  padding: var(--space-2) 0;
}

.footer__contact-item i {
  color: var(--color-warm);
  font-size: 1rem;
  margin-top: 0.15em;
  flex-shrink: 0;
}

.footer__bottom {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(253, 248, 243, 0.15);
  font-size: 0.75rem;
  color: rgba(253, 248, 243, 0.5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.footer__credit {
  font-size: 0.75rem;
  color: rgba(253, 248, 243, 0.4);
}

.footer__nav {
  margin-bottom: var(--space-6);
}

.footer__hours {
  margin-bottom: var(--space-6);
}

.footer__contact {
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .footer__inner {
    padding: 0 var(--gutter);
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 1024px) {
  .footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: var(--space-8);
  }

  .footer__nav,
  .footer__hours,
  .footer__contact {
    margin-bottom: 0;
  }
}

/* ========================================
   Tab Component
   ======================================== */

.tabs__list {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.tab {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  padding: var(--space-2) var(--space-5);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 44px; /* touch target */
}

.tab:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.tab--active,
.tab[aria-selected="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg);
}

.tab:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
