/* Luna Theme Styles */

/* CSS Variables for theming */
:root {
  --primary-color: #6366f1;
  --secondary-color: #10b981;
  --text-color: #374151;
  --background-color: #ffffff;
  --border-color: #e5e7eb;
  --border-radius: 0.375rem;
  --heading-font: 'Inter', sans-serif;
  --body-font: 'Inter', sans-serif;
  --accent-font: var(--heading-font);
  --base-font-size: 16px;
  --container-max-width: 100%;
}

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

body {
  font-family: var(--body-font);
  font-size: var(--base-font-size);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
}

/* Section wrapper styles - ensures sections render cleanly with unique IDs */
.mercador-section {
  position: relative;
  width: 100%;
}

.mercador-section:empty {
  display: none;
}

/* Container */
.container {
  max-width: var(--container-max-width, 100%);
  margin: 0 auto;
  padding: 0 var(--container-spacing, 1rem);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-family: var(--body-font);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background-color: color-mix(in srgb, var(--primary-color) 85%, black);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

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

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-full-width {
  width: 100%;
}

/* Header */
.header {
  background-color: var(--background-color);
 
  position: relative;
  z-index: 50;
}

.header.sticky {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

/* Header Layout Variations */
.header-layout-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-layout-center {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.header-layout-center .header-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-layout-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
}

.header-layout-right .header-nav {
  order: 1;
}

.header-layout-right .header-actions {
  order: 2;
}

.header-layout-right .header-logo {
  order: 3;
}

/* Logo positioning */
.header-logo {
  flex-shrink: 0;
}

/* Actions positioning */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-logo .logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  font-family: var(--accent-font);
}

.header-logo .logo-image {
  height: auto;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-link:hover .logo-text {
  color: var(--primary-color);
  opacity: 0.8;
}

.header-nav .nav-list {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s ease;
  font-family: var(--body-font); /* Use body font for navigation links */
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

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

.header-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: none;
  color: var(--text-color);
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: background-color 0.2s ease;
  text-decoration: none;
}

/* Logo Ticker Section */
.logo-ticker-section {
  padding: 2.5rem 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.logo-ticker-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo-ticker-title {
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 0;
}

.logo-ticker-track {
  position: relative;
  overflow: hidden;
}

.logo-ticker-inner {
  display: flex;
  width: max-content;
  gap: 3rem;
  animation: logo-ticker-scroll var(--ticker-speed, 30s) linear infinite;
}

.logo-ticker-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-ticker-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--logo-height, 48px);
}

.logo-ticker-image {
  max-height: 100%;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.8;
  transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

.logo-ticker-image:hover {
  opacity: 1;
  filter: grayscale(0%);
  transform: translateY(-2px);
}

@keyframes logo-ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.header-action:hover {
  background-color: #f3f4f6;
  text-decoration: none;
}

.header-action .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* Login Icon Customization */
.login-icon-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-icon-custom svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.login-icon-default {
  flex-shrink: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.login-icon-default svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Customer Authentication Styles */
.customer-auth {
  display: flex;
  align-items: center;
}

.customer-auth button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: #4f46e5;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.customer-auth button:hover {
  color: #3730a3;
  background-color: #f3f4f6;
}

.customer-auth .flex {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.customer-auth .text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.customer-auth .text-gray-700 {
  color: #374151;
}

.customer-auth .text-indigo-600 {
  color: #4f46e5;
}

.customer-auth .text-indigo-800 {
  color: #3730a3;
}

.customer-auth .text-gray-600 {
  color: #4b5563;
}

.customer-auth .text-gray-800 {
  color: #1f2937;
}

.customer-auth .hover\:text-indigo-800:hover {
  color: #3730a3;
}

.customer-auth .hover\:text-gray-800:hover {
  color: #1f2937;
}

.cart-link {
  position: relative;
  text-decoration: none;
}

.cart-count {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  background-color: var(--primary-color);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  min-width: 1.25rem;
  text-align: center;
}

/* Hero Section */
.hero {
  padding: 4rem 0;
  text-align: center;
  color: white;
}

.hero-content {
  max-width: 100%;
  margin: 0 auto;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.hero-description {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Product Grid */
.product-grid-section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.125rem;
  color: #6b7280;
}

.product-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 3rem;
}

.product-grid-2-cols {
  grid-template-columns: repeat(2, 1fr);
}

.product-grid-3-cols {
  grid-template-columns: repeat(3, 1fr);
}

.product-grid-4-cols {
  grid-template-columns: repeat(4, 1fr);
}

.product-grid-5-cols {
  grid-template-columns: repeat(5, 1fr);
}

/* Product Card */
.product-card {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-image-wrapper {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-image-primary {
  position: absolute;
  top: 0;
  left: 0;
}

.product-image-secondary {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: scale(1.05);
}

/* Only apply hover effect when secondary image is enabled */
.product-card.has-secondary-image:hover .product-image-primary {
  opacity: 0;
}

.product-card.has-secondary-image:hover .product-image-secondary {
  opacity: 1;
  transform: scale(1);
}

/* Fallback for products without secondary image or when setting is disabled */
.product-card:not(.has-secondary-image):hover .product-image {
  transform: scale(1.05);
}

.product-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
  color: #9ca3af;
}

.placeholder-icon {
  width: 3rem;
  height: 3rem;
}

.product-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-badge.sale {
  background-color: #ef4444;
  color: white;
}

.product-badge.featured {
  background-color: var(--primary-color);
  color: white;
}

.product-badge.new {
  background-color: #10b981;
  color: white;
}

.product-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.product-card:hover .product-actions {
  opacity: 1;
}

.product-action-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.product-action-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.product-action-btn .icon {
  width: 1rem;
  height: 1rem;
}

.product-info {
  padding: 1.5rem;
}

.product-title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.product-link {
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.2s ease;
}

.product-link:hover {
  color: var(--primary-color);
}

.product-description {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

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

.price,
.sale-price {
  font-weight: 600;
  color: var(--text-color);
}

.original-price {
  font-size: 0.875rem;
  color: #9ca3af;
  text-decoration: line-through;
}

.product-variants {
  margin-bottom: 1rem;
}

.variants-count {
  font-size: 0.875rem;
  color: #6b7280;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stars {
  display: flex;
  gap: 0.125rem;
}

.star {
  width: 1rem;
  height: 1rem;
}

.star.filled {
  color: #fbbf24;
}

.rating-count {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Multicolumn Section */
.multicolumn-section {
  padding: 4rem 0;
  background-color: #f9fafb;
}

.multicolumn-grid {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
}

.multicolumn-grid-2-cols {
  grid-template-columns: repeat(2, 1fr);
}

.multicolumn-grid-3-cols {
  grid-template-columns: repeat(3, 1fr);
}

.multicolumn-grid-4-cols {
  grid-template-columns: repeat(4, 1fr);
}

.multicolumn-grid-5-cols {
  grid-template-columns: repeat(5, 1fr);
}

.multicolumn-grid-6-cols {
  grid-template-columns: repeat(6, 1fr);
}

.multicolumn-item {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.multicolumn-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.multicolumn-image-wrapper {
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
}

.multicolumn-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.multicolumn-item:hover .multicolumn-image {
  transform: scale(1.05);
}

.multicolumn-content {
  padding: 0 1rem;
}

.multicolumn-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.multicolumn-description {
  color: #6b7280;
  line-height: 1.6;
}

/* Newsletter Section */
.newsletter-section {
  padding: 4rem 0;
  background-color: var(--primary-color);
  color: white;
}

.newsletter-content {
  text-align: center;
  max-width: 100%;
  margin: 0 auto;
}

.newsletter-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.newsletter-description {
  margin-bottom: 2rem;
  opacity: 0.9;
}

.newsletter-form {
  display: flex;
  gap: 1rem;
  max-width: 100%;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
}

.newsletter-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Footer */
.footer {
  /* Background color is now set via inline styles in the template */
  /* background-color: #1f2937; */
  /* color is now set via inline styles in the template */
  /* color: white; */
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section .logo-text {
  color: white;
  margin-bottom: 1rem;
}

.footer-description {
  color: #9ca3af;
  margin-bottom: 1rem;
}

.footer-title {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-link {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: white;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background-color: #374151;
  border-radius: 50%;
  color: white;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.social-link:hover {
  background-color: var(--primary-color);
}

.social-link .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 1rem;
  text-align: center;
}

.footer-copyright {
  color: #9ca3af;
  font-size: 0.875rem;
}

/* Responsive Design */
@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none;
  }
}

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

  /* Mobile Menu Styles */
  .header-nav.mobile-open {
    display: block !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border-top: 1px solid #e5e7eb !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    z-index: 50 !important;
  }

  .header-nav.mobile-open .nav-list {
    display: flex !important;
    flex-direction: column !important;
    padding: 1rem 0 !important;
    margin: 0 !important;
    list-style: none !important;
    width: 100% !important;
  }

  .header-nav.mobile-open .nav-list li {
    margin: 0;
    border-bottom: 1px solid #f3f4f6;
  }

  .header-nav.mobile-open .nav-list li:last-child {
    border-bottom: none;
  }

  .header-nav.mobile-open .nav-link {
    display: block;
    padding: 1rem 1.5rem;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
  }

  .header-nav.mobile-open .nav-link:hover {
    background-color: #f9fafb;
    color: var(--primary-color);
  }

  /* Mobile menu toggle active state */
  .mobile-menu-toggle.active {
    background-color: #f3f4f6 !important;
  }

  /* Burger to X animation - simplified */
  .mobile-menu-toggle .icon {
    transition: transform 0.3s ease !important;
  }

  .mobile-menu-toggle.active .icon {
    transform: rotate(45deg) !important;
  }

  /* Burger lines animation - more reliable */
  .mobile-menu-toggle .icon path {
    transition: all 0.3s ease !important;
    transform-origin: center !important;
  }

  .mobile-menu-toggle.active .icon path:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px) !important;
  }

  .mobile-menu-toggle.active .icon path:nth-child(2) {
    opacity: 0 !important;
    transform: scale(0) !important;
  }

  .mobile-menu-toggle.active .icon path:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px) !important;
  }
  
  /* Mobile header layouts */
  .header-layout-center {
    justify-content: space-between;
  }
  
  .header-layout-center .header-logo {
    position: static;
    transform: none;
    order: 2;
  }
  
  .header-layout-center .header-actions {
    order: 3;
  }
  
  .header-layout-right {
    flex-direction: row;
  }
  
  .header-layout-right .header-logo {
    order: 3;
  }
  
  .header-layout-right .header-nav {
    order: 1;
  }
  
  .header-layout-right .header-actions {
    order: 2;
  }
  
  /* Ensure mobile menu toggle is always visible */
  .mobile-menu-toggle {
    display: block !important;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .product-grid-3-cols,
  .product-grid-4-cols,
  .product-grid-5-cols {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Mobile columns override based on data attribute */
  .product-grid[data-mobile-cols="1"] {
    grid-template-columns: 1fr !important;
  }
  
  .product-grid[data-mobile-cols="2"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .multicolumn-grid-3-cols,
  .multicolumn-grid-4-cols,
  .multicolumn-grid-5-cols,
  .multicolumn-grid-6-cols {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .newsletter-form {
    flex-direction: column;
    align-items: center;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .product-grid-2-cols,
  .product-grid-3-cols,
  .product-grid-4-cols,
  .product-grid-5-cols {
    grid-template-columns: 1fr;
  }
  
  /* On very small screens, respect mobile_columns setting */
  .product-grid[data-mobile-cols="1"] {
    grid-template-columns: 1fr !important;
  }
  
  .product-grid[data-mobile-cols="2"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .multicolumn-grid-2-cols,
  .multicolumn-grid-3-cols,
  .multicolumn-grid-4-cols,
  .multicolumn-grid-5-cols,
  .multicolumn-grid-6-cols {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 0.75rem;
  }
}
