/* Public Styles - Matching React App Design 1:1 */

:root {
  --primary-blue: #3b82f6;
  --primary-blue-hover: #2563eb;
  --primary-blue-light: #dbeafe;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --yellow-400: #facc15;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --purple-100: #e9d5ff;
  --purple-600: #9333ea;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --amber-600: #d97706;
}

/* Full style isolation wrapper - prevents WordPress theme interference */
.csam-public-wrapper {
  all: initial;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
  color: var(--gray-900) !important;
  box-sizing: border-box !important;
  line-height: 1.5 !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  display: block !important;
}

.csam-public-wrapper *,
.csam-public-wrapper *::before,
.csam-public-wrapper *::after {
  box-sizing: border-box !important;
}

/* Animations - Matching React App Exactly */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes zoomOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

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

/* Auth Modal Styles - Matching React App 1:1 */
.csam-auth-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  z-index: 10000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  animation: fadeIn 0.2s ease-out forwards !important;
  overflow-y: auto !important;
}

.csam-auth-modal {
  background: #ffffff !important;
  border-radius: 16px !important;
  max-width: 448px !important;
  width: 100% !important;
  padding: 32px !important;
  position: relative !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  margin: auto !important;
}

.csam-auth-close {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  background: transparent !important;
  border: none !important;
  color: #9ca3af !important;
  cursor: pointer !important;
  padding: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 4px !important;
  transition: color 0.2s ease !important;
}

.csam-auth-close:hover {
  color: #4b5563 !important;
}

.csam-auth-close svg {
  width: 24px !important;
  height: 24px !important;
}

.csam-auth-title {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.3 !important;
}

.csam-auth-subtitle {
  color: #4b5563 !important;
  margin: 0 0 8px 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

.csam-auth-info-box {
  margin-bottom: 24px !important;
  padding: 16px !important;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%) !important;
  border: 2px solid #dbeafe !important;
  border-radius: 8px !important;
}

.csam-auth-info-title {
  font-size: 14px !important;
  color: #1f2937 !important;
  font-weight: 600 !important;
  margin: 0 0 4px 0 !important;
}

.csam-auth-info-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 14px !important;
  color: #374151 !important;
}

.csam-auth-info-list li {
  margin: 4px 0 !important;
  line-height: 1.5 !important;
}

.csam-auth-error {
  margin-bottom: 16px !important;
  padding: 12px !important;
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  border-radius: 8px !important;
  color: #dc2626 !important;
  font-size: 14px !important;
}

.csam-auth-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.csam-auth-field {
  display: flex !important;
  flex-direction: column !important;
}

.csam-auth-label {
  display: block !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #374151 !important;
  margin-bottom: 4px !important;
}

.csam-auth-input {
  width: 100% !important;
  padding: 8px 16px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-family: inherit !important;
  color: #111827 !important;
  outline: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.csam-auth-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.csam-auth-submit {
  width: 100% !important;
  padding: 12px !important;
  background: #2563eb !important;
  color: white !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background 0.2s ease !important;
  font-family: inherit !important;
}

.csam-auth-submit:hover:not(:disabled) {
  background: #1d4ed8 !important;
}

.csam-auth-submit:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.csam-auth-toggle {
  margin-top: 24px !important;
  text-align: center !important;
}

.csam-auth-toggle-btn {
  background: transparent !important;
  border: none !important;
  color: #2563eb !important;
  cursor: pointer !important;
  font-size: 14px !important;
  padding: 0 !important;
  text-decoration: none !important;
  font-family: inherit !important;
  transition: text-decoration 0.2s ease !important;
}

.csam-auth-toggle-btn:hover {
  text-decoration: underline !important;
}

/* Standalone Auth Button Styles */
.csam-standalone-auth-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 24px !important;
  background: #2563eb !important;
  color: white !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
}

.csam-standalone-auth-btn:hover {
  background: #1d4ed8 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
  transform: translateY(-1px) !important;
}

.csam-standalone-auth-btn:active {
  transform: translateY(0) !important;
}

.csam-standalone-auth-btn[data-style="outline"] {
  background: transparent !important;
  color: #2563eb !important;
  border: 2px solid #2563eb !important;
}

.csam-standalone-auth-btn[data-style="outline"]:hover {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

.csam-standalone-auth-btn[data-style="text"] {
  background: transparent !important;
  color: #2563eb !important;
  border: none !important;
  box-shadow: none !important;
  padding: 8px 16px !important;
}

.csam-standalone-auth-btn[data-style="text"]:hover {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  box-shadow: none !important;
  transform: none !important;
}

.csam-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.csam-product-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

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

.csam-product-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--gray-100);
}

.csam-product-info {
  padding: 16px;
}

.csam-product-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 8px 0;
}

