/* ============================================
   IronCrown Store — Global Styles
   Dark theme, amber accents, Outfit + Space Grotesk
   ============================================ */

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 40px;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.main-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--smoke);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--amber); }

.cart-icon {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--silver);
  transition: color 0.15s;
}
.cart-icon:hover { color: var(--amber); }
.cart-count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--amber);
  color: var(--black);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* --- Hero --- */
.hero-store {
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(200, 149, 108, 0.07) 0%, transparent 60%),
    var(--black);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.hero-store::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255,255,255,0.012) 1px, rgba(255,255,255,0.012) 2px);
  pointer-events: none;
}
.hero-store-inner { position: relative; }
.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--silver);
  max-width: 420px;
  margin: 0 auto 40px;
  line-height: 1.6;
}
.hero-cta-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-block;
  padding: 14px 32px;
  background: var(--amber);
  color: var(--black);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.btn-primary:hover { background: #d4a57a; transform: translateY(-1px); }
.btn-ghost {
  display: inline-block;
  padding: 14px 32px;
  background: transparent;
  color: var(--bone);
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid rgba(232, 228, 223, 0.2);
  border-radius: 4px;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

/* --- Page Header --- */
.page-header {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 40px 40px 32px;
}
.page-header-inner { max-width: 1200px; margin: 0 auto; }
.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.page-sub { color: var(--smoke); font-size: 0.9rem; margin-top: 4px; }
.breadcrumb { color: var(--smoke); font-size: 0.875rem; transition: color 0.15s; }
.breadcrumb:hover { color: var(--amber); }

/* --- Sections --- */
.categories-section, .products-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 40px;
}
.section-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

/* --- Categories Grid --- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.category-card {
  background: var(--charcoal);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
  cursor: pointer;
}
.category-card:hover { border-color: var(--amber); transform: translateY(-2px); }
.category-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}
.category-desc { color: var(--smoke); font-size: 0.85rem; line-height: 1.5; flex-grow: 1; }
.category-arrow { color: var(--amber); font-size: 1.1rem; margin-top: 8px; }

/* --- Products Grid --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--charcoal);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
  display: block;
}
.product-card:hover { border-color: var(--amber); transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.product-image-wrap { aspect-ratio: 1; overflow: hidden; background: var(--steel); }
.product-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.product-card:hover .product-image { transform: scale(1.03); }
.product-info { padding: 16px; }
.product-category { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--amber); display: block; margin-bottom: 6px; }
.product-name { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.product-price { font-size: 1rem; font-weight: 500; color: var(--cream); }

/* --- Product Detail --- */
.product-page { max-width: 1200px; margin: 0 auto; padding: 48px 40px; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.product-gallery { aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--charcoal); }
.product-main-image { width: 100%; height: 100%; object-fit: cover; }
.product-detail-info { padding-top: 8px; }
.product-detail-name { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; font-weight: 700; line-height: 1.2; margin: 8px 0 16px; }
.product-detail-price { font-size: 1.5rem; font-weight: 500; color: var(--amber); margin-bottom: 20px; }
.product-detail-desc { color: var(--silver); font-size: 1rem; line-height: 1.7; margin-bottom: 32px; }
.add-to-cart-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.quantity-control { display: flex; align-items: center; background: var(--charcoal); border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.qty-btn {
  width: 40px;
  height: 40px;
  background: none;
  color: var(--cream);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}
.qty-btn:hover { background: var(--steel); }
.qty-input {
  width: 48px;
  text-align: center;
  background: none;
  border: none;
  color: var(--cream);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  -moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button, .qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.btn-add-cart {
  flex: 1;
  padding: 12px 24px;
  background: var(--cream);
  color: var(--black);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.btn-add-cart:hover { background: var(--amber); }
.stock-note { color: var(--smoke); font-size: 0.8rem; }
.out-of-stock-msg { color: var(--smoke); font-style: italic; }

/* --- Cart --- */
.cart-page { max-width: 800px; margin: 0 auto; padding: 48px 40px; }
.cart-container { }
.cart-items { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--charcoal);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 20px;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.cart-item-price { color: var(--smoke); font-size: 0.85rem; }
.cart-item-right { display: flex; align-items: center; gap: 16px; }
.cart-item-total { font-weight: 600; font-size: 1rem; }
.cart-remove-btn {
  background: none;
  color: var(--smoke);
  font-size: 1.2rem;
  padding: 4px 8px;
  transition: color 0.15s;
}
.cart-remove-btn:hover { color: var(--amber); }
.cart-summary { background: var(--charcoal); border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; padding: 24px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; color: var(--silver); }
.summary-total { border-top: 1px solid rgba(255,255,255,0.08); margin-top: 8px; padding-top: 16px; font-size: 1.1rem; font-weight: 600; color: var(--cream); }
.summary-total span:last-child { color: var(--amber); }
.btn-checkout { width: 100%; padding: 16px; background: var(--amber); color: var(--black); font-weight: 700; font-size: 1rem; border-radius: 4px; margin-top: 16px; transition: all 0.15s; letter-spacing: 0.02em; }
.btn-checkout:hover { background: #d4a57a; transform: translateY(-1px); }
.cart-empty { text-align: center; padding: 80px 40px; }
.cart-empty-msg { font-size: 1.1rem; color: var(--smoke); margin-bottom: 24px; }

/* --- Checkout Modal --- */
.checkout-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.checkout-modal-inner {
  background: var(--off-black);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
}
.checkout-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.checkout-modal-header h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; font-weight: 600; }
.modal-close { background: none; color: var(--smoke); font-size: 1.5rem; padding: 4px 8px; transition: color 0.15s; }
.modal-close:hover { color: var(--cream); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--silver); margin-bottom: 6px; letter-spacing: 0.02em; }
.form-group input { width: 100%; padding: 12px 14px; background: var(--charcoal); border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; color: var(--cream); font-family: inherit; font-size: 0.95rem; outline: none; transition: border-color 0.15s; }
.form-group input:focus { border-color: var(--amber); }
.checkout-order-summary { background: var(--charcoal); border-radius: 6px; padding: 16px; margin-bottom: 20px; }
.checkout-line-item { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.875rem; color: var(--silver); }
.checkout-line-total { border-top: 1px solid rgba(255,255,255,0.08); margin-top: 8px; padding-top: 10px; font-weight: 600; color: var(--cream); }
.btn-checkout-submit { width: 100%; padding: 16px; background: var(--amber); color: var(--black); font-weight: 700; font-size: 1rem; border-radius: 4px; transition: all 0.15s; letter-spacing: 0.02em; }
.btn-checkout-submit:hover:not(:disabled) { background: #d4a57a; }
.btn-checkout-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.checkout-error { color: #e07070; font-size: 0.875rem; padding: 12px; background: rgba(224,112,112,0.1); border-radius: 4px; margin-bottom: 16px; }
.checkout-loading { text-align: center; padding: 32px; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--steel); border-top-color: var(--amber); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.checkout-loading p { color: var(--smoke); font-size: 0.9rem; }

/* --- Success Page --- */
.checkout-success-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 80px 24px; }
.success-container { text-align: center; max-width: 480px; }
.success-icon { color: var(--amber); margin-bottom: 24px; }
.success-title { font-family: 'Space Grotesk', sans-serif; font-size: 2.5rem; font-weight: 700; margin-bottom: 16px; }
.success-msg { color: var(--silver); font-size: 1.1rem; margin-bottom: 16px; }
.success-session { font-family: monospace; color: var(--smoke); background: var(--charcoal); padding: 8px 16px; border-radius: 6px; display: inline-block; margin-bottom: 32px; font-size: 0.85rem; }
.success-actions { display: flex; justify-content: center; }

/* --- Error Page --- */
.error-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 80px 24px; }
.error-container { text-align: center; }
.error-title { font-family: 'Space Grotesk', sans-serif; font-size: 6rem; font-weight: 700; color: var(--amber); line-height: 1; margin-bottom: 16px; }
.error-msg { color: var(--smoke); font-size: 1rem; margin-bottom: 32px; }

/* --- Footer --- */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 48px 40px;
  margin-top: 80px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: start; }
.footer-logo { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 700; display: block; margin-bottom: 8px; }
.footer-tagline { color: var(--smoke); font-size: 0.875rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { color: var(--smoke); font-size: 0.875rem; transition: color 0.15s; }
.footer-links a:hover { color: var(--amber); }
.footer-copy { grid-column: 1 / -1; color: var(--smoke); font-size: 0.75rem; margin-top: 16px; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .site-header { padding: 0 20px; }
  .main-nav { gap: 16px; }
  .nav-link { font-size: 0.75rem; }
  .categories-section, .products-section, .product-page, .cart-page { padding: 40px 20px; }
  .hero-store { padding: 60px 20px; }
  .product-detail-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { gap: 16px; }
}