/* ===== VCR Merch Store - Mobile-First Brand Dark Theme ===== */

/* Fonts */
@font-face {
  font-family: 'Beachwood';
  src: url('../fonts/beachwood.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Design Tokens */
:root {
  --bg: #1C1C1C;
  --card-bg: #2E2D32;
  --primary: #EC2026;
  --primary-hover: #d41a1f;
  --text: #FFFFFF;
  --text-secondary: #E3CDB6;
  --accent-orange: #F16123;
  --accent-teal: #1998BF;
  --font-heading: 'Beachwood', 'Bebas Neue', sans-serif;
  --font-body: 'Montserrat', sans-serif;
  --font-display: 'Bebas Neue', sans-serif;
  --radius: 8px;
  --transition: 0.2s ease;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.cart-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ===== Header ===== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  padding-top: calc(0.75rem + var(--safe-top));
  background: var(--card-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--primary);
}

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

.cart-toggle {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.75rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.cart-toggle svg {
  width: 26px;
  height: 26px;
  fill: var(--text);
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--primary);
  color: var(--text);
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: var(--transition);
}

.cart-badge.visible {
  opacity: 1;
  transform: scale(1);
}

/* ===== Hero Banner ===== */
.hero-banner {
  width: 100%;
  overflow: hidden;
}

.hero-banner img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ===== Product Grid ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 480px) {
  .product-grid {
    gap: 1rem;
    padding: 1rem;
  }
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.store-loading,
.store-empty,
.store-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.store-error {
  color: var(--primary);
}

/* ===== Product Card ===== */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card img,
.product-image-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #3a393f;
}

.product-card .card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.product-card .product-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.2;
}

.product-card .product-description {
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .product-price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent-orange);
}

@media (min-width: 480px) {
  .product-card .card-body {
    padding: 1rem;
    gap: 0.6rem;
  }

  .product-card .product-name {
    font-size: 1.3rem;
  }

  .product-card .product-description {
    font-size: 0.85rem;
  }

  .product-card .product-price {
    font-size: 1.4rem;
  }
}


/* ===== CTA Buttons ===== */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: var(--primary);
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  margin-top: auto;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary:active {
  background: var(--primary-hover);
  transform: scale(0.97);
}

@media (hover: hover) {
  .btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
  }
}

/* ===== Cart Drawer ===== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100vw;
  background: var(--card-bg);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}

.cart-drawer.open {
  transform: translateX(0);
}

@media (min-width: 480px) {
  .cart-drawer {
    max-width: 400px;
  }
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  padding-top: calc(1rem + var(--safe-top));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-drawer-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cart-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.75rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.75rem 1rem;
}

.cart-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: flex-start;
}

.cart-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  background: #3a393f;
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-size {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.cart-item-price {
  font-size: 0.8rem;
  color: var(--accent-orange);
  font-weight: 600;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.cart-item-qty button {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.cart-item-qty button:active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(236, 32, 38, 0.1);
}

.cart-item-qty span {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 1.5rem;
  text-align: center;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  align-self: flex-start;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.cart-item-remove:active {
  color: var(--primary);
}

.cart-footer {
  padding: 1rem;
  padding-bottom: calc(1rem + var(--safe-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--card-bg);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  text-transform: uppercase;
}

.cart-total .total-amount {
  color: var(--accent-orange);
}

.cart-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 3rem 1rem;
  font-size: 0.9rem;
}

/* ===== Toast Notification ===== */
.toast {
  position: fixed;
  bottom: calc(1.25rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--card-bg);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Page Content (success page) ===== */
.page-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  min-height: calc(100dvh - 70px);
  padding: 2rem 1.5rem;
  text-align: center;
}

.page-content h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.page-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.page-content a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.page-content a:active {
  opacity: 0.7;
}

/* ===== Section Heading ===== */
.section-heading {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  text-align: center;
  padding: 1.25rem 1rem 0.25rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (min-width: 480px) {
  .section-heading {
    font-size: 2rem;
    padding: 1.5rem 1rem 0.5rem;
  }
}
