/* ============================================
   SHOPIFY-STYLE eCOMMERCE — style.css
   Aesthetic: Clean editorial with warm cream tones
   Fonts: Playfair Display + DM Sans
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ── */
:root {
  --cream:      #f8f4ef;
  --warm-white: #fdfbf8;
  --charcoal:   #1a1a1a;
  --brown:      #6b4f3a;
  --accent:     #c8956c;
  --accent-dark:#a3704a;
  --muted:      #9e8e82;
  --border:     #e8dfd6;
  --success:    #4caf50;
  --danger:     #e05c5c;
  --card-bg:    #ffffff;
  --shadow-sm:  0 2px 8px rgba(107,79,58,.08);
  --shadow-md:  0 6px 24px rgba(107,79,58,.12);
  --radius:     12px;
  --radius-sm:  8px;
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Navbar ── */
.navbar {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 2rem;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brown);
  text-decoration: none;
  letter-spacing: -.5px;
}

.nav-brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .3px;
  transition: color var(--transition);
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
  border-radius: 2px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--brown);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* ── Hero Banner (Home) ── */
.hero {
  background: linear-gradient(135deg, var(--brown) 0%, #4a3428 100%);
  color: white;
  text-align: center;
  padding: 5rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { position: relative; z-index: 1; }

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: .75rem;
  letter-spacing: -1px;
}

.hero p {
  font-size: 1.1rem;
  opacity: .8;
  font-weight: 300;
  max-width: 500px;
  margin: 0 auto;
}

/* ── Section Wrapper ── */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: .4rem;
}

.section-subtitle {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 2.5rem;
}

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

/* ── Product Card ── */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: cardIn .35s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: var(--cream);
}

.product-card-body {
  padding: 1.1rem 1.2rem 1.4rem;
}

.product-card-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--charcoal);
  margin-bottom: .35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--accent-dark);
  font-weight: 600;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}

.empty-state svg { margin-bottom: 1rem; opacity: .35; }
.empty-state p   { font-size: 1rem; }

/* ── ADMIN PAGE LAYOUT ── */
.admin-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.admin-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--brown);
  margin-bottom: .4rem;
}

.admin-subtitle {
  color: var(--muted);
  margin-bottom: 2.5rem;
}

/* ── Cards (Auth + Management) ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--brown);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: .4rem;
  letter-spacing: .2px;
}

.form-group input {
  width: 100%;
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  background: var(--warm-white);
  color: var(--charcoal);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,149,108,.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .7rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(200,149,108,.4);
}

.btn-outline {
  background: transparent;
  color: var(--brown);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: rgba(200,149,108,.06);
}

.btn-danger {
  background: var(--danger);
  color: white;
  padding: .4rem .85rem;
  font-size: .82rem;
  border-radius: 6px;
}

.btn-danger:hover {
  background: #c04a4a;
  transform: translateY(-1px);
}

.btn-google {
  width: 100%;
  background: white;
  color: #444;
  border: 1.5px solid var(--border);
  margin-top: 1rem;
  justify-content: center;
}

.btn-google:hover {
  background: #fafafa;
  border-color: #aaa;
}

.btn-full { width: 100%; }

.btn-group {
  display: flex;
  gap: .75rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}

/* ── Auth tab switcher ── */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  padding: .65rem;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.auth-tab.active {
  color: var(--brown);
  border-bottom-color: var(--accent);
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1.2rem 0;
  color: var(--muted);
  font-size: .82rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Product List (Admin) ── */
#admin-product-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 1.5rem;
}

.admin-product-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: cardIn .3s ease both;
  transition: box-shadow var(--transition);
}

.admin-product-item:hover {
  box-shadow: var(--shadow-sm);
}

.admin-product-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--cream);
  flex-shrink: 0;
}

.admin-product-info {
  flex: 1;
  min-width: 0;
}

.admin-product-name {
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-product-price {
  font-size: .85rem;
  color: var(--accent-dark);
  font-weight: 500;
}

/* ── Toast / Alert ── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: .85rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .9rem;
  color: white;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  z-index: 1000;
  animation: toastIn .3s ease;
  max-width: 320px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--brown); }

/* ── Status badge ── */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--cream);
  border: 1px solid var(--border);
  padding: .5rem 1rem;
  border-radius: 50px;
  font-size: .85rem;
  color: var(--brown);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.user-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

/* ── Hidden utility ── */
.hidden { display: none !important; }

/* ── Loading spinner ── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 600px) {
  .navbar { padding: 0 1rem; }
  .nav-brand { font-size: 1.25rem; }
  .nav-links { gap: 1.2rem; }
  .form-row { grid-template-columns: 1fr; }
  .admin-wrapper, .section { padding: 2rem 1rem; }
  .hero { padding: 3.5rem 1.2rem; }
  .toast { right: 1rem; left: 1rem; max-width: unset; }
}

/* ── Image Upload Box ── */
.upload-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--warm-white);
  transition: border-color var(--transition), background var(--transition);
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .5rem;
}

.upload-box:hover {
  border-color: var(--accent);
  background: rgba(200,149,108,.04);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
}

.upload-placeholder p {
  font-weight: 600;
  font-size: .95rem;
  color: var(--brown);
  margin: 0;
}

.upload-placeholder span {
  font-size: .78rem;
  color: var(--muted);
}

/* Progress bar */
.progress-wrap {
  margin-top: .75rem;
  background: var(--border);
  border-radius: 50px;
  height: 8px;
  position: relative;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 50px;
  width: 0%;
  transition: width .2s ease;
}

.progress-label {
  display: block;
  text-align: right;
  font-size: .78rem;
  color: var(--muted);
  margin-top: .3rem;
}

/* ── Description textarea ── */
.form-group textarea {
  width: 100%;
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  background: var(--warm-white);
  color: var(--charcoal);
  resize: vertical;
  min-height: 90px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  line-height: 1.6;
}

.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,149,108,.15);
}

/* ── Product card description ── */
.product-card-desc {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Admin list description ── */
.admin-product-desc {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}