/* Header Styles for APTheme Theme */

/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
/* Header sticky, fondo blanco, sombra sutil */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background: #fff;
  z-index: 1000;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.04);
  border-bottom: 1px solid #f2f2f2;
}

/* Hamburger icon: líneas blancas */
.menu-toggle.main-menu-toggle .hamburger-icon,
.menu-toggle.main-menu-toggle .hamburger-icon:before,
.menu-toggle.main-menu-toggle .hamburger-icon:after {
  display: block;
  width: 26px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  content: '';
  margin: 6px 0;
  transition: all 0.3s;
}
.menu-toggle.main-menu-toggle .hamburger-icon {
  position: relative;
  height: 22px;
  width: 26px;
}
.menu-toggle.main-menu-toggle .hamburger-icon:before {
  position: absolute;
  top: 0;
  left: 0;
}
.menu-toggle.main-menu-toggle .hamburger-icon:after {
  position: absolute;
  bottom: 0;
  left: 0;
}

/* ## Top Bar */
.header-top-bar {
    background-color: var(--header-top-bar-bg);
    padding-top: 0.3rem;
    font-size: 0.85rem;
    min-height: 30px;
}

.header-top-bar-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.header-top-left {
    display: none; /* Hidden or empty */
}

.header-top-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-top-link {
    text-decoration: none;
    color: var(--link-color);
}
.header-top-link:hover {
    color: var(--link-hover-color);
}

.social-navigation {
    /* Container styles if needed */
}

.social-links-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.75rem;
}

.social-links-menu li {
    margin: 0;
    padding: 0;
    line-height: 1;
}

.social-links-menu a.social-icon-link { /* Target WP Walker generated links */
    display: block;
    color: var(--link-color);
    padding: 5px;
    line-height: 0; /* Collapse line height for icon alignment */
}

.social-links-menu a.social-icon-link:hover {
    color: var(--link-hover-color);
}

.social-links-menu svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
}

/* ## Main Header (Logo, Search, Toggle) */
.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.site-branding {
    text-align: left;
    margin-bottom: 0;
    flex-shrink: 0;
    margin-right: 1.5rem;
    max-width: 250px; /* Limit logo/title width */
}

.custom-logo-link img,
.site-branding img.custom-logo {
    width: 100%;
    max-width: 143px;
    height: auto;
}

.site-title a {
    font-size: 1.8rem; /* Adjust if using title instead of logo */
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
}

/* Hide site title and description if logo is present */
.custom-logo + .site-title,
.custom-logo ~ .site-description,
.site-description { /* Always hide description */
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.header-main-right {
    display: flex;
    align-items: center;
    gap: 1rem; /* Space between search and toggle */
}

.search-form {
    position: relative;
    display: flex;
    max-width: 280px;
    width: 100%;
}

label.screen-reader-text {
    /* Hidden by core WP styles or screen-reader-text class */
}

.search-field {
    padding: 0.6rem 3.5rem 0.6rem 1rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 0.9rem;
    width: 100%;
    background-color: #f9f9f9;
    transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.search-field:focus {
    border-color: var(--primary-accent);
    background-color: #fff;
    outline: none;
}

.search-submit {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    transform: none;
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 0 15px;
    font-size: 1rem;
    line-height: 1;
    border-radius: 0 20px 20px 0;
    width: 45px;
}

.search-submit:hover {
    color: #000;
    background: transparent;
}

/* Main Menu Toggle Button (Always Visible) */
.menu-toggle.main-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-accent);
    border: 1px solid var(--header-border-color);
    padding: 0;
    cursor: pointer;
    color: var(--secondary-accent);
    flex-shrink: 0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    box-sizing: border-box;
    line-height: 1;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.menu-toggle.main-menu-toggle:hover {
    background-color: white;
    border-color: var(--primary-accent);
    color: var(--secondary-accent) ;
}

/* Hamburger Icon */
.menu-toggle .hamburger-icon {
    display: block;
    width: 20px;
    height: 2px;
    background-color: currentColor;
    position: relative;
    transition: background-color 0.1s 0.2s ease-in-out;
    border-radius: 1px;
}

.menu-toggle .hamburger-icon::before,
.menu-toggle .hamburger-icon::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    position: absolute;
    left: 0;
    transition: transform 0.3s ease-in-out, top 0.3s ease-in-out, bottom 0.3s ease-in-out;
    border-radius: 1px;
}

.menu-toggle .hamburger-icon::before {
    top: -6px;
}

.menu-toggle .hamburger-icon::after {
    bottom: -6px;
}

/* Transform hamburger to X when panel is open */
body.primary-menu-panel-open .menu-toggle .hamburger-icon {
    background-color: transparent; /* Hide middle bar */
    transition: background-color 0.1s ease-in-out; /* Faster fade out for middle */
}

body.primary-menu-panel-open .menu-toggle .hamburger-icon::before {
    top: 0;
    transform: rotate(-45deg);
    transition: transform 0.3s ease-in-out, top 0.3s ease-in-out;
}

