/* ================================================
   COIMCO MODERNO - CSS CONSOLIDADO
   Estilos para todos los archivos *moderno.php
   ================================================ */

/* -----------------------------------------------
   VARIABLES GLOBALES
----------------------------------------------- */
:root {
  --primary-color: #0f447e;
  --primary-light: #1a5ba0;
  --primary-dark: #0a3360;
  --accent-color: #2563eb;
  --text-primary: #1a1a2e;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* -----------------------------------------------
   BODY / GLOBAL
----------------------------------------------- */
body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* -----------------------------------------------
   BOTONES
----------------------------------------------- */
.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-modern-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(15, 68, 126, 0.3);
}

.btn-modern-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 68, 126, 0.4);
  color: white;
  text-decoration: none;
}

.btn-modern-secondary {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--border-color);
}

.btn-modern-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  text-decoration: none;
}

/* -----------------------------------------------
   CARDS
----------------------------------------------- */
.card-modern {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card-modern:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* -----------------------------------------------
   SECTION HEADERS
----------------------------------------------- */
.section-header-modern {
  margin-bottom: 32px;
}

.section-header-modern h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-header-modern p {
  color: var(--text-secondary);
  font-size: 16px;
}

.section-title-modern {
  text-align: center;
  margin-bottom: 40px;
}

.section-title-modern h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-title-modern p {
  color: var(--text-secondary);
}

/* -----------------------------------------------
   BREADCRUMB
----------------------------------------------- */
.breadcrumb-modern {
  background: transparent;
  padding: 16px 0;
  margin-bottom: 24px;
}

.breadcrumb-modern a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb-modern a:hover {
  color: var(--primary-color);
}

.breadcrumb-modern .active {
  color: var(--primary-color);
  font-weight: 600;
}

/* -----------------------------------------------
   ALERTAS
----------------------------------------------- */
.alert-modern {
  border-radius: var(--radius-md);
  border: none;
  padding: 16px 20px;
  font-weight: 500;
}

.alert-modern-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.alert-modern-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-modern button.close {
  float: right;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
}

.alert-modern button.close:hover {
  opacity: 1;
}

/* -----------------------------------------------
   PAGE HEADER
----------------------------------------------- */
.page-header-modern {
  background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 40px 0;
  margin-bottom: 40px;
}

.page-header-modern h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* -----------------------------------------------
   TOPBAR (menumoderno)
----------------------------------------------- */
.topbar-modern {
  background: linear-gradient(135deg, #0f447e 0%, #1a5ba0 100%);
  padding: 10px 0;
  font-size: 13px;
}

.topbar-modern a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
}

.topbar-modern a:hover {
  color: #ffffff;
}

.topbar-modern i {
  font-size: 14px;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.topbar-links li {
  display: flex;
  align-items: center;
}

/* -----------------------------------------------
   HEADER / NAVBAR (menumoderno)
----------------------------------------------- */
.header-modern {
  background: #ffffff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo img {
  height: 50px;
  width: auto;
  transition: transform 0.2s ease;
}

.header-logo:hover img {
  transform: scale(1.02);
}

/* -----------------------------------------------
   BUSCADOR (menumoderno)
----------------------------------------------- */
.header-search {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 500px;
  margin: 0 32px;
}

.search-input-modern {
  flex: 1;
  padding: 12px 18px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.search-input-modern:focus {
  outline: none;
  border-color: #0f447e;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 68, 126, 0.1);
}

.search-btn-modern {
  padding: 12px 24px;
  background: linear-gradient(135deg, #0f447e 0%, #1a5ba0 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-btn-modern:hover {
  background: linear-gradient(135deg, #0a3360 0%, #0f447e 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 68, 126, 0.3);
}

/* -----------------------------------------------
   NAVEGACIÓN (menumoderno)
----------------------------------------------- */
.nav-modern {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link-modern {
  padding: 10px 20px;
  color: #4b5563;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.nav-link-modern:hover {
  color: #0f447e;
  background: rgba(15, 68, 126, 0.08);
  text-decoration: none;
}

.nav-link-modern.active {
  color: #0f447e;
  background: rgba(15, 68, 126, 0.12);
}

.mobile-menu-btn {
  display: none;
  padding: 12px;
  background: #f8fafc;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #0f447e;
  font-size: 18px;
}

/* -----------------------------------------------
   PARTNER SITES (menumoderno)
----------------------------------------------- */
.partner-sites-modern {
  background: #f8fafc;
  padding: 15px 0;
}

.partner-sites-title {
  text-align: center;
  color: #0f447e;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.partner-cards {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.partner-card {
  flex: 1;
  max-width: 280px;
  background: transparent;
  transition: all 0.3s ease;
}

.partner-card:hover {
  transform: translateY(-4px);
}

.partner-card img {
  width: 100%;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}

/* -----------------------------------------------
   SIDEBAR CATEGORÍAS (categoriasmoderno)
----------------------------------------------- */
.sidebar-modern {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  height: fit-content;
}

.sidebar-header {
  background: linear-gradient(135deg, #0f447e 0%, #1a5ba0 100%);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h4 {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
}

.sidebar-menu {
  list-style: none;
  padding: 12px 0;
  margin: 0;
}

.sidebar-menu li {
  position: relative;
}

.sidebar-menu > li > a {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.sidebar-menu > li > a:hover {
  background: #f8fafc;
  color: #0f447e;
  border-left-color: #0f447e;
}

.sidebar-menu > li.active > a {
  background: rgba(15, 68, 126, 0.08);
  color: #0f447e;
  border-left-color: #0f447e;
  font-weight: 600;
}

.sidebar-menu > li.importado > a {
  color: #dc2626;
}

.sidebar-menu > li.importado > a:hover {
  background: #fef2f2;
  border-left-color: #dc2626;
  color: #dc2626;
}

.sidebar-menu .dropdown-toggle {
  justify-content: space-between;
}

.sidebar-modern a.dropdown-toggle::after,
.sidebar-modern a.dropdown-toggle::before,
.sidebar-menu a.dropdown-toggle::after,
.sidebar-menu a.dropdown-toggle::before,
.sidebar-menu .dropdown-toggle b,
.sidebar-menu .dropdown-toggle .caret {
  display: none !important;
  content: none !important;
  border: none !important;
}

.sidebar-arrow {
  margin-left: auto;
  font-size: 12px;
  color: #9ca3af;
  transition: transform 0.2s ease;
  font-family: 'FontAwesome';
  pointer-events: none;
}

.dropdown-toggle.active .sidebar-arrow {
  transform: rotate(180deg);
}

.sidebar-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  background: #f8fafc;
  display: none;
}

.sidebar-submenu.open {
  display: block;
}

.sidebar-submenu li a {
  display: flex;
  align-items: center;
  padding: 12px 24px 12px 40px;
  color: #6b7280;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sidebar-submenu li a:hover {
  background: #f1f5f9;
  color: #0f447e;
  border-left-color: #0f447e;
}

.sidebar-submenu .sidebar-submenu {
  background: #f1f5f9;
}

.sidebar-submenu .sidebar-submenu li a {
  padding-left: 56px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* -----------------------------------------------
   SLIDERS / INDEX (indexmoderno)
----------------------------------------------- */
.hero-slider-modern {
  padding: 40px 0 0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.slider-container {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: relative;
}

.slider-container .owl-carousel .item {
  position: relative;
}

.slider-container .owl-carousel .item img {
  width: 100%;
  height: auto;
  display: block;
  min-width: 100%;
}

.slider-container .owl-carousel .owl-item img {
  width: 100%;
  height: auto;
  display: block;
}

.slider-container .owl-nav button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.95) !important;
  border-radius: 50% !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.slider-container .owl-nav button:hover {
  background: #0f447e !important;
  color: white !important;
}

.slider-container .owl-nav .owl-prev { left: 20px; }
.slider-container .owl-nav .owl-next { right: 20px; }

.slider-container .owl-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.slider-container .owl-dots .owl-dot span {
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(15, 68, 126, 0.3);
  transition: all 0.2s ease;
}

.slider-container .owl-dots .owl-dot.active span {
  background: #0f447e;
  border-color: #0f447e;
}

.content-section-modern {
  padding: 20px 0 60px;
}

.slider-card-modern {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.slider-card-modern.mb-0 {
  margin-bottom: 0;
  border-radius: 16px 16px 0 0;
}

.slider-card-modern .owl-carousel .item img {
  width: 100%;
  height: auto;
  display: block;
}

/* -----------------------------------------------
   PRODUCT CARDS (categorymoderno / searchmoderno)
----------------------------------------------- */
.product-card-modern {
  background: linear-gradient(135deg, #0f447e 0%, #1a5ba0 100%);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  transform: translateZ(0);
}

.product-card-modern:hover {
  transform: translateY(-6px) translateZ(0);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.product-card-image {
  position: relative;
  padding: 20px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  overflow: hidden;
}

.product-card-image img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.product-card-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: linear-gradient(135deg, #0f447e 0%, #1a5ba0 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 8px;
  text-transform: uppercase;
  flex: 1;
}

.product-card-price {
  font-size: 18px;
  font-weight: 700;
  color: #0f447e;
  margin-top: auto;
}

.product-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.product-card-link:hover {
  text-decoration: none;
  color: inherit;
}

.products-grid-modern {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Search product card (searchmoderno) */
.search-product-card {
  background: linear-gradient(135deg, #0f447e 0%, #1a5ba0 100%);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  transform: translateZ(0);
}

.search-product-card:hover {
  transform: translateY(-6px) translateZ(0);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.search-product-image {
  position: relative;
  padding: 20px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  overflow: hidden;
}

.search-product-image img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.search-product-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: linear-gradient(135deg, #0f447e 0%, #1a5ba0 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.search-product-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 8px;
  text-transform: uppercase;
  flex: 1;
}

.search-product-price {
  font-size: 18px;
  font-weight: 700;
  color: #0f447e;
}

.search-product-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* -----------------------------------------------
   FOOTER (footermoderno)
----------------------------------------------- */
.footer-modern {
  background: linear-gradient(135deg, #0f447e 0%, #0a3360 100%);
  color: rgba(255, 255, 255, 0.85);
  padding: 60px 0 0;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  height: 55px;
  width: auto;
  margin-bottom: 20px;
}

.footer-description {
  line-height: 1.7;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.8);
}

.footer-contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-contact-list li {
  margin-bottom: 12px;
}

.footer-contact-list a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.footer-contact-list a:hover {
  color: #ffffff;
  transform: translateX(4px);
}

.footer-contact-list i {
  width: 20px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-sections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.footer-section h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  color: #ffffff;
}

.social-links-modern {
  display: flex;
  gap: 12px;
}

.social-link-modern {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link-modern:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-2px);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.footer-links a:hover {
  color: #ffffff;
  transform: translateX(4px);
}

.footer-links i {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.footer-copyright {
  background: rgba(0, 0, 0, 0.2);
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.footer-copyright a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
}

.footer-copyright a:hover {
  color: #ffffff;
}

/* Mobile Search - oculto en desktop */
.mobile-search {
  display: none;
}

/* -----------------------------------------------
   RESPONSIVE
----------------------------------------------- */
@media (max-width: 991px) {
  .header-search { display: none; }
  .mobile-menu-btn { display: block; }

  .nav-modern {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 999;
  }

  .nav-modern.active { display: flex; }

  .mobile-search {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 8px 0 12px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 8px;
  }

  .mobile-search .search-input-modern {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .mobile-search .search-btn-modern {
    width: 100%;
    justify-content: center;
  }

  .nav-link-modern {
    width: 100%;
    text-align: center;
  }

  .partner-cards {
    flex-direction: column;
    align-items: center;
  }

  .partner-card { max-width: 320px; }

  .sidebar-modern { margin-bottom: 24px; }
  .sidebar-toggle { display: block; }
  .sidebar-menu { display: none; }
  .sidebar-menu.open { display: block; }

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

@media (max-width: 767px) {
  .topbar-links {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .topbar-modern { padding: 12px 0; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-sections { grid-template-columns: 1fr; }

  .products-grid-modern {
    grid-template-columns: 1fr;
  }
}
