/* ═══════════════════════════════════════════════
   Macopa — Sidebar Flotante CSS
═══════════════════════════════════════════════ */

/* FAB button */
#macopa-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99990;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #b10023;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(177,0,35,.4);
    transition: transform .2s, box-shadow .2s;
    border: none;
}
#macopa-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(177,0,35,.5);
}

/* Overlay */
#macopa-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99991;
    backdrop-filter: blur(2px);
}
#macopa-sidebar-overlay.macopa-active { display: block; }

/* Sidebar panel */
#macopa-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    z-index: 99992;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 32px rgba(0,0,0,.15);
    transition: right .3s cubic-bezier(.4,0,.2,1);
}
#macopa-sidebar.macopa-open { right: 0; }

/* Header */
#macopa-sidebar-header {
    background: #1a1a1a;
    color: #fff;
    padding: 16px 18px 12px;
    flex-shrink: 0;
}
#macopa-sidebar-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
#macopa-sidebar-logo img {
    max-height: 36px;
    width: auto;
}
#macopa-logo-text {
    font-size: 1.1em;
    font-weight: 700;
    color: #fff;
}
#macopa-sidebar-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color .15s;
}
#macopa-sidebar-close:hover { color: #fff; }

/* Search */
#macopa-sidebar-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.1);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
}
#macopa-sidebar-search-wrap svg { flex-shrink: 0; opacity: .6; }
#macopa-sidebar-search {
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: .9em;
    width: 100%;
}
#macopa-sidebar-search::placeholder { color: rgba(255,255,255,.5); }

/* Breadcrumb */
#macopa-sidebar-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: .78em;
    color: rgba(255,255,255,.7);
    min-height: 20px;
}
.macopa-crumb {
    cursor: pointer;
    transition: color .15s;
}
.macopa-crumb:hover, .macopa-crumb.active { color: #fff; }
.macopa-crumb-sep { opacity: .4; }

/* Body */
#macopa-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
#macopa-sidebar-body::-webkit-scrollbar { width: 4px; }
#macopa-sidebar-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* Loading */
.macopa-sidebar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #aaa;
    gap: 12px;
    font-size: .9em;
}

/* Category items en sidebar */
.macopa-sidebar-cat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background .12s;
}
.macopa-sidebar-cat-item:hover { background: #fafafa; }
.macopa-sidebar-cat-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}
.macopa-sidebar-cat-info { flex: 1; min-width: 0; }
.macopa-sidebar-cat-name {
    font-size: .92em;
    font-weight: 600;
    color: #1a1a1a;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.macopa-sidebar-cat-count { font-size: .75em; color: #aaa; }
.macopa-sidebar-cat-arrow { color: #ccc; flex-shrink: 0; }

/* Product items en sidebar */
.macopa-sidebar-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    transition: background .12s;
}
.macopa-sidebar-product-item:hover { background: #fafafa; }
.macopa-sidebar-product-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}
.macopa-sidebar-product-title {
    font-size: .88em;
    color: #1a1a1a;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No results */
.macopa-sidebar-empty {
    text-align: center;
    padding: 40px 20px;
    color: #bbb;
    font-size: .88em;
}

/* Search results highlight */
.macopa-sidebar-search-results .macopa-sidebar-section-title {
    padding: 10px 18px 6px;
    font-size: .72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #aaa;
    background: #f8f8f8;
}

@media (max-width: 480px) {
    #macopa-sidebar { width: 100vw; right: -100vw; }
    #macopa-fab { bottom: 20px; right: 20px; }
}