body.primary-menu-panel-open .menu-toggle .hamburger-icon::after {
    bottom: 0;
    transform: rotate(45deg);
    transition: transform 0.3s ease-in-out, bottom 0.3s ease-in-out;
}

/* ## Secondary Navigation Bar */
/* Eliminar barra secundaria completamente */
.header-secondary-bar,
.header-secondary-bar-inner,
.secondary-navigation,
ul.secondary-menu {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: none !important;
}

/* Drag-to-Scroll Helper Styles (Activated by JS) */
.header-secondary-bar.is-active,
.header-secondary-bar.is-dragging {
    cursor: grabbing;
}
.header-secondary-bar.is-dragging ul.secondary-menu a {
    pointer-events: none; /* Prevent link clicks during drag */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ## Panel Menu (Off-Canvas) */
.primary-menu-panel-container {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: var(--panel-width);
    max-width: 85%; /* Limit on very small screens */
    height: 100vh;
    background-color: var(--primary-accent);
    color: var(--secondary-accent);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); /* Smooth transition */
    overflow-y: auto;
    visibility: hidden; /* Hide initially */
}

.primary-menu-panel-container.is-open {
    transform: translateX(0);
    visibility: visible;
}

.primary-menu-panel-inner {
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Panel Close Button */
.close-menu-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--panel-text-color);
    cursor: pointer;
    padding: 5px;
    line-height: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-menu-toggle:hover {
    color: var(--primary-accent);
}

.close-icon {
    display: block;
    width: 20px;
    height: 2px;
    background-color: currentColor;
    position: relative;
    transform: rotate(45deg);
}

.close-icon::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    position: absolute;
    left: 0;
    top: 0;
    transform: rotate(90deg);
}

/* Navigation within Panel */
.main-navigation-panel {
    margin-top: 2.5rem; /* Space below close button */
    flex-grow: 1; /* Occupy available space */
}

ul.primary-menu-panel-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.primary-menu-panel-list li {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle separator */
}

ul.primary-menu-panel-list li:last-child {
    border-bottom: none;
}

ul.primary-menu-panel-list a {
    display: block;
    padding: 0.8rem 1rem; /* Adjusted padding for consistent spacing */
    text-decoration: none;
    color: var(--panel-text-color);
    font-size: 1.1rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s; /* Added transition */
    border-radius: 5px; /* Added base radius */
}

ul.primary-menu-panel-list a:hover,
ul.primary-menu-panel-list li.current-menu-item > a,
ul.primary-menu-panel-list li.current-menu-ancestor > a {
    background-color: var(--panel-link-hover-bg); /* Subtle background */
    color: #fff; /* Brighter white on hover/active */
    /* padding-left: 0.5rem; <- Removed indentation */
    /* Padding is now consistent with default state */
}

/* Submenus in panel */
ul.primary-menu-panel-list ul.sub-menu {
    list-style: none;
    padding: 0.5rem 0 0.5rem 1.5rem; /* Indent */
    margin: 0;
    background-color: rgba(0, 0, 0, 0.2); /* Slightly different background */
}

ul.primary-menu-panel-list ul.sub-menu li {
    border: none; /* Remove borders from subitems */
}

ul.primary-menu-panel-list ul.sub-menu a {
    font-size: 1rem; /* Slightly smaller */
    padding: 0.6rem 0;
}

ul.primary-menu-panel-list ul.sub-menu a:hover,
ul.primary-menu-panel-list ul.sub-menu li.current-menu-item > a,
ul.primary-menu-panel-list ul.sub-menu li.current-menu-ancestor > a {
    background-color: var(--panel-link-hover-bg);
    color: #fff;
    padding-left: 0.5rem; /* Slight indentation on hover */
}

body.primary-menu-panel-open .panel-overlay {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0s linear 0s;
}

/* Remove old/obsolete header styles */
.main-navigation {
    width: auto; /* Resetting just in case, likely not needed */
}
.header-secondary-nav {
     display: none !important; /* Hide old secondary nav container */
}

/*--------------------------------------------------------------
# Header Responsive Adjustments
--------------------------------------------------------------*/

/* Tablet */
@media (min-width: 768px) {
    /* Logo Size */
    .custom-logo-link img,
    .site-branding img.custom-logo {
        width: 100%;
        max-width: 143px;
    }
}

/* Desktop */
@media (min-width: 992px) {
}

/* Larger Desktop / Container Breakpoint */
@media (min-width: 1200px) {
    /* Logo Size */
    .custom-logo-link img,
    .site-branding img.custom-logo {
        width: 100%;
        max-width: 143px;
    }
}

/*--------------------------------------------------------------
# Additional Header Styles (Previously Inline)
--------------------------------------------------------------*/