.csam-product-description {
  font-size: 14px;
  color: var(--gray-600);
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.csam-product-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 12px 0;
}

.csam-add-to-cart {
  width: 100%;
  padding: 10px 16px;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.csam-add-to-cart:hover {
  background: var(--primary-blue-hover);
}

.csam-filters {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.csam-search-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
}

.csam-search-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--primary-blue-light);
}

.csam-cart-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 12px;
}

.csam-cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--gray-100);
}

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

.csam-cart-item-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 4px 0;
}

.csam-cart-item-price {
  font-size: 14px;
  color: var(--gray-600);
}

.csam-quantity-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.csam-quantity-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.csam-quantity-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.csam-review-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.csam-review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.csam-review-author {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

.csam-review-rating {
  display: flex;
  gap: 4px;
}

.csam-star {
  color: var(--yellow-400);
  font-size: 18px;
}

.csam-star-empty {
  color: var(--gray-300);
}

.csam-review-text {
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
}

.csam-review-date {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 8px;
}

.csam-contact-form {
  max-width: 600px;
  margin: 0 auto;
}

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

.csam-form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.csam-form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.15s ease-in-out;
}

.csam-form-input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px #3b82f6;
}

.csam-form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  resize: none;
  min-height: 120px;
  font-family: inherit;
  transition: all 0.15s ease-in-out;
}

.csam-form-textarea:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px #3b82f6;
}

.csam-submit-btn {
  padding: 12px 24px;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.csam-submit-btn:hover {
  background: var(--primary-blue-hover);
}

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

.csam-account-portal {
  max-width: 1200px;
  margin: 0 auto;
}

.csam-account-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

.csam-account-nav-item {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.csam-account-nav-item:hover {
  color: var(--gray-900);
  border-bottom-color: var(--gray-300);
}

.csam-account-nav-item.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
}

.csam-order-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.csam-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 16px;
}

.csam-order-id {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

.csam-order-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--green-100);
  color: var(--green-700);
}

.csam-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  animation: csam-slide-in 0.3s ease-out;
}

@keyframes csam-slide-in {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.csam-notification.success {
  border-left: 4px solid var(--green-600);
}

.csam-notification.error {
  border-left: 4px solid #dc2626;
}

.csam-loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: csam-spin 0.8s linear infinite;
}

@keyframes csam-spin {
  to {
    transform: rotate(360deg);
  }
}

.csam-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
}

.csam-verified-badge {
  background: var(--green-100);
  color: var(--green-600);
}

.csam-profile-info {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 24px;
}

.csam-profile-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 20px 0;
}

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

.csam-profile-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.csam-profile-item strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.csam-profile-item span {
  font-size: 14px;
  color: var(--gray-900);
}

/* Shop Page - Masonry Column Layout (Matches React App Exactly) */
.csam-shop-products-grid {
  column-count: 3;
  column-gap: 32px;
}

@media (max-width: 1024px) {
  .csam-shop-products-grid {
    column-count: 2;
  }
}

@media (max-width: 768px) {
  .csam-shop-products-grid {
    column-count: 1;
  }
}

/* Product Card Masonry Layout */
.csam-shop-product-item {
  break-inside: avoid;
  margin-bottom: 32px;
  cursor: pointer;
}

/* Product Detail Modal - 75% / 25% Layout */
.csam-product-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out forwards;
}

.csam-product-detail-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 1280px;
  max-height: 90vh;
  overflow: hidden;
  animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  margin: auto;
}

.csam-product-detail-modal-scroll {
  overflow-y: auto;
  max-height: 90vh;
  padding: 32px;
}

.csam-product-detail-grid {
  display: grid;
  grid-template-columns: 65fr 35fr;
  gap: 32px;
}

@media (max-width: 1024px) {
  .csam-product-detail-grid {
    grid-template-columns: 60fr 40fr;
    gap: 24px;
  }
}

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

  .csam-product-detail-modal-scroll {
    padding: 20px;
  }
}

/* Reviews Page Container - Matches Elementor Container Width */
.csam-reviews-container {
  /* Inherit container width from theme/Elementor - no hardcoded max-width */
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 48px 24px;
  /* Match common Elementor container patterns */
  max-width: var(--container-max-width, var(--e-global-container-width, 1140px));
}

/* Responsive padding to match Elementor behavior */
@media (max-width: 1024px) {
  .csam-reviews-container {
    padding: 40px 20px;
  }
}

@media (max-width: 768px) {
  .csam-reviews-container {
    padding: 32px 16px;
  }

  .csam-auth-modal {
    max-width: 95% !important;
    padding: 24px !important;
  }

  .csam-auth-title {
    font-size: 20px !important;
  }

  .csam-standalone-auth-btn {
    width: 100% !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
  }
}
