/*
 * GeneratePress Layout Overrides
 * Sobreescribe el layout de GP para que el tema custom funcione correctamente.
 * Este archivo se carga con prioridad alta via wp_enqueue_style.
 *
 * NOTA: !important es necesario aquí para sobrescribir los estilos inline
 * que GeneratePress inyecta via JavaScript.
 */

/* ============================================================
   REMOVE GP STICKY-HEADER BODY PADDING
   GP mide la altura del header y inyecta padding-top o un
   placeholder div #sticky-placeholder. Ambos causan el espacio
   blanco sobre nuestro topbar/header custom.
============================================================ */
body.castlo-industrial-theme {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* GP's sticky-nav JS placeholder div */
body.castlo-industrial-theme #sticky-placeholder,
body.castlo-industrial-theme .sticky-placeholder,
body.castlo-industrial-theme #nav-placeholder {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================================
   WORDPRESS ADMIN BAR OFFSETS
   Cuando está la barra de admin de WordPress, <html> recibe
   margin-top: 32px del core. Ajustar nuestro sticky header.
============================================================ */
.admin-bar #castlo-topbar  { top: 32px; }
.admin-bar #castlo-header  { top: 72px; } /* 32px admin bar + 40px topbar */

@media screen and (max-width: 782px) {
    .admin-bar #castlo-topbar { top: 46px; }
    .admin-bar #castlo-header { top: 86px; }
}

/* ============================================================
   NEUTRALIZE GP LAYOUT CONTAINERS
   GP aplica flex/grid a .site, .site-content, .hfeed etc.
   que hace que nuestras secciones full-width se rendericen
   en columnas side-by-side. Forzar display:block.
============================================================ */
body.castlo-industrial-theme .site,
body.castlo-industrial-theme #page,
body.castlo-industrial-theme .site-content,
body.castlo-industrial-theme #content,
body.castlo-industrial-theme .inside-site-inner,
body.castlo-industrial-theme .grid-container,
body.castlo-industrial-theme .hfeed {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

body.castlo-industrial-theme .entry,
body.castlo-industrial-theme .entry-content,
body.castlo-industrial-theme .page-content {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ============================================================
   HIDE GP NAVIGATION ELEMENTS
   GP renderiza su propia nav que choca con la nuestra.
   La ocultamos completamente.
============================================================ */
body.castlo-industrial-theme .nav-primary,
body.castlo-industrial-theme .main-navigation,
body.castlo-industrial-theme #site-navigation,
body.castlo-industrial-theme .generate-skip-link,
body.castlo-industrial-theme .mobile-menu-control-wrapper {
    display: none !important;
}

/* ============================================================
   HIDE GP DEFAULT HEADER/FOOTER
   GP puede renderizar su propio header/footer. Los ocultamos
   ya que tenemos los nuestros en header.php / footer.php.
============================================================ */
body.castlo-industrial-theme .site-header,
body.castlo-industrial-theme .site-footer {
    display: none !important;
}

/* ============================================================
   FIX GP SIDEBAR AREA
   En páginas que no son catalog/shop, GP puede intentar
   renderizar un sidebar que choca con nuestro layout.
============================================================ */
body.castlo-industrial-theme .sidebar-primary,
body.castlo-industrial-theme #sidebar-primary {
    display: none !important;
}

/* ============================================================
   MOBILE MENU DRAWER
   Nuestro drawer custom; asegurar que GP no interfiera con
   el transform/visibility que controlamos via JS propio.
============================================================ */
body.castlo-industrial-theme .mobile-menu-drawer {
    transform: translateX(-110%) !important;
    visibility: hidden;
    left: 0 !important;
    transition: transform 0.3s ease, visibility 0.3s ease !important;
}
body.castlo-industrial-theme .mobile-menu-drawer.open {
    transform: translateX(0) !important;
    visibility: visible !important;
}
