/* ══════════════════════════════════════════════════════════════════════
   BUSCADOR SIEMPRE VISIBLE (ARRIBA)
   ══════════════════════════════════════════════════════════════════════ */
#pos-search-bar {
    background: #fff;
    padding: 16px 20px;
    border-bottom: 2px solid #e1e1e6;
    position: sticky;
    top: 0;
    z-index: 100;
}

#pos-search-bar input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e1e1e6;
    border-radius: 8px;
    font-size: 15px;
    transition: all .2s;
}

#pos-search-bar input:focus {
    outline: none;
    border-color: #b051dc;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .1);
}

/* ══════════════════════════════════════════════════════════════════════
   PESTAÑAS DEBAJO DEL BUSCADOR
   ══════════════════════════════════════════════════════════════════════ */
.pos-tabs {
    display: flex;
    gap: 0;
    background: #f8f9fa;
    padding: 0;
    border-bottom: 2px solid #e1e1e6;
}

.pos-tab {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
}

.pos-tab:hover {
    background: rgba(139, 92, 246, .05);
    color: #b051dc;
}

.pos-tab.active {
    background: #fff;
    color: #b051dc;
    border-bottom-color: #b051dc;
}

.pos-tab i {
    font-size: 16px;
}

/* ══════════════════════════════════════════════════════════════════════
   CONTENEDORES DE PESTAÑAS
   ══════════════════════════════════════════════════════════════════════ */
.pos-tab-content {
    display: none;
}

.pos-tab-content.active {
    display: block;
}

/* ══════════════════════════════════════════════════════════════════════
   BREADCRUMBS
   ══════════════════════════════════════════════════════════════════════ */
.pos-breadcrumbs {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
    overflow-x: auto;
    white-space: nowrap;
}

.pos-breadcrumb-item {
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all .2s;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pos-breadcrumb-item:hover {
    background: #e9ecef;
    color: #495057;
}

.pos-breadcrumb-item:last-child {
    color: #212529;
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════════════
   GRID DE CATEGORÍAS (TARJETAS MÁS GRANDES)
   ══════════════════════════════════════════════════════════════════════ */
.pos-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 24px;
}

.pos-category-card {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: all .25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 200px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.pos-category-card:hover {
    border-color: #b051dc;
    box-shadow: 0 8px 24px rgba(139, 92, 246, .15);
    transform: translateY(-4px);
}

.pos-category-card.subcategories {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
}

.pos-category-card.subcategories .cat-icon {
    color: #b051dc;
}

.pos-category-card.products {
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}

.pos-category-card.products .cat-icon {
    color: #10b981;
}

.pos-category-card.empty {
    opacity: .5;
    cursor: not-allowed;
}

.pos-category-card.empty:hover {
    transform: none;
    border-color: #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

/* ══════════════════════════════════════════════════════════════════════
   IMAGEN DE CATEGORÍA (OCUPA TODA LA TARJETA)
   ══════════════════════════════════════════════════════════════════════ */
.pos-category-card .cat-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pos-category-card .cat-image {
     width: 100% !important;
    height: 100%;
    object-fit: contain;
}

/* Icono cuando no hay imagen */
.pos-category-card .cat-icon {
    font-size: 64px;
    color: #dee2e6;
    padding: 40px 0;
    text-align: center;
    transition: all .2s;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pos-category-card:hover .cat-icon {
    transform: translate(-50%, -50%) scale(1.1);
    color: #adb5bd;
}

/* ══════════════════════════════════════════════════════════════════════
   INFO DE CATEGORÍA (SUPERPUESTA SOBRE LA IMAGEN)
   ══════════════════════════════════════════════════════════════════════ */
.cat-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 80px;
    z-index: 2;
}

.cat-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.3;
    text-align: left;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cat-badge {
    display: inline-block;
    font-size: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    text-align: left;
    align-self: flex-start;
}

.cat-badge.cat-empty {
    background: rgba(255, 255, 255, 0.15);
}

.cat-arrow {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 18px;
    color: #fff;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(10px);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    z-index: 3;
}

.pos-category-card:hover .cat-arrow {
    background: #b051dc;
    transform: translateX(2px);
}

/* ══════════════════════════════════════════════════════════════════════
   PRODUCTOS EN GRID
   ══════════════════════════════════════════════════════════════════════ */
#pos-categories-list .product-grid {
    padding: 24px;
}

/* ══════════════════════════════════════════════════════════════════════
   BOTÓN EDITAR IMAGEN EN GESTIÓN
   ══════════════════════════════════════════════════════════════════════ */
.pos-cat-edit-image {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all .2s;
    margin-right: 8px;
    font-size: 14px;
    color: #6c757d;
}

.pos-cat-edit-image:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .pos-categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
        padding: 16px;
    }

    .pos-category-card {
        min-height: 180px;
    }

    .pos-category-card .cat-image-wrapper {
        height: 120px;
    }

    .cat-icon {
        font-size: 48px;
        padding: 30px 0;
    }

    .cat-name {
        font-size: 14px;
    }
}