/* Adjust secondary menu container width */
.header-secondary-bar .header-secondary-bar-inner {
    background-color: var(--primary-accent);
    max-width: 1200px;
    border-radius: 10px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    padding: 0;
}

/* Ensure the inner container takes the full width for background */
.header-secondary-bar {
    width: 95%;
}

.header-secondary-bar-inner {
    margin-left: 15px;
    margin-right: 15px;
    padding-left: 15px;
    padding-right: 15px;
}

/* Ensure primary menu panel is visible when open, regardless of context */
#primary-menu-panel.is-open {
    display: block !important; /* Force display */
    opacity: 1 !important; /* Force visibility */
    z-index: 99998 !important; /* High z-index */
    visibility: visible !important; /* Ensure visibility */
}

#primary-menu-panel .panel-overlay {
     display: block !important; /* Force display */
     opacity: 1 !important; /* Force visibility */
     z-index: 99997 !important; /* Just below the panel */
     visibility: visible !important; /* Ensure visibility */
}

/* Category menu item hover style */
.header-secondary-bar .category-menu li a {
    text-decoration: none; /* Remove default underline */
    border-bottom: none; /* Explicitly remove bottom border */
    padding: 5px 10px; /* Add padding */
    border-radius: 5px; /* Rounded corners */
    transition: background-color 0.3s, color 0.3s; /* Smooth transition */
    display: inline-block; /* Ensure padding and radius apply correctly */
    margin: 2px 0; /* Add small vertical margin */
}

.header-secondary-bar .category-menu li a:hover,
.header-secondary-bar .category-menu li.current-cat a /* Style for current category */
{
    background-color: var(--secondary-accent); /* Background color on hover/current */
    color: black; /* Text color on hover/current */
    text-decoration: none; /* Ensure no underline */
    border-bottom: none; /* Ensure no border */
} 

/* Botón destacado tipo Go PRO */
.header-main-right .go-pro-btn {
  background: #ff4d4f;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.2rem;
  font-weight: 700;
  margin-left: 0.5rem;
  transition: background 0.2s;
}
.header-main-right .go-pro-btn:hover {
  background: #d9363e;
}

/* Menú secundario (opcional) */
.header-secondary-bar {
  background: #fff;
  border-bottom: 1px solid #f2f2f2;
  font-size: 0.98rem;
} 

/* Header main: logo a la izquierda, menú a la derecha, luego buscador y CTA */
.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}
.site-branding {
  flex: 0 0 auto;
}
.main-navigation.desktop-menu {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-left: 2rem;
}
.primary-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.primary-menu > li {
  position: relative;
}
.primary-menu > li > a {
  color: #232946;
  font-weight: 600;
  font-size: 1.08rem;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  letter-spacing: 0.01em;
}
.primary-menu > li > a:hover, .primary-menu > li.current-menu-item > a {
  background: #f7eaea;
  color: #e53e3e;
  box-shadow: 0 2px 8px 0 rgba(229,62,62,0.07);
}
.primary-menu > li.menu-item-has-children > a:after {
  content: '\25BE';
  font-size: 0.7em;
  margin-left: 0.4em;
  color: #b8b8d1;
}
.primary-menu ul.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px 0 rgba(44,62,80,0.10);
  min-width: 180px;
  z-index: 10;
  padding: 0.5rem 0;
}
.primary-menu > li:hover > ul.sub-menu {
  display: block;
}
.primary-menu ul.sub-menu li a {
  padding: 0.5rem 1.2rem;
  color: #232946;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
}
.primary-menu ul.sub-menu li a:hover {
  background: #f7eaea;
  color: #e53e3e;
}

/* Responsive: solo mostrar hamburguesa en mobile, ocultar menú principal */
.menu-toggle.main-menu-toggle {
  display: none;
}
@media (max-width: 900px) {
  .main-navigation.desktop-menu {
    display: none;
  }
  .menu-toggle.main-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
  }
}

/* Go PRO button: icono a la izquierda, alineado */
.go-pro-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: #ff4d4f;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.2rem;
  font-weight: 700;
  margin-left: 0.5rem;
  font-size: 1.05rem;
  box-shadow: 0 2px 8px 0 rgba(229,62,62,0.07);
  transition: background 0.2s;
  text-decoration: none;
}
.go-pro-btn:hover {
  background: #d9363e;
}
.go-pro-btn .go-pro-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.4em;
} 

@media (min-width: 901px) {
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    z-index: 1000;
    box-shadow: 0 2px 16px 0 rgba(0,0,0,0.04);
    border-bottom: 1px solid #f2f2f2;
  }
  body {
    padding-top: 84px; /* Ajusta según la altura real del header */
  }
}
@media (max-width: 900px) {
  .site-header {
    position: sticky;
    top: 0;
    width: 100%;
    background: #fff;
    z-index: 1000;
    box-shadow: 0 2px 16px 0 rgba(0,0,0,0.04);
    border-bottom: 1px solid #f2f2f2;
  }
  body {
    padding-top: 0;
  }
} 