/* The T-Shirt Grind - Main Stylesheet */
/* Colour tokens and design system */

:root {
  --color-orange: #E8862A;
  --color-cream: #FDF6EC;
  --color-text: #1A1A1A;
  --color-text-muted: #666;
  --color-white: #FFFFFF;
  --color-footer: #F5F5F5;
  --color-paypal: #0070BA;
  --color-border: #E0E0E0;
  --border-radius: 8px;
  --breakpoint-tablet: 768px;
  --max-width: 1200px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

a {
  color: var(--color-orange);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main {
  flex: 1;
  padding: 2rem 0;
}

/* Header / Nav */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.125rem;
}

.logo-link:hover {
  text-decoration: none;
  color: var(--color-text);
}

.logo-svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

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

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

.nav-center a:hover {
  color: var(--color-orange);
  text-decoration: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-right a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-right a:hover {
  color: var(--color-orange);
  text-decoration: none;
}

.cart-link {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--color-orange);
  color: var(--color-white);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cart-badge.empty {
  display: none;
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: 0.3s;
}

.nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-mobile.open {
  display: flex;
}

@media (max-width: 768px) {
  .nav-center {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .nav-mobile.open {
    display: flex;
  }
}

/* Hero */
.hero {
  background: var(--color-cream);
  padding: 3rem 1.25rem;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.hero p {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  border: none;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s;
  font-family: inherit;
}

.btn:hover {
  opacity: 0.9;
}

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

.btn-secondary {
  background: var(--color-white);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-paypal {
  background: var(--color-paypal);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Product grid & cards */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.product-card {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card-image-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-white);
}

.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.product-card .price {
  color: var(--color-orange);
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.product-card .btn {
  margin-top: auto;
}

@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

/* Filters */
.filters-box {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.filters-box h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.filters-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.filters-inner label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.filters-inner select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: 1rem;
  background: var(--color-white);
  min-width: 140px;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.products-count {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Breadcrumbs */
.breadcrumb {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-orange);
}

/* Product detail page */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

.back-link:hover {
  color: var(--color-orange);
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.product-detail-image {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  aspect-ratio: 1;
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-info h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.product-detail-info .price {
  color: var(--color-orange);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.product-detail-info .description {
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: 1rem;
  background: var(--color-white);
}

.product-detail-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.validation-message {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
  }
}

/* Cart page */
.cart-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.cart-items-box {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.cart-items-box h3 {
  margin-bottom: 1rem;
}

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

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--color-white);
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.cart-item-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cart-item-options {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.cart-item-unit-price {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-item-qty button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.cart-item-qty input {
  width: 48px;
  text-align: center;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: 1rem;
}

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

.cart-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text-muted);
}

.cart-item-remove:hover {
  color: #c00;
}

.order-summary-box {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  position: sticky;
  top: 100px;
}

.order-summary-box h3 {
  margin-bottom: 1rem;
}

.order-summary-box .summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.order-summary-box .summary-row.total {
  font-weight: 700;
  font-size: 1.125rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.order-summary-box .btn {
  width: 100%;
  margin-top: 1rem;
}

.order-summary-box .btn-secondary {
  margin-top: 0.5rem;
}

.order-summary-box ul {
  margin-top: 1rem;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.order-summary-box li {
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .order-summary-box {
    position: static;
  }
}

/* Checkout */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.checkout-order-summary {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.checkout-order-summary h3 {
  margin-bottom: 0.5rem;
}

.checkout-order-summary .subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.checkout-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.checkout-item:last-of-type {
  border-bottom: none;
}

.checkout-item-image {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.checkout-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.checkout-payment {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.checkout-payment h3 {
  margin-bottom: 0.5rem;
}

.billing-info {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin: 1rem 0;
}

.billing-info p {
  margin-bottom: 0.25rem;
}

.security-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 1rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.demo-notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.terms-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.site-footer {
  background: var(--color-footer);
  padding: 2rem 1.25rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-inner h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.footer-inner p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Login form */
.login-form-wrap {
  max-width: 400px;
  margin: 2rem auto;
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 2rem;
}

.login-form-wrap h1 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-form-wrap .form-group {
  margin-bottom: 1rem;
}

.login-form-wrap input[type="email"],
.login-form-wrap input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: 1rem;
}

.login-form-wrap .btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem;
}

/* Page headings */
.page-heading {
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* Payment success / fail */
.result-box {
  max-width: 600px;
  margin: 2rem auto;
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
}

.result-box.success {
  border-left: 4px solid #28a745;
}

.result-box.fail {
  border-left: 4px solid #dc3545;
}

.result-box h1 {
  margin-bottom: 1rem;
}

.result-box .btn {
  margin-top: 1rem;
  margin-right: 0.5rem;
}

/* Dashboard */
.dashboard-section {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

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

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  background: var(--color-white);
}

.status-select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Admin Add Product form */
.admin-add-product-form {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.admin-add-product-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-add-product-form .form-row-2 .form-group {
  flex: 1 1 200px;
  min-width: 0;
}

.admin-add-product-form .form-actions {
  margin-bottom: 0;
  margin-top: 1rem;
}

.admin-add-product-form .form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text);
}

.admin-add-product-form .form-group input[type="text"],
.admin-add-product-form .form-group input[type="number"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-white);
  color: var(--color-text);
}

.admin-add-product-form .form-group input:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 2px rgba(232, 134, 42, 0.2);
}

.admin-add-product-form .form-group input::placeholder {
  color: var(--color-text-muted);
}

/* Featured products section */
.featured-section {
  padding: 2rem 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}
