/* 
 * Cotishop Megadropdown - Consolidated Styles
 * Comprehensive dropdown styling with modern design and proper positioning
 * Version: 2.0 - Consolidated from multiple CSS files
 */

/* ===== BASE DROPDOWN POSITIONING ===== */

/* Hide dropdown by default - Multiple selectors for compatibility */
.site__nav .menu .menu__dropdown .menu-dropdown__list.shop,
.site__nav .menu .menu__dropdown .menu-dropdown__list,
.header__menu .site__nav .menu .menu__dropdown .menu-dropdown__list.shop,
.menu__dropdown .menu-dropdown__list.shop,
li.menu__dropdown .menu-dropdown__list.shop,
nav.menu-item .menu__dropdown .menu-dropdown__list {
  display: none;
  position: fixed;
  top: 0; /* Will be set dynamically by JavaScript */
  left: 0;
  right: 0;
  width: 100vw;
  height: auto;
  min-height: 320px;
  background: #FEFBFF;
  padding: 40px 64px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0;
  box-sizing: border-box;
  border: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-radius: 0 0 12px 12px;
}

/* Show dropdown on hover - Multiple selectors for compatibility */
.site__nav .menu .menu__dropdown:hover .menu-dropdown__list.shop,
.site__nav .menu .menu__dropdown:focus .menu-dropdown__list.shop,
.header__menu .site__nav .menu .menu__dropdown:hover .menu-dropdown__list.shop,
.header__menu .site__nav .menu .menu__dropdown:focus .menu-dropdown__list.shop,
.menu__dropdown:hover .menu-dropdown__list.shop,
li.menu__dropdown:hover .menu-dropdown__list.shop,
li.menu__dropdown:focus .menu-dropdown__list.shop,
nav.menu-item .menu__dropdown:hover .menu-dropdown__list,
nav.menu-item .menu__dropdown:focus .menu-dropdown__list {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: flex-start !important;
  gap: 40px !important;
  pointer-events: auto !important;
  position: fixed !important;
  z-index: 10000 !important;
}

/* Global megamenu - basic styling only */
#global-megamenu {
  display: none;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  pointer-events: auto;
}



/* ===== CRITICAL OVERRIDE - Force proper positioning ===== */
/* This rule ensures the dropdown always appears below the menu regardless of other CSS */
#global-megamenu,
.menu-dropdown__list.shop,
.site__nav .menu .menu__dropdown .menu-dropdown__list.shop,
.header__menu .site__nav .menu .menu__dropdown .menu-dropdown__list.shop {
  position: fixed !important;
  top: 0 !important; /* Will be set dynamically by JavaScript */
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  z-index: 10000 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
  border-radius: 0 0 12px 12px !important;
}

/* Override any conflicting top: 100% rules */
#global-megamenu,
.menu-dropdown__list.shop,
.site__nav .menu .menu__dropdown .menu-dropdown__list.shop,
.header__menu .site__nav .menu .menu__dropdown .menu-dropdown__list.shop,
.megamenu-horizontal .dropdown-menu {
  top: 0 !important; /* Will be set dynamically by JavaScript */
}





/* Force content visibility with mock data if empty */
.dropdown-container:empty::before {
  content: "MEGADROPDOWN FUNCIONA - Contenido mock de prueba";
  display: block;
  padding: 20px;
  background: #f0f0f0;
  color: #333;
  font-size: 16px;
  text-align: center;
  border: 2px dashed #ccc;
}

/* Force mock categories if none exist */
.dropdown-categories:empty::before {
  content: "CATEGORÍAS MOCK: Artículos de Oficina • Decoración • Eventos • Ver Todo";
  display: block;
  padding: 20px;
  background: #e8f4fd;
  color: #0066cc;
  font-size: 14px;
  white-space: pre-line;
}

/* Force mock products if none exist */
.dropdown-products:empty::before {
  content: "PRODUCTOS MOCK: Producto 1 • Producto 2 • Producto 3 • Producto 4";
  display: block;
  padding: 20px;
  background: #f8e8ff;
  color: #663399;
  font-size: 14px;
  white-space: pre-line;
}

/* ===== DROPDOWN LAYOUT COMPONENTS ===== */

/* Main container */
.dropdown-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== LEFT COLUMN: CATEGORIES ===== */

.dropdown-categories {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  gap: 24px;
  width: 406px;
  min-height: 240px;
  flex: 0 0 auto;
}

.category-section {
  width: 100%;
  height: 100%;
}

.category-title {
  font-family: 'Lexend', 'Arial', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 18px;
  text-transform: uppercase;
  color: #25242A;
  margin: 0 0 16px 0;
  padding: 0;
  letter-spacing: 0.5px;
}

.category-list {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  gap: 48px;
  width: 100%;
  list-style: none;
  margin: 0;
}

.category-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.category-item {
  margin: 0;
  padding: 0;
  width: 100%;
}

.category-link {
  display: block;
  font-family: 'Noto Sans', 'Arial', sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 14px;
  text-transform: uppercase;
  color: #25242A;
  text-decoration: none;
  padding: 4px 0;
  margin: 0;
  transition: all 0.2s ease;
  border-radius: 4px;
  position: relative;
}

