/* ListenLayer Mock Ecommerce Store - Shared Styles */

/* Reset and Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f8f9fa;
}

a {
  color: #667eea;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.store-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.store-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.store-logo {
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.store-logo:hover {
  text-decoration: none;
}

.store-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.store-nav a {
  color: white;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.store-nav a:hover {
  opacity: 1;
  text-decoration: none;
}

.cart-icon {
  position: relative;
  font-size: 20px;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #f5576c;
  color: white;
  font-size: 11px;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Test Info Banner */
.test-info {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 8px;
  padding: 15px 20px;
  margin: 20px 0;
}

.test-info h3 {
  color: #1565c0;
  margin-bottom: 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.test-info p {
  color: #1976d2;
  font-size: 14px;
  margin: 4px 0;
}

.test-info code {
  background: #bbdefb;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

/* Promotion Banner */
.promo-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  overflow: hidden;
  margin: 20px 0;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.promo-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.promo-banner img {
  width: 100%;
  height: auto;
  display: block;
}

.promo-content {
  padding: 30px;
  color: white;
  text-align: center;
}

.promo-content h2 {
  font-size: 28px;
  margin-bottom: 10px;
}

.promo-content p {
  font-size: 18px;
  opacity: 0.9;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin: 30px 0;
}

/* Product Card */
.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

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

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

.product-card-content {
  padding: 20px;
}

.product-card-brand {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-card-name {
  font-size: 18px;
  font-weight: 600;
  margin: 5px 0 10px;
  color: #333;
}

.product-card-price {
  font-size: 20px;
  font-weight: bold;
  color: #667eea;
}

.product-card-category {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

/* Product Detail Page */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 40px 0;
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.product-image {
  border-radius: 8px;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: auto;
}

.product-info h1 {
  font-size: 32px;
  margin-bottom: 10px;
}

.product-brand {
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 15px;
}

.product-price {
  font-size: 28px;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 20px;
}

.product-description {
  color: #555;
  margin-bottom: 25px;
  line-height: 1.8;
}

/* Variant Selector */
.variant-selector {
  margin-bottom: 25px;
}

.variant-selector label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
}

.variant-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.variant-option {
  padding: 10px 20px;
  border: 2px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.variant-option:hover {
  border-color: #667eea;
}

.variant-option.selected {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

/* Quantity Selector */
.quantity-selector {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

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

.quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.quantity-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s;
}

.quantity-btn:hover {
  background: #e0e0e0;
}

.quantity-input {
  width: 60px;
  height: 40px;
  border: none;
  text-align: center;
  font-size: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-danger {
  background: #f5576c;
  color: white;
}

.btn-danger:hover {
  background: #e04157;
}

.btn-lg {
  padding: 18px 36px;
  font-size: 18px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

/* Product Actions (Add to Cart + Wishlist) */
.product-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.wishlist-btn {
  width: 56px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.wishlist-btn:hover {
  color: #f5576c;
}

.wishlist-btn.active {
  color: #f5576c;
  background: #fff0f3;
  border-color: #f5576c;
}

/* Cart Page */
.cart-container {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin: 30px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.cart-empty h2 {
  margin-bottom: 15px;
}

.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto auto;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

@media (max-width: 600px) {
  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: 15px;
  }
}

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

.cart-item-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-details h3 {
  font-size: 18px;
  margin-bottom: 5px;
}

.cart-item-variant {
  font-size: 14px;
  color: #666;
}

.cart-item-price {
  font-size: 18px;
  font-weight: bold;
  color: #667eea;
}

.cart-item-remove {
  color: #f5576c;
  cursor: pointer;
  font-size: 14px;
}

.cart-item-remove:hover {
  text-decoration: underline;
}

/* Cart Summary */
.cart-summary {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 25px;
  margin-top: 30px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
}

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

.cart-summary-total {
  font-size: 20px;
  font-weight: bold;
  padding-top: 15px;
  border-top: 2px solid #333;
  margin-top: 10px;
}

/* Checkout Page */
.checkout-container {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
  margin: 30px 0;
}

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

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

.checkout-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.checkout-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #999;
}

.checkout-step.active {
  color: #667eea;
}

.checkout-step.completed {
  color: #4caf50;
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.checkout-step.active .step-number {
  background: #667eea;
  color: white;
}

.checkout-step.completed .step-number {
  background: #4caf50;
  color: white;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* Order Summary Sidebar */
.order-summary {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.order-summary h3 {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.order-item {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.order-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

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

.order-item-name {
  font-weight: 600;
  font-size: 14px;
}

.order-item-qty {
  color: #666;
  font-size: 13px;
}

.order-item-price {
  font-weight: bold;
  color: #667eea;
}

/* Thank You Page */
.thank-you {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 12px;
  margin: 40px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.thank-you-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
  font-size: 40px;
  color: white;
}

.thank-you h1 {
  font-size: 32px;
  margin-bottom: 15px;
  color: #333;
}

.thank-you p {
  color: #666;
  font-size: 18px;
  margin-bottom: 10px;
}

.order-number {
  font-size: 24px;
  font-weight: bold;
  color: #667eea;
  margin: 20px 0;
}

.order-details {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 25px;
  margin: 30px auto;
  max-width: 500px;
  text-align: left;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 40px 0 20px;
}

.section-header h2 {
  font-size: 24px;
  color: #333;
}

.section-header a {
  font-size: 14px;
}

/* Footer */
.store-footer {
  background: #333;
  color: white;
  padding: 40px 0;
  margin-top: 60px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 30px;
}

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

.footer-links a:hover {
  color: white;
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-muted {
  color: #666;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* Page Title */
.page-title {
  font-size: 32px;
  margin: 30px 0 20px;
  color: #333;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: #666;
  margin: 20px 0;
}

.breadcrumb a {
  color: #667eea;
}

.breadcrumb span {
  color: #999;
}

/* Back to Simulation Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.back-link:hover {
  color: #667eea;
}

/* Related Products Section */
.related-products {
  margin: 60px 0;
  padding: 40px 0;
  border-top: 1px solid #eee;
}

.related-products h2 {
  margin-bottom: 25px;
}

/* ==========================================================================
   Toast Notifications (iframe-friendly, replaces alert())
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  background: #323232;
  color: white;
  padding: 14px 24px;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
  max-width: 350px;
  font-size: 14px;
}

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

.toast.success {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.toast.error {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.toast.warning {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.toast.info {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}
