/* rfk_ecommerce — Base Styles
   Design tokens are in /theme.css (generated from StoreTheme model)
   All colors, fonts and spacing use CSS custom properties defined there */

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

html {
  font-size: var(--font-size-base, 16px);
}

body {
  font-family: var(--font-family, sans-serif);
  color: var(--color-text, #1e293b);
  background-color: var(--color-background, #fff);
  line-height: 1.5;
}

.container {
  max-width: var(--container-max-width, 1280px);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Header ───────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.08);
  transition: box-shadow .25s, padding .25s;
}

.site-header.is-scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 70px;
}

.site-logo {
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.site-logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex: 1;
  justify-content: center;
}

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .5rem .85rem;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-link:hover { background: rgba(0,0,0,.05); }

.nav-chevron { transition: transform .2s; }
.nav-item--dropdown:hover .nav-chevron { transform: rotate(180deg); }

/* Dropdown */
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  padding: .5rem 0;
  z-index: 200;
}
.nav-item--dropdown:hover .nav-dropdown { display: block; }

.nav-dropdown__item {
  display: block;
  padding: .6rem 1.2rem;
  font-size: .875rem;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.nav-dropdown__item:hover { background: rgba(0,0,0,.04); }

/* Header actions */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.header-action {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.header-action:hover { background: rgba(0,0,0,.06); }

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: var(--color-primary, #000);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Main content */
.site-main {
  min-height: 60vh;
}

/* Footer */
.site-footer {
  background: var(--color-footer-bg, #111);
  color: var(--color-footer-text, #aaa);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.site-footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-logo { height: 36px; width: auto; filter: brightness(0) invert(1); }
.footer-name { font-size: 1.1rem; font-weight: 700; color: #fff; }
.footer-desc { font-size: .85rem; margin-top: .5rem; max-width: 280px; }
.footer-copy  { font-size: .8rem; opacity: .6; }

/* Alert messages */
.messages {
  margin-bottom: 1rem;
  padding-top: 1rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius, 8px);
  margin-bottom: 0.5rem;
  border: 1px solid transparent;
}

.alert--success { background: #f0fdf4; border-color: var(--color-success); color: #166534; }
.alert--error, .alert--danger { background: #fef2f2; border-color: var(--color-danger); color: #991b1b; }
.alert--warning { background: #fffbeb; border-color: var(--color-accent); color: #92400e; }
.alert--info { background: #eff6ff; border-color: var(--color-primary); color: #1e40af; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--button-border-radius, 6px);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s ease;
}

.btn:hover { opacity: 0.85; }

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--secondary {
  background: var(--color-secondary);
  color: #fff;
}

.btn--outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

/* Form elements */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--color-text);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-background);
  color: var(--color-text);
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Mobile */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: fixed;
    inset: 0;
    top: 70px;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    gap: 0;
    overflow-y: auto;
    z-index: 99;
    border-top: 1px solid rgba(0,0,0,.08);
  }
  .site-nav.is-open { display: flex; }

  .nav-link { font-size: 1rem; padding: .85rem .5rem; border-bottom: 1px solid rgba(0,0,0,.06); }
  .nav-dropdown { position: static; box-shadow: none; border: none; padding-left: 1rem; display: block; }
  .nav-chevron { display: none; }
}