.category-link:hover {
  color: #781F95;
  text-decoration: none;
  padding-left: 8px;
}

.category-link--bold {
  font-weight: 600;
  color: #781F95;
  position: relative;
}

.category-link--bold::before {
  content: '→';
  margin-right: 6px;
  color: #DE008C;
}

/* ===== SEPARATOR ===== */

.dropdown-separator {
  width: 1px;
  height: 240px;
  background: linear-gradient(180deg, 
    rgba(37, 36, 42, 0) 0%, 
    rgba(37, 36, 42, 0.1) 20%, 
    rgba(37, 36, 42, 0.15) 50%, 
    rgba(37, 36, 42, 0.1) 80%, 
    rgba(37, 36, 42, 0) 100%);
  flex: 0 0 auto;
}

/* ===== RIGHT COLUMN: PRODUCTS ===== */

.dropdown-products {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  gap: 24px;
  width: 655px;
  min-height: 240px;
  flex: 0 0 auto;
}

.products-section {
  width: 100%;
  height: 100%;
}

.products-title {
  font-family: 'Lexend', 'Arial', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 18px;
  text-transform: uppercase;
  color: #25242A;
  margin: 0 0 16px 0;
  padding: 0;
  letter-spacing: 0.5px;
}

.products-grid {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

.dropdown-product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  gap: 8px;
  width: 156px;
  height: 200px;
  background: #F8F3F9;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(222, 0, 140, 0.1);
}

.dropdown-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(120, 31, 149, 0.15);
  border-color: rgba(222, 0, 140, 0.2);
}

.dropdown-product-image {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 16px;
  width: 140px;
  height: 140px;
  border-radius: 8px;
  position: relative;
  background: #F0F0F0;
  overflow: hidden;
}

.dropdown-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.3s ease;
}

.dropdown-product-card:hover .dropdown-product-image img {
  transform: scale(1.05);
}

.dropdown-product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  color: #999;
  font-size: 12px;
  text-align: center;
}

.dropdown-product-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  gap: 4px;
  width: 100%;
  text-align: center;
}

.dropdown-product-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  background: #FCE6F4;
  border-radius: 16px;
  font-family: 'Lexend', 'Arial', sans-serif;
  font-weight: 500;
  font-size: 10px;
  line-height: 14px;
  text-transform: uppercase;
  color: #DE008C;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
}

.products-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 120px;
  color: #666;
  font-size: 14px;
  font-family: 'Noto Sans', 'Arial', sans-serif;
}

.products-loading i {
  margin-right: 8px;
  color: #781F95;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large screens - slight adjustments */
@media (max-width: 1440px) {
  .site__nav .menu .menu__dropdown .menu-dropdown__list.shop {
    padding: 32px 48px;
  }
  
  .dropdown-container {
    gap: 32px;
  }
  
  .dropdown-categories {
    width: 350px;
  }
  
  .dropdown-products {
    width: 600px;
  }
  
  .products-grid {
    gap: 10px;
  }
  
  .dropdown-product-card {
    width: 140px;
    height: 180px;
  }
  
  .dropdown-product-image {
    width: 124px;
    height: 124px;
  }
}

/* Medium screens - tablet layout */
@media (max-width: 1024px) {
  .site__nav .menu .menu__dropdown .menu-dropdown__list.shop {
    padding: 24px 32px;
    top: 120px;
  }
  
  .dropdown-container {
    flex-direction: column;
    gap: 24px;
    max-width: none;
  }
  
  .dropdown-categories {
    width: 100%;
    order: 1;
  }
  
  .category-list {
    gap: 32px;
  }
  
  .dropdown-separator {
    display: none;
  }
  
  .dropdown-products {
    width: 100%;
    order: 2;
  }
  
  .products-grid {
    justify-content: center;
    gap: 16px;
  }
  
  .dropdown-product-card {
    width: 160px;
    height: 200px;
  }
}

/* Small screens - mobile layout */
@media (max-width: 768px) {
  .site__nav .menu .menu__dropdown:hover .menu-dropdown__list.shop {
    display: none !important;
  }
  
  /* Note: Mobile navigation should use a different approach */
  /* Consider implementing a mobile-specific menu instead */
}

/* Extra small screens */
@media (max-width: 480px) {
  .site__nav .menu .menu__dropdown:hover .menu-dropdown__list.shop {
    display: none !important;
  }
}

/* ===== ACCESSIBILITY & PERFORMANCE ===== */

/* Focus states for keyboard navigation */
.category-link:focus,
.dropdown-product-card:focus {
  outline: 2px solid #781F95;
  outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .site__nav .menu .menu__dropdown .menu-dropdown__list.shop,
  .category-link,
  .dropdown-product-card,
  .dropdown-product-image img {
    transition: none;
  }
  
  .dropdown-product-card:hover {
    transform: none;
  }
  
  .dropdown-product-card:hover .dropdown-product-image img {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .dropdown-separator {
    background: #000;
  }
  
  .category-link {
    border: 1px solid transparent;
  }
  
  .category-link:hover,
  .category-link:focus {
    border-color: #781F95;
  }
  
  .dropdown-product-card {
    border: 2px solid #781F95;
  }
}