/* ===================================================
   VIOLET STORE - Modern Purple Theme Stylesheet
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-dark: #4c1d95;
  --primary-darker: #2e1065;
  --primary-light: #f3e8ff;
  --primary-soft: #ede9fe;
  --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #4c1d95 100%);
  --secondary: #a855f7;
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #ef4444;

  --bg-page: #f9f8fe;
  --bg-card: #ffffff;
  --bg-subtle: #f4f2fb;
  --text-main: #1e1b4b;
  --text-body: #334155;
  --text-muted: #64748b;
  --border-color: #e9e5f5;
  --border-focus: #a855f7;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 6px rgba(124, 58, 237, 0.06);
  --shadow-md: 0 6px 18px rgba(124, 58, 237, 0.1);
  --shadow-lg: 0 12px 30px rgba(124, 58, 237, 0.14);
  --shadow-purple: 0 8px 20px rgba(124, 58, 237, 0.28);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===================================================
   Header & Navigation
   =================================================== */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(76, 29, 149, 0.05);
}

.top-bar {
  background: var(--primary-darker);
  color: #e9d5ff;
  font-size: 0.82rem;
  padding: 6px 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-main {
  padding: 14px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
}

.brand-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-purple);
}

.brand-logo span span {
  color: var(--primary);
}

.header-search {
  flex: 1;
  max-width: 540px;
}

.search-form {
  display: flex;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 11px 48px 11px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s ease;
}

.search-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.search-btn:hover {
  background: var(--primary-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.cart-btn {
  background: var(--primary-light);
  color: var(--primary-dark);
  position: relative;
  font-weight: 600;
}

.cart-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-darker);
  transform: translateY(-1px);
}

.cart-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: 2px;
}

.admin-link-btn {
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.admin-link-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Category Navigation Sub-bar */
.nav-categories {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 8px 0;
  overflow-x: auto;
}

.cat-list {
  display: flex;
  gap: 10px;
  list-style: none;
  white-space: nowrap;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.cat-chip:hover, .cat-chip.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: #d8b4fe;
  font-weight: 600;
}

/* ===================================================
   Hero Banner
   =================================================== */
.hero-banner {
  background: var(--primary-gradient);
  color: #ffffff;
  padding: 48px 0;
  position: relative;
  overflow: hidden;
  margin-bottom: 36px;
  box-shadow: var(--shadow-purple);
}

.hero-banner::after {
  content: '';
  position: absolute;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  border-radius: 50%;
  right: -100px;
  top: -100px;
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 32px;
  position: relative;
  z-index: 2;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 500;
  margin-bottom: 14px;
  color: #f3e8ff;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 14px;
}

.hero-desc {
  font-size: 1.05rem;
  color: #e9d5ff;
  margin-bottom: 24px;
  max-width: 520px;
}

.hero-features {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-feat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #f3e8ff;
}

.hero-feat-item i {
  color: #fbbf24;
}

/* ===================================================
   Product Cards & Grid
   =================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 5px;
  height: 24px;
  background: var(--primary);
  border-radius: 4px;
  display: inline-block;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #d8b4fe;
}

.product-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 Aspect ratio */
  background: #f1f5f9;
  overflow: hidden;
}

.product-thumb-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-thumb-wrap img {
  transform: scale(1.06);
}

.product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-sale {
  background: var(--accent-pink);
  color: white;
}

.badge-featured {
  background: var(--primary);
  color: white;
}

.badge-stock {
  background: rgba(15, 23, 42, 0.7);
  color: white;
  backdrop-filter: blur(4px);
}

.badge-stock.out {
  background: var(--accent-rose);
}

.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.product-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}

.product-title a {
  color: inherit;
}

.product-title a:hover {
  color: var(--primary);
}

.product-price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}

.current-price {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.original-price {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.btn-add-cart {
  width: 100%;
  padding: 10px 14px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #d8b4fe;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-add-cart:hover:not(:disabled) {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
  transform: translateY(-1px);
}

.btn-add-cart:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #94a3b8;
}

/* ===================================================
   Product Detail Page
   =================================================== */
.product-detail-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 48px;
}

.detail-img-box {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--border-color);
}

.detail-img-box img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
}

.detail-info {
  display: flex;
  flex-direction: column;
}

.detail-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 12px;
}

.detail-price-box {
  background: var(--primary-light);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 16px 0 24px;
}

.detail-desc {
  font-size: 0.98rem;
  line-height: 1.8;
  color: #475569;
  margin-bottom: 24px;
  white-space: pre-line;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
}

.qty-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: #f8fafc;
  color: var(--text-body);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s;
}

.qty-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.qty-input {
  width: 54px;
  height: 38px;
  border: none;
  text-align: center;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  outline: none;
}

/* ===================================================
   Shopping Cart Table & Summary
   =================================================== */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 30px;
  align-items: start;
  margin-bottom: 48px;
}

.cart-table-card, .cart-summary-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
}

.cart-table td {
  padding: 16px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: #f8fafc;
}

.btn-remove-item {
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.2s;
}

.btn-remove-item:hover {
  color: var(--accent-rose);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.summary-row.total {
  border-top: 2px dashed var(--border-color);
  padding-top: 16px;
  margin-top: 16px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.btn-checkout {
  width: 100%;
  padding: 14px;
  background: var(--primary-gradient);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-purple);
  transition: all 0.2s ease;
}

.btn-checkout:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  color: #ffffff;
}

/* ===================================================
   Checkout & Forms
   =================================================== */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 48px;
}

.form-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  background: #ffffff;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.payment-card-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.payment-card-label:hover, input[name="payment_method"]:checked + .payment-card-label {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ===================================================
   Status Badges & Stepper (Orders)
   =================================================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #dbeafe; color: #1e40af; }
.status-shipping { background: #ede9fe; color: #6b21a8; }
.status-completed { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.track-stepper {
  display: flex;
  justify-content: space-between;
  margin: 36px 0;
  position: relative;
}

.track-stepper::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 40px;
  right: 40px;
  height: 4px;
  background: var(--border-color);
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.step-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 8px;
  transition: all 0.3s;
}

.step-item.active .step-icon {
  background: var(--primary);
  border-color: var(--primary-light);
  color: white;
  box-shadow: 0 0 0 5px rgba(124, 58, 237, 0.2);
}

.step-item.passed .step-icon {
  background: var(--accent-emerald);
  border-color: #a7f3d0;
  color: white;
}

.step-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.step-item.active .step-label {
  color: var(--primary-dark);
}

/* ===================================================
   Toast Notifications
   =================================================== */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: 0.92rem;
  font-weight: 500;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: var(--primary); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===================================================
   Footer
   =================================================== */
.site-footer {
  margin-top: auto;
  background: var(--primary-darker);
  color: #c4b5fd;
  padding: 48px 0 24px;
  border-top: 3px solid var(--primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}

.footer-title {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #ddd6fe;
}

.footer-links a:hover {
  color: #ffffff;
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: #a78bfa;
}

/* ===================================================
   Responsive Mobile Adjustments
   =================================================== */
@media (max-width: 900px) {
  .hero-content, .cart-layout, .checkout-layout, .product-detail-card {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .header-search {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .payment-options {
    grid-template-columns: 1fr;
  }
}
