/* BargainBay Shared Styles - matches landing page design */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

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

:root {
  --orange: #FF6B35;
  --orange-light: #FF8F5E;
  --orange-bg: rgba(255, 107, 53, 0.08);
  --navy: #0B1D3A;
  --navy-light: #132D54;
  --cream: #FFF8F0;
  --teal: #00C9A7;
  --teal-bg: rgba(0, 201, 167, 0.1);
  --gray: #6B7B8D;
  --gray-light: #E8ECF0;
  --white: #ffffff;
  --shadow: 0 4px 24px rgba(11, 29, 58, 0.06);
  --shadow-hover: 0 8px 32px rgba(11, 29, 58, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--navy);
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

a { color: inherit; text-decoration: none; }

/* ============= NAV ============= */
.store-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.store-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--navy);
  letter-spacing: -0.5px;
}

.store-nav .logo span { color: var(--orange); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--navy); }

.nav-links a.active { color: var(--orange); font-weight: 600; }

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--navy) !important;
  transition: box-shadow 0.2s, transform 0.2s;
}

.cart-link:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }

.cart-badge {
  background: var(--orange);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cart-badge:empty, .cart-badge[data-count="0"] { display: none; }

/* ============= LAYOUT ============= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

.page-header {
  padding: 2rem 0 1.5rem;
}

.page-header h1 {
  font-size: 2rem;
  letter-spacing: -1px;
}

.page-header p {
  color: var(--gray);
  margin-top: 0.5rem;
  font-size: 1rem;
}

.breadcrumb {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--gray); }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb span { color: var(--navy); font-weight: 500; }

/* ============= CATEGORY FILTERS ============= */
.category-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--gray-light);
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray);
  background: var(--white);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.category-pill:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.category-pill.active {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}

/* ============= SORT & SEARCH ============= */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  flex: 1;
  max-width: 360px;
  transition: border-color 0.2s;
}

.search-box:focus-within { border-color: var(--orange); }

.search-box input {
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  width: 100%;
  background: transparent;
  color: var(--navy);
}

.sort-select {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  outline: none;
}

.sort-select:focus { border-color: var(--orange); }

.result-count {
  font-size: 0.85rem;
  color: var(--gray);
}

/* ============= PRODUCT GRID ============= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
}

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

.product-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--cream) 0%, var(--gray-light) 100%);
  display: block;
}

.product-card-body {
  padding: 1.25rem;
}

.product-card .category-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray);
  margin-bottom: 0.4rem;
}

.product-card .product-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product-card .product-desc {
  font-size: 0.82rem;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prices {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.our-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--orange);
}

.old-price {
  font-size: 0.85rem;
  color: #bbb;
  text-decoration: line-through;
}

.savings-badge {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.shipping-tag {
  display: inline-block;
  margin-top: 0.5rem;
  margin-left: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--orange);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
}

/* ============= BUTTONS ============= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: var(--radius-xs);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:hover { background: var(--orange-light); transform: translateY(-1px); }

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--gray-light);
}

.btn-secondary:hover { border-color: var(--orange); color: var(--orange); }

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

.btn-navy:hover { background: var(--navy-light); }

.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }

.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }

.btn-full { width: 100%; }

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-xs);
  background: transparent;
  border: 1.5px solid var(--gray-light);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.2s;
}

.btn-icon:hover { border-color: var(--orange); color: var(--orange); }

/* ============= PRODUCT DETAIL ============= */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 1rem 0 3rem;
  align-items: start;
}

.product-image-main {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 1;
  object-fit: cover;
  background: linear-gradient(135deg, var(--cream) 0%, var(--gray-light) 100%);
}

.product-info h1 {
  font-size: 2rem;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}

