/* ==========================================================================
   FERRETERIA.ES - NAVEGACIÓN MÓVIL (OFF-CANVAS DRAWER & STICKY BOTTOM BAR)
   ========================================================================== */

:root {
    --fer-orange: #FF6600;
    --fer-orange-hover: #ff7a1f;
    --fer-dark-bg: #000000;
    --fer-card-bg: #0d0d0d;
    --fer-border: #222222;
    --fer-text: #ffffff;
    --fer-muted: #999999;
}

/* Espacio en móvil para la barra inferior */
@media (max-width: 768px) {
    body {
        padding-bottom: 65px !important;
    }
}

/* --------------------------------------------------------------------------
   1. OFF-CANVAS OVERLAY & DRAWER
   -------------------------------------------------------------------------- */
body.fer-drawer-is-open {
    overflow: hidden !important;
}

.fer-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.fer-drawer-overlay.fer-drawer-active {
    opacity: 1;
    visibility: visible;
}

.fer-mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: #000000;
    border-left: 1px solid #222222;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.95);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    overflow-y: auto;
}

.fer-mobile-drawer.fer-drawer-open {
    transform: translateX(0);
}

/* Drawer Header */
.fer-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #1a1a1a;
    background: #080808;
}

.fer-drawer-logo img {
    height: 28px;
    width: auto;
    display: block;
}

.fer-drawer-close-btn {
    background: transparent !important;
    border: 1px solid #2a2a2a !important;
    color: #ffffff !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

.fer-drawer-close-btn:hover {
    border-color: var(--fer-orange) !important;
    color: var(--fer-orange) !important;
    background: rgba(255, 102, 0, 0.1) !important;
}

/* Drawer Search */
.fer-drawer-search {
    padding: 14px 18px;
    background: #050505;
    border-bottom: 1px solid #1a1a1a;
}

.fer-drawer-search .fer-ai-header-bar {
    width: 100%;
}

.fer-drawer-search .fer-ai-header-form {
    width: 100%;
    box-sizing: border-box;
}

.fer-drawer-search .fer-ai-header-input {
    min-width: 0 !important;
    width: 100% !important;
}

/* Drawer Nav Menu */
.fer-drawer-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.fer-drawer-menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.fer-drawer-menu li {
    margin: 0 !important;
    padding: 0 !important;
}

.fer-drawer-menu li a {
    display: flex !important;
    align-items: center !important;
    padding: 13px 22px !important;
    color: #d8d8d8 !important;
    text-decoration: none !important;
    font-size: 14.5px !important;
    font-weight: 500 !important;
    border-bottom: 1px solid #121212 !important;
    transition: all 0.2s ease !important;
    gap: 12px !important;
}

.fer-drawer-menu li a:hover,
.fer-drawer-menu li.current-menu-item a {
    color: #ffffff !important;
    background: #111111 !important;
    padding-left: 26px !important;
    border-left: 3px solid var(--fer-orange) !important;
}

.fer-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888888;
    transition: color 0.2s ease;
}

.fer-drawer-menu li a:hover .fer-nav-icon {
    color: var(--fer-orange);
}

.fer-highlight-ai a {
    background: rgba(255, 102, 0, 0.06) !important;
}

.fer-highlight-ai a .ai-sparkle {
    color: var(--fer-orange) !important;
    font-size: 18px !important;
}

.fer-nav-tag {
    margin-left: auto;
    background: var(--fer-orange);
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* Drawer Footer */
.fer-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid #1a1a1a;
    background: #080808;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fer-drawer-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 11px 16px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}

.fer-btn-account {
    background: #161616 !important;
    border: 1px solid #2a2a2a !important;
    color: #ffffff !important;
}

.fer-btn-account:hover {
    border-color: var(--fer-orange) !important;
    background: #202020 !important;
}

.fer-btn-whatsapp {
    background: #25d366 !important;
    border: none !important;
    color: #ffffff !important;
}

.fer-btn-whatsapp:hover {
    background: #20ba59 !important;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   2. STICKY BOTTOM NAVIGATION BAR (APP BAR)
   -------------------------------------------------------------------------- */
.fer-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .fer-bottom-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100vw;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid #222222;
        z-index: 99999;
        box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.85);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
    }

    .fer-bottom-nav-inner {
        display: flex;
        align-items: center;
        justify-content: space-around;
        height: 58px;
        max-width: 500px;
        margin: 0 auto;
        padding: 0 4px;
    }

    .fer-bottom-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        height: 100%;
        color: #888888;
        text-decoration: none !important;
        background: transparent !important;
        border: none !important;
        padding: 4px 2px !important;
        cursor: pointer;
        position: relative;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .fer-bottom-item:hover,
    .fer-bottom-item.fer-active {
        color: #ffffff;
    }

    .fer-bottom-icon {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 24px;
        margin-bottom: 2px;
        transition: transform 0.2s ease;
    }

    .fer-bottom-item:active .fer-bottom-icon {
        transform: scale(0.9);
    }

    .fer-bottom-label {
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.2px;
        line-height: 1;
        color: inherit;
    }

    /* Asistente IA Destacado en Barra */
    .fer-bottom-ai {
        color: var(--fer-orange) !important;
    }

    .fer-bottom-ai .ai-glow-icon {
        background: rgba(255, 102, 0, 0.15);
        border: 1px solid rgba(255, 102, 0, 0.4);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        margin-bottom: 2px;
        box-shadow: 0 0 12px rgba(255, 102, 0, 0.35);
    }

    .fer-bottom-ai .fer-bottom-label {
        color: var(--fer-orange);
        font-weight: 700;
    }

    /* Badge del Carrito */
    .fer-bottom-badge {
        position: absolute;
        top: -4px;
        right: -8px;
        background: var(--fer-orange);
        color: #ffffff;
        font-size: 10px;
        font-weight: 800;
        min-width: 17px;
        height: 17px;
        line-height: 17px;
        text-align: center;
        border-radius: 10px;
        padding: 0 4px;
        display: none;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    }

    .fer-bottom-badge.fer-badge-visible {
        display: inline-block;
    }
}
