/**
 * Sweet Loops by Stef Storefront Styles
 * Brand colors: warm peach/copper, sage green, cream background
 */

:root {
  --sl-peach: #d4956a;
  --sl-sage: #8fa88c;
  --sl-cream: #f7f6f3;
  --sl-text: #2b2a2e;
  --sl-text-light: #666;
  --sl-border: #e0ddd8;
}

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

body.sweetloops-body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--sl-cream);
  color: var(--sl-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.sl-header {
  background: white;
  border-bottom: 1px solid var(--sl-border);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sl-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.sl-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--sl-text);
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
}

.sl-logo-img {
  height: 60px;
  width: auto;
  display: block;
}

.sl-tagline {
  color: var(--sl-text-light);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  margin: 0;
}

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

.sl-nav a {
  text-decoration: none;
  color: var(--sl-text);
  font-weight: 500;
  transition: color 0.2s;
}

.sl-nav a:hover,
.sl-nav a.active {
  color: var(--sl-peach);
}

.sl-cart-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--sl-peach);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Content */
.sl-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

/* Hero Section */
.sl-hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.sl-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  color: var(--sl-text);
  margin-bottom: 1rem;
}

.sl-hero-intro {
  font-size: 1.1rem;
  color: var(--sl-text);
  max-width: 800px;
  margin: 0 auto 1rem;
  line-height: 1.8;
}

.sl-hero-mission {
  font-size: 1rem;
  color: var(--sl-text-light);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Filters */
.sl-filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.sl-filter-pill {
  padding: 0.5rem 1.25rem;
  background: white;
  border: 2px solid var(--sl-border);
  border-radius: 25px;
  text-decoration: none;
  color: var(--sl-text);
  font-weight: 500;
  transition: all 0.2s;
}

.sl-filter-pill:hover {
  border-color: var(--sl-sage);
  background: #f9f9f9;
}

.sl-filter-pill.active {
  background: var(--sl-peach);
  border-color: var(--sl-peach);
  color: white;
}

/* Products Grid */
.sl-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.sl-products-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.sl-product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--sl-text);
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sl-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.sl-product-card-img {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--sl-cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.sl-product-placeholder {
  color: var(--sl-text-light);
  font-size: 0.9rem;
}

.sl-product-card-info {
  padding: 1.25rem;
}

.sl-product-card-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--sl-text);
}

.sl-product-category {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--sl-sage);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.sl-product-card-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sl-price-compare {
  text-decoration: line-through;
  color: var(--sl-text-light);
  font-size: 0.9rem;
}

.sl-price-current {
  font-weight: 600;
  color: var(--sl-peach);
  font-size: 1.1rem;
}

/* Product Detail */
.sl-product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.sl-product-detail-gallery {
  position: sticky;
  top: 100px;
  align-self: start;
}

.sl-product-main-img {
  width: 100%;
  aspect-ratio: 1;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.sl-product-thumbs {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
}

.sl-product-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s;
  background: white;
}

.sl-product-thumb:hover,
.sl-product-thumb.active {
  border-color: var(--sl-peach);
}

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

.sl-product-category-tag {
  display: inline-block;
  background: var(--sl-sage);
  color: white;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.sl-product-detail-info h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--sl-text);
}

.sl-product-detail-price {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sl-price-compare-lg {
  text-decoration: line-through;
  color: var(--sl-text-light);
  font-size: 1.2rem;
}

.sl-price-current-lg {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--sl-peach);
}

.sl-product-description {
  color: var(--sl-text);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.sl-add-to-cart-form {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sl-quantity-selector {
  margin-bottom: 1.5rem;
}

.sl-quantity-selector label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--sl-text);
}

.sl-qty-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sl-qty-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--sl-border);
  background: white;
  color: var(--sl-text);
  font-size: 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.sl-qty-btn:hover {
  border-color: var(--sl-peach);
  background: var(--sl-cream);
}

.sl-qty-controls input {
  width: 80px;
  text-align: center;
  padding: 0.75rem;
  border: 2px solid var(--sl-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.sl-btn-add-to-cart {
  width: 100%;
  padding: 1rem 2rem;
  background: var(--sl-peach);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.sl-btn-add-to-cart:hover {
  background: #c08558;
  transform: translateY(-2px);
}

.sl-btn-add-to-cart:active {
  transform: translateY(0);
}

/* Related Products */
.sl-related-products {
  margin-top: 4rem;
  padding-top: 4rem;
  border-top: 1px solid var(--sl-border);
}

.sl-related-products h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--sl-text);
}

/* Cart Page */
.sl-cart-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.sl-cart-empty h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--sl-text);
}

