/* Merchandise Store Styles */

/* Checkout Page Styles */
.checkout-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.checkout-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 30px;
}

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

.checkout-section {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.checkout-section h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  font-size: 1.5em;
}

.checkout-items {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.checkout-totals {
  border-top: 2px solid #eee;
  padding-top: 20px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 1em;
}

.total-line.total-final {
  font-size: 1.3em;
  font-weight: bold;
  padding-top: 10px;
  border-top: 2px solid #333;
  margin-top: 10px;
}

.form-group {
  margin-bottom: 20px;
}

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1em;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.payment-note {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  color: #666;
  font-size: 0.95em;
}

.payment-note p {
  margin: 5px 0;
}

.checkout-note {
  margin-top: 15px;
  font-size: 0.9em;
  color: #666;
  text-align: center;
}

.btn-large {
  padding: 18px 40px;
  font-size: 1.1em;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkout-message {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stripe Payment Element Styles */
.payment-element-container {
  margin: 20px 0;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #ddd;
  min-height: 200px;
}

.payment-element-container:empty::before {
  content: 'Calculate shipping to load payment form';
  display: block;
  text-align: center;
  padding: 40px;
  color: #666;
  font-style: italic;
}

.payment-message {
  margin-top: 15px;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.95em;
}

.payment-message.error {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

.payment-message.success {
  background: #efe;
  color: #3c3;
  border: 1px solid #cfc;
}

/* Merchandise Store Styles */

.merchandise-main {
  min-height: 80vh;
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.merchandise-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.store-header {
  text-align: center;
  margin-bottom: 40px;
}

.store-header h1 {
  font-size: 2.5rem;
  color: #333;
  margin-bottom: 10px;
}

.store-header p {
  font-size: 1.2rem;
  color: #666;
}

/* Image Selection Section */
.image-selection-section {
  margin-bottom: 40px;
}

.image-selection-section h2 {
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 20px;
}

.selected-image-preview {
  text-align: center;
  margin: 20px 0;
}

.selected-image-preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  margin-bottom: 15px;
}

.change-image-btn {
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-family: var(--display-font, 'AnimeAce', Arial, sans-serif);
  transition: background 0.3s ease;
}

.change-image-btn:hover {
  background: #5568d3;
}

.image-selector {
  text-align: center;
}

.image-url-input {
  width: 100%;
  max-width: 500px;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  margin: 10px 0;
}

.load-image-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: transform 0.2s ease;
}

.load-image-btn:hover {
  transform: translateY(-2px);
}

/* Image Customization Section */
.image-customization-section {
  margin-bottom: 40px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 10px;
}

.customization-controls {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-group label {
  font-weight: bold;
  color: #333;
}

.control-group select,
.control-group input[type="range"] {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.apply-customization-btn {
  padding: 10px 20px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-family: var(--display-font, 'AnimeAce', Arial, sans-serif);
}

.apply-customization-btn:hover {
  background: #218838;
}

.customized-image-preview {
  text-align: center;
  padding: 20px;
  background: white;
  border-radius: 10px;
}

.customization-preview img {
  max-width: 100%;
  border-radius: 10px;
}

/* Product Selection Section */
.product-selection-section {
  margin-bottom: 40px;
}

.product-categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.category-btn {
  padding: 10px 20px;
  background: #f0f0f0;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.category-btn:hover {
  background: #e0e0e0;
  border-color: #667eea;
}

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

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

.product-card {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

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

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
}

.product-card h3 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 10px;
}

.product-type {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.product-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 15px;
}

.variant-tag {
  padding: 4px 8px;
  background: #f0f0f0;
  border-radius: 5px;
  font-size: 0.85rem;
  color: #666;
}

.select-product-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: transform 0.2s ease;
}

.select-product-btn:hover {
  transform: translateY(-2px);
}

/* Product Details Modal */
.product-details-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.product-details-modal .modal-content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.product-details-modal .modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 30px;
  cursor: pointer;
  color: #666;
}

.product-details-modal .modal-close:hover {
  color: #333;
}

.product-variants-list {
  margin-top: 20px;
}

.variant-option {
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 10px;
}

.variant-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.variant-name {
  font-weight: bold;
}

.variant-price {
  font-weight: bold;
  color: #667eea;
  font-size: 1.1em;
}

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

.generate-mockup-btn {
  padding: 8px 16px;
  background: #17a2b8;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
}

.generate-mockup-btn:hover {
  background: #138496;
}

.mockup-preview {
  margin-top: 10px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 8px;
}

.mockup-preview img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.add-to-cart-btn {
  padding: 8px 16px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.add-to-cart-btn:hover {
  background: #218838;
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 40px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error State */
.error-state {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
}

/* Success Notification */
.success-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #28a745;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .merchandise-container {
    padding: 20px;
  }
  
  .store-header h1 {
    font-size: 2rem;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .customization-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Profit Breakdown Styles */
.profit-breakdown {
  margin-top: 25px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #667eea;
}

.profit-breakdown h3 {
  margin-top: 0;
  margin-bottom: 15px;
}

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

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

.breakdown-item.breakdown-cost {
  color: #666;
}

.breakdown-item.profit-base {
  font-weight: bold;
  font-size: 1.1em;
  padding-top: 15px;
  border-top: 2px solid #667eea;
  margin-top: 10px;
}

.breakdown-item .cost {
  color: #d32f2f;
}

.breakdown-split {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.split-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  margin: 8px 0;
  border-radius: 8px;
  background: white;
}

.split-item.loremaster {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
}

.split-item.platform {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
}

.loremaster-profit {
  font-weight: bold;
  color: #2e7d32;
  font-size: 1.1em;
}

.platform-fee {
  font-weight: bold;
  color: #f57c00;
  font-size: 1.1em;
}

/* Profit Sharing Modal Styles */
.profit-sharing-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.profit-sharing-modal-content {
  background: white;
  border-radius: 15px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.profit-sharing-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 2px solid #eee;
}

.profit-sharing-modal-header h2 {
  margin: 0;
  color: #333;
  font-size: 1.8em;
}

.profit-sharing-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
  transition: color 0.2s;
}

.profit-sharing-modal-close:hover {
  color: #333;
}

.profit-sharing-modal-body {
  padding: 30px;
}

.profit-sharing-info-section {
  margin-bottom: 30px;
}

.profit-sharing-info-section h3 {
  color: #667eea;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.3em;
}

.profit-sharing-info-section p {
  line-height: 1.6;
  color: #555;
  margin-bottom: 15px;
}

.profit-sharing-split-visual {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
}

.profit-sharing-split-item {
  display: flex;
  justify-content: space-between;
  padding: 15px;
  margin: 10px 0;
  border-radius: 8px;
  background: white;
  border-left: 4px solid;
}

.profit-sharing-split-item.loremaster {
  border-left-color: #4caf50;
  background: #e8f5e9;
}

.profit-sharing-split-item.platform {
  border-left-color: #ff9800;
  background: #fff3e0;
}

.profit-sharing-split-item .label {
  font-weight: 600;
  color: #333;
}

.profit-sharing-split-item .percent {
  font-weight: bold;
  font-size: 1.1em;
}

.profit-sharing-split-item.loremaster .percent {
  color: #2e7d32;
}

.profit-sharing-split-item.platform .percent {
  color: #f57c00;
}

.referral-chain-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #eee;
}

.referral-chain-section h3 {
  color: #667eea;
  margin-bottom: 15px;
}

.referral-chain-item {
  padding: 12px;
  margin: 8px 0;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.referral-chain-item .level {
  font-weight: 600;
  color: #667eea;
  margin-right: 10px;
}

.referral-chain-item .rate {
  color: #666;
  font-size: 0.9em;
}

.profit-sharing-info-btn {
  font-family: var(--display-font, 'AnimeAce', Arial, sans-serif);
  transition: all 0.2s;
}

.profit-sharing-info-btn:hover {
  background: #5568d9 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

@media (max-width: 768px) {
  .profit-sharing-modal-content {
    max-width: 95%;
    margin: 10px;
  }
  
  .profit-sharing-modal-header {
    padding: 20px;
  }
  
  .profit-sharing-modal-body {
    padding: 20px;
  }
}

