/* STYLEEY — Premium Minimal Cap Store
   Colors: Near-black #171717 · Ivory #F5F2EC · Sand #D8CBB7 · Charcoal #3B3B3B
*/

:root {
  --black: #171717;
  --ivory: #F5F2EC;
  --sand: #D8CBB7;
  --charcoal: #3B3B3B;
  --white: #FFFFFF;
  --muted: #8A8A8A;
  --border: #E8E4DC;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 1200px;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--ivory);
  color: var(--charcoal);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--black);
  line-height: 1.25;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Announcement */
.announcement {
  background: var(--black);
  color: var(--ivory);
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 0.55rem 1rem;
}

/* Header */
.site-header {
  background: var(--ivory);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}
.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--black);
  text-transform: uppercase;
}
.nav {
  display: none;
  gap: 1.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav a:hover { color: var(--black); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.header-actions a {
  font-size: 0.85rem;
  position: relative;
}
.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--black);
  color: var(--ivory);
  font-size: 0.65rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: block;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--black);
  margin: 5px 0;
}

@media (min-width: 768px) {
  .nav { display: flex; }
  .menu-toggle { display: none; }
}

/* Mobile nav */
.mobile-nav {
  display: none;
  background: var(--ivory);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem 1.5rem;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: 0.6rem 0;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

/* Hero */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: var(--ivory);
  text-align: center;
  padding: 4rem 1.25rem;
}
.hero-content h1 {
  color: var(--ivory);
  white-space: pre-line;
  margin-bottom: 1rem;
}
.hero-content p {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 420px;
  margin: 0 auto 2rem;
}
.btn {
  display: inline-block;
  background: var(--ivory);
  color: var(--black);
  padding: 0.85rem 1.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--sand); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--black);
  color: var(--black);
}
.btn-outline:hover { background: var(--black); color: var(--ivory); }
.btn-dark {
  background: var(--black);
  color: var(--ivory);
}
.btn-dark:hover { background: var(--charcoal); }

/* Sections */
.section {
  padding: 4rem 0;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.section-header a {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--charcoal);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 1rem;
}
@media (min-width: 768px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem 1.5rem; }
}
@media (min-width: 1024px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card { text-align: left; }
.product-card .img-wrap {
  background: #EDE9E1;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin-bottom: 0.85rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Fills the entire 1:1 container with no side gaps */
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
}

.product-card:hover .img-wrap img { 
  transform: scale(1.03); 
}

.product-card .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.product-card h3 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.product-card .price {
  font-size: 0.9rem;
  color: var(--charcoal);
}
.product-card .price s {
  color: var(--muted);
  margin-right: 0.4rem;
  font-size: 0.85rem;
}

/* Brand banner */
.brand-banner {
  background: var(--sand);
  text-align: center;
  padding: 4rem 1.25rem;
}
.brand-banner h2 { margin-bottom: 0.75rem; }
.brand-banner p {
  max-width: 480px;
  margin: 0 auto;
  color: var(--charcoal);
}

/* Features */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  text-align: center;
}
@media (min-width: 768px) {
  .features { grid-template-columns: repeat(3, 1fr); }
}
.feature h3 {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.feature p { font-size: 0.9rem; color: var(--muted); }

/* Footer */
.site-footer {
  background: var(--black);
  color: var(--ivory);
  padding: 3.5rem 0 2rem;
  margin-top: 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer-brand .logo { color: var(--ivory); margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.85rem; opacity: 0.7; max-width: 260px; }
.footer-col h4 {
  color: var(--ivory);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.footer-col a {
  display: block;
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.45rem;
}
.footer-col a:hover { opacity: 1; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  font-size: 0.75rem;
  opacity: 0.5;
  text-align: center;
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  color: var(--charcoal);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--black);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

/* Alerts */
.alert {
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  border-radius: var(--radius);
}
.alert-success { background: #E8F5E9; color: #1B5E20; }
.alert-error { background: #FFEBEE; color: #B71C1C; }

/* Page title */
.page-header {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}
.page-header h1 { margin-bottom: 0.5rem; }

/* Product detail */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 0 4rem;
}
@media (min-width: 768px) {
  .product-detail { grid-template-columns: 1fr 1fr; gap: 3rem; }
}
.product-gallery {
  background: #EDE9E1;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-info h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.product-info .price {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}
.product-info .price s {
  color: var(--muted);
  font-size: 1rem;
  margin-right: 0.5rem;
}
.variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.variant-options label {
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.variant-options input { display: none; }
.variant-options input:checked + span {
  background: var(--black);
  color: var(--ivory);
  border-color: var(--black);
}
.variant-options label span {
  display: block;
  border: 1px solid transparent;
  margin: -0.5rem -1rem;
  padding: 0.5rem 1rem;
}
.qty-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.qty-row input {
  width: 70px;
  text-align: center;
  padding: 0.65rem;
  border: 1px solid var(--border);
}
.product-meta {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.product-meta dt { font-weight: 600; color: var(--charcoal); margin-top: 0.75rem; }
.product-meta dd { margin-left: 0; }

/* Cart & Checkout */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.cart-table td {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cart-item {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.cart-item img, .cart-item .placeholder {
  width: 80px;
  height: 80px;
  object-fit: cover;
  background: #EDE9E1;
}
.cart-summary {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-top: 2rem;
}
.cart-summary .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.cart-summary .total {
  font-weight: 600;
  font-size: 1.1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

/* Checkout layout */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 4rem;
}
@media (min-width: 900px) {
  .checkout-grid { grid-template-columns: 1.4fr 1fr; }
}

/* Admin */
.admin-body { background: #F0EDE8; }
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--black);
  color: var(--ivory);
  padding: 1.5rem 1rem;
}
.admin-sidebar .logo {
  color: var(--ivory);
  margin-bottom: 2rem;
  display: block;
  font-size: 1.1rem;
}
.admin-sidebar a {
  display: block;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  border-radius: var(--radius);
  margin-bottom: 0.25rem;
  opacity: 0.8;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(255,255,255,0.1);
  opacity: 1;
}
.admin-main { padding: 2rem; }
.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.25rem;
}
.stat-card .label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.stat-card .value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--black);
}
.admin-table {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-collapse: collapse;
}
.admin-table th, .admin-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.admin-table th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 2px;
  background: #EEE;
}
.badge-pending { background: #FFF3E0; color: #E65100; }
.badge-confirmed, .badge-processing { background: #E3F2FD; color: #1565C0; }
.badge-shipped { background: #E8F5E9; color: #2E7D32; }
.badge-delivered { background: #E8F5E9; color: #1B5E20; }
.badge-cancelled, .badge-returned { background: #FFEBEE; color: #C62828; }
.badge-paid { background: #E8F5E9; color: #2E7D32; }

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ivory);
}
.login-box {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
}
.login-box h1 {
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.empty-state h2 { color: var(--charcoal); margin-bottom: 0.75rem; }

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