.sl-cart-empty p {
  color: var(--sl-text-light);
  margin-bottom: 2rem;
}

.sl-cart {
  max-width: 1000px;
  margin: 0 auto;
}

.sl-cart h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--sl-text);
}

.sl-cart-items {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sl-cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--sl-border);
}

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

.sl-cart-item-img {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--sl-cream);
}

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

.sl-cart-item-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: var(--sl-text);
}

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

.sl-cart-item-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sl-cart-qty-form input {
  width: 60px;
  padding: 0.5rem;
  text-align: center;
  border: 2px solid var(--sl-border);
  border-radius: 6px;
  font-family: inherit;
}

.sl-btn-remove {
  padding: 0.5rem 1rem;
  background: transparent;
  color: #c44;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
}

.sl-cart-item-total {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--sl-text);
}

.sl-cart-summary {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sl-cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  color: var(--sl-text);
}

.sl-cart-summary-total {
  font-size: 1.3rem;
  font-weight: 600;
  border-top: 2px solid var(--sl-border);
  padding-top: 1rem;
  margin-top: 0.5rem;
  color: var(--sl-peach);
}

.sl-cart-shipping-note {
  text-align: center;
  color: var(--sl-text-light);
  font-size: 0.9rem;
  margin: 1rem 0;
}

.sl-btn-primary {
  display: block;
  width: 100%;
  padding: 1rem 2rem;
  background: var(--sl-peach);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-bottom: 1rem;
}

.sl-btn-primary:hover {
  background: #c08558;
  transform: translateY(-2px);
}

.sl-btn-secondary {
  display: block;
  width: 100%;
  padding: 1rem 2rem;
  background: white;
  color: var(--sl-text);
  border: 2px solid var(--sl-border);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.sl-btn-secondary:hover {
  border-color: var(--sl-sage);
  background: var(--sl-cream);
}

/* Checkout Page */
.sl-checkout {
  max-width: 800px;
  margin: 0 auto;
}

.sl-checkout h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--sl-text);
}

.sl-checkout-form {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sl-checkout-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--sl-border);
}

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

.sl-checkout-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--sl-text);
}

.sl-form-group {
  margin-bottom: 1.25rem;
}

.sl-form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--sl-text);
}

.sl-form-group input,
.sl-form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--sl-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.sl-form-group input:focus,
.sl-form-group textarea:focus {
  outline: none;
  border-color: var(--sl-peach);
}

.sl-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.sl-checkout-summary {
  background: var(--sl-cream);
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 2rem;
}

.sl-checkout-summary h3 {
  font-family: 'Playfair Display', serif;
  margin-bottom: 1rem;
  color: var(--sl-text);
}

.sl-checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  color: var(--sl-text);
}

.sl-checkout-total {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 2px solid var(--sl-border);
  margin-top: 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--sl-peach);
}

/* Order Confirmation */
.sl-order-confirmation {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.sl-confirmation-icon {
  width: 80px;
  height: 80px;
  background: var(--sl-sage);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0 auto 2rem;
}

.sl-order-confirmation h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--sl-text);
}

.sl-order-number {
  font-size: 1.2rem;
  color: var(--sl-peach);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.sl-order-confirmation p {
  color: var(--sl-text);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* Footer */
.sl-footer {
  background: white;
  border-top: 1px solid var(--sl-border);
  padding: 2rem 0;
  margin-top: auto;
}

.sl-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

.sl-footer p {
  color: var(--sl-text-light);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.sl-footer-contact a {
  color: var(--sl-peach);
  text-decoration: none;
}

.sl-footer-contact a:hover {
  text-decoration: underline;
}

/* Empty State */
.sl-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--sl-text-light);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .sl-header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .sl-logo-img {
    height: 50px;
  }

  .sl-hero h1 {
    font-size: 2rem;
  }

  .sl-hero-intro {
    font-size: 1rem;
  }

  .sl-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .sl-product-detail {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sl-product-detail-gallery {
    position: static;
  }

  .sl-cart-item {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
  }

  .sl-cart-item-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .sl-cart-item-total {
    grid-column: 1 / -1;
    text-align: right;
  }

  .sl-form-row {
    grid-template-columns: 1fr;
  }
}

/* Utility for adjusting quantity */
<script>
function adjustQty(delta) {
  const input = document.getElementById('qty');
  const current = parseInt(input.value, 10) || 1;
  const newValue = Math.max(1, Math.min(99, current + delta));
  input.value = newValue;
}
</script>
