/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; color: #333; background: #fff; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, textarea, select { font-family: inherit; }

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── Product Grid ──────────────────────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

/* ─── Product Card ──────────────────────────────────────────────────────────── */
.product-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #f0f0f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Image wrapper — fixed aspect ratio, no stretch */
.product-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;      /* Perfect square */
  overflow: hidden;
  background: #f8f9fa;
  flex-shrink: 0;
}

/* The actual <img> fills the box without distorting */
.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;         /* Fill, cropping evenly on both sides */
  object-position: center;
  transition: transform 0.35s ease;
  display: block;
}
.product-card:hover .product-card-img {
  transform: scale(1.06);
}

/* Fallback placeholder when image fails */
.product-card-img-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  position: absolute;
  inset: 0;
}

/* Discount / featured badge */
.product-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ff6b35;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  z-index: 2;
  letter-spacing: 0.5px;
}
.product-card-badge-featured {
  background: #1a1a2e;
}

/* Quick-add overlay */
.product-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 3;
}
.product-card:hover .product-card-overlay {
  opacity: 1;
}
.product-card-quick-add {
  background: #fff;
  color: #1a1a2e;
  border: none;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.product-card-quick-add:hover {
  background: #ff6b35;
  color: #fff;
}

/* Card body */
.product-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-card-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.product-card-cat {
  background: #f0f0f0;
  color: #888;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.product-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.product-card-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ff6b35;
}
.product-card-compare {
  font-size: 0.85rem;
  color: #bbb;
  text-decoration: line-through;
}
.product-card-shipping {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #888;
  font-weight: 500;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: #ff6b35;
  color: #fff;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  line-height: 1;
}
.btn-primary:hover { background: #e85a25; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-block;
  background: #1a1a2e;
  color: #fff;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover { background: #2d2d4a; }

.btn-outline-dark {
  display: inline-block;
  background: transparent;
  color: #1a1a2e;
  padding: 10px 22px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  border: 2px solid #1a1a2e;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline-dark:hover { background: #1a1a2e; color: #fff; }

.btn-hero-primary {
  display: inline-block;
  background: #ff6b35;
  color: #fff;
  padding: 16px 36px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.btn-hero-primary:hover { background: #e85a25; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,107,53,0.4); }

.btn-hero-secondary {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: #fff;
  padding: 16px 36px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1.5px solid rgba(255,255,255,0.3);
  transition: all 0.2s;
}
.btn-hero-secondary:hover { background: rgba(255,255,255,0.22); }

/* Admin buttons */
.btn-admin-primary {
  display: inline-block;
  background: #ff6b35;
  color: #fff;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  line-height: 1.4;
}
.btn-admin-primary:hover { background: #e85a25; }

/* ─── Category pills ────────────────────────────────────────────────────────── */
.cat-pill {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 50px;
  background: #fff;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid #e0e0e0;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-pill:hover, .cat-pill.active {
  background: #ff6b35;
  color: #fff;
  border-color: #ff6b35;
}

/* ─── Forms ─────────────────────────────────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  color: #333;
  box-sizing: border-box;
}
.form-input:focus { border-color: #ff6b35; box-shadow: 0 0 0 3px rgba(255,107,53,0.1); }
textarea.form-input { resize: vertical; }

/* Admin forms */
.admin-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.admin-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  color: #333;
  box-sizing: border-box;
}
.admin-input:focus { border-color: #ff6b35; box-shadow: 0 0 0 3px rgba(255,107,53,0.08); }
textarea.admin-input { resize: vertical; }
select.admin-input { cursor: pointer; }

/* ─── Blog content styles (frontend rendering) ──────────────────────────────── */
.blog-content { line-height: 1.85; color: #444; font-size: 1rem; }
.blog-content h1 { font-size: 2rem; font-weight: 800; color: #1a1a2e; margin: 28px 0 14px; line-height: 1.2; }
.blog-content h2 { font-size: 1.55rem; font-weight: 700; color: #1a1a2e; margin: 24px 0 12px; }
.blog-content h3 { font-size: 1.2rem; font-weight: 700; color: #1a1a2e; margin: 20px 0 10px; }
.blog-content h4 { font-size: 1rem; font-weight: 700; color: #1a1a2e; margin: 16px 0 8px; }
.blog-content p { margin: 0 0 16px; }
.blog-content strong { font-weight: 700; color: #1a1a2e; }
.blog-content em { font-style: italic; }
.blog-content a { color: #ff6b35; text-decoration: underline; transition: color 0.2s; }
.blog-content a:hover { color: #e85a25; }
.blog-content ul, .blog-content ol { padding-left: 28px; margin: 0 0 16px; }
.blog-content li { margin-bottom: 6px; }
.blog-content blockquote {
  border-left: 4px solid #ff6b35;
  margin: 24px 0;
  padding: 16px 24px;
  background: #fff3ec;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #555;
  font-size: 1.05rem;
}
.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 16px 0;
  display: block;
  border: 1px solid #eee;
}
.blog-content hr {
  border: none;
  border-top: 2px solid #eee;
  margin: 28px 0;
}
.blog-content pre {
  background: #1a1a2e;
  color: #fff;
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.88rem;
  margin: 16px 0;
}
.blog-content code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: 'Courier New', monospace;
}

/* Inline styled buttons from blog editor */
.blog-content .btn-inline-primary,
.blog-content a.btn-inline-primary {
  display: inline-block;
  background: #ff6b35;
  color: #fff !important;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none !important;
  margin: 8px 4px;
  transition: background 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
}
.blog-content .btn-inline-primary:hover,
.blog-content a.btn-inline-primary:hover { background: #e85a25; transform: translateY(-1px); }

.blog-content .btn-inline-secondary,
.blog-content a.btn-inline-secondary {
  display: inline-block;
  background: #1a1a2e;
  color: #fff !important;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none !important;
  margin: 8px 4px;
  transition: background 0.2s;
}
.blog-content .btn-inline-secondary:hover,
.blog-content a.btn-inline-secondary:hover { background: #2d2d4a; }

.blog-content .btn-inline-outline,
.blog-content a.btn-inline-outline {
  display: inline-block;
  background: transparent;
  color: #1a1a2e !important;
  padding: 10px 26px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none !important;
  border: 2px solid #1a1a2e;
  margin: 8px 4px;
  transition: all 0.2s;
}
.blog-content .btn-inline-outline:hover,
.blog-content a.btn-inline-outline:hover { background: #1a1a2e; color: #fff !important; }

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
}
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  /* Shop layout stacks on mobile */
  .shop-layout { grid-template-columns: 1fr !important; }
  /* Checkout stacks */
  .checkout-grid { grid-template-columns: 1fr !important; }
  /* Product page stacks */
  .product-detail-grid { grid-template-columns: 1fr !important; }
  /* Order page stacks */
  .order-grid { grid-template-columns: 1fr !important; }
  /* Footer stacks */
  footer .container > div { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card-body { padding: 12px; }
  .product-card-title { font-size: 0.85rem; }
}

/* ─── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.4s ease forwards; }

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner { animation: spin 0.8s linear infinite; }

/* ─── Utility ───────────────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.text-orange { color: #ff6b35; }
.font-bold { font-weight: 700; }
