/* TillKit Starter Styles */

:root {
  --primary: #0070f3;
  --primary-dark: #0051a8;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --bg: #ffffff;
  --bg-muted: #f5f5f5;
  --text: #111111;
  --text-muted: #666666;
  --border: #e5e5e5;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Navigation */
nav {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

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

nav a:first-child {
  font-weight: 700;
  font-size: 1.2em;
  margin-right: auto;
}

/* Typography */
h1, h2, h3 {
  margin-bottom: 20px;
  line-height: 1.2;
}

h1 { font-size: 2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.2em; }

p {
  margin-bottom: 15px;
  color: var(--text-muted);
}

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

/* Buttons */
button, .button-primary {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1em;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}

button:hover, .button-primary:hover {
  background: var(--primary-dark);
}

button.danger {
  background: var(--error);
  padding: 8px 12px;
}

/* Forms */
input, select, textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1em;
  width: 100%;
  max-width: 300px;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Flash Messages */
.flash {
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.flash-success {
  background: #d1fae5;
  color: #065f46;
}

.flash-error {
  background: #fee2e2;
  color: #991b1b;
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-muted);
  border-radius: var(--radius);
  margin-bottom: 40px;
}

/* Products */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card img, .placeholder-image {
  width: 100%;
  height: 200px;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.product-card h3 {
  padding: 15px 15px 5px;
  margin: 0;
  font-size: 1.1em;
}

.product-card .price {
  padding: 0 15px;
  color: var(--primary);
  font-weight: 600;
  margin: 0 0 10px;
}

.product-card form {
  padding: 0 15px 15px;
}

.product-card button {
  width: 100%;
}

.price {
  font-size: 1.25em;
  font-weight: 600;
  color: var(--primary);
}

/* Product Detail */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.product-images {
  background: var(--bg-muted);
  border-radius: var(--radius);
  min-height: 400px;
}

.product-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.product-info .price {
  font-size: 1.5em;
}

.quantity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.quantity input {
  width: 80px;
}

/* Search */
.search {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.search input {
  flex: 1;
  max-width: 400px;
}

/* Cart */
.cart-items {
  margin-bottom: 30px;
}

.cart-item {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

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

.cart-item .item-details {
  flex: 1;
}

.cart-item .item-details h3 {
  margin: 0 0 5px;
}

.cart-item .item-quantity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-item .item-quantity input {
  width: 60px;
}

.cart-item .item-total {
  font-weight: 600;
  min-width: 100px;
  text-align: right;
}

.cart-totals {
  max-width: 400px;
  margin-left: auto;
  padding: 20px;
  background: var(--bg-muted);
  border-radius: var(--radius);
}

.total-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.total-line.total-final {
  font-size: 1.25em;
  font-weight: 700;
  border: none;
  margin-top: 10px;
  padding-top: 20px;
}

.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
}

/* Admin */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.filters {
  display: flex;
  gap: 15px;
}

.filters a {
  padding: 8px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: var(--bg-muted);
}

.filters a.active {
  background: var(--primary);
  color: white;
}

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

.admin-table th,
.admin-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  font-weight: 600;
  color: var(--text-muted);
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 500;
  text-transform: capitalize;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-fulfilled { background: #dbeafe; color: #1e40af; }
.status-shipped { background: #e0e7ff; color: #3730a3; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-refunded { background: #fce7f3; color: #9d174d; }
.status-success { background: #d1fae5; color: #065f46; }
.status-failure { background: #fee2e2; color: #991b1b; }

.pagination {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
}

/* Dashboard */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 20px;
  background: var(--bg-muted);
  border-radius: var(--radius);
  text-align: center;
}

.stat-card h3 {
  font-size: 0.9em;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 1.75em;
  font-weight: 700;
  color: var(--primary);
}

.admin-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.admin-card {
  padding: 30px;
  background: var(--bg-muted);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
}

.admin-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-card h3 {
  margin-bottom: 10px;
}

.admin-card p {
  margin: 0;
}

/* Order Details */
.order-details {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.order-section {
  padding: 20px;
  background: var(--bg-muted);
  border-radius: var(--radius);
}

.order-section h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.items-table, .transactions-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.items-table th,
.items-table td,
.transactions-table th,
.transactions-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.items-table th,
.transactions-table th {
  font-weight: 600;
  color: var(--text-muted);
}

.totals {
  max-width: 300px;
  margin-left: auto;
}

.admin-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Success Page */
.success-page {
  text-align: center;
  padding: 60px 20px;
}

.success-page h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
}

/* Empty States */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
  
  .cart-item {
    flex-wrap: wrap;
  }
  
  .cart-item .item-total {
    width: 100%;
    text-align: left;
    margin-top: 10px;
  }
  
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .filters {
    flex-wrap: wrap;
  }
}