.product-info .category-tag {
  font-size: 0.8rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.product-info .prices {
  margin-bottom: 0.5rem;
}

.product-info .our-price { font-size: 2rem; }
.product-info .old-price { font-size: 1.1rem; }

.product-info .description {
  font-size: 1rem;
  color: var(--gray);
  line-height: 1.7;
  margin: 1.5rem 0;
}

.product-meta {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.product-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.product-meta-item strong { color: var(--navy); }

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.quantity-selector label {
  font-weight: 600;
  font-size: 0.9rem;
}

.quantity-control {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.quantity-control button {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.quantity-control button:hover { background: var(--cream); }

.quantity-control input {
  width: 50px;
  height: 36px;
  border: none;
  border-left: 1.5px solid var(--gray-light);
  border-right: 1.5px solid var(--gray-light);
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  outline: none;
}

.add-to-cart-actions {
  display: flex;
  gap: 0.75rem;
}

/* ============= CART ============= */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  padding: 1rem 0 3rem;
  align-items: start;
}

.cart-items { display: flex; flex-direction: column; gap: 1rem; }

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1.25rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  align-items: center;
}

.cart-item-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--cream);
}

.cart-item-info .product-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.cart-item-info .category-tag {
  font-size: 0.75rem;
  color: var(--gray);
}

.cart-item-info .prices { margin-top: 0.5rem; }

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.cart-item-total {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}

.remove-btn {
  font-size: 0.8rem;
  color: #e74c3c;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

.remove-btn:hover { text-decoration: underline; }

/* Cart Summary */
.cart-summary {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 2rem;
}

.cart-summary h3 {
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--gray-light);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.summary-row.savings { color: var(--teal); font-weight: 600; }

.summary-row.total {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1.5px solid var(--gray-light);
}

.checkout-form { margin-top: 1.25rem; }

.checkout-form input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-xs);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  outline: none;
  transition: border-color 0.2s;
}

.checkout-form input:focus { border-color: var(--orange); }

.empty-cart {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-cart h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.empty-cart p { color: var(--gray); margin-bottom: 1.5rem; }

/* ============= ADMIN ============= */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--navy);
}

.admin-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.admin-section h2 {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--gray-light);
}

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

.product-form .full-width { grid-column: 1 / -1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-xs);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  color: var(--navy);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--orange); }

.form-group textarea { resize: vertical; min-height: 80px; }

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

.product-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
  padding: 0.75rem 1rem;
  border-bottom: 1.5px solid var(--gray-light);
}

.product-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-light);
  font-size: 0.9rem;
  vertical-align: middle;
}

.product-table tr:hover { background: var(--cream); }

.product-table .product-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  background: var(--cream);
}

.status-active { color: var(--teal); font-weight: 600; }
.status-inactive { color: #e74c3c; font-weight: 600; }

/* ============= SUCCESS PAGE ============= */
.success-page {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.success-page h1 {
  font-size: 2rem;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}

.success-page .order-number {
  font-size: 1.1rem;
  color: var(--gray);
  margin-bottom: 2rem;
}

.order-details {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: left;
  margin-bottom: 2rem;
}

.order-details h3 { margin-bottom: 1rem; font-size: 1rem; }

.order-item-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-light);
}

.order-item-row:last-child { border: none; }

.order-total-row {
  display: flex;
  justify-content: space-between;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 2px solid var(--navy);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ============= FOOTER ============= */
.store-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--gray-light);
}

.store-footer .logo { font-size: 1.2rem; }
.store-footer .logo span { color: var(--orange); }

.store-footer p {
  font-size: 0.8rem;
  color: var(--gray);
}

/* ============= TOAST ============= */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--navy);
  color: var(--white);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(11, 29, 58, 0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.show { transform: translateY(0); opacity: 1; }

/* ============= LOADING ============= */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: var(--gray);
  font-size: 0.9rem;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-light);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 0.75rem;
}

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

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
  .product-detail { grid-template-columns: 1fr; gap: 1.5rem; }
  .cart-layout { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .product-form { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
  .store-nav { padding: 1rem 5%; }
  .nav-links { gap: 0.75rem; }
  .store-footer { flex-direction: column; gap: 0.75rem; text-align: center; }
  .cart-item { grid-template-columns: 60px 1fr; }
  .cart-item-actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
  .category-bar { gap: 0.35rem; }
  .category-pill { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
  .add-to-cart-actions { flex-direction: column; }
}
