/* =========================================
    VARIABLES GLOBALES Y RESET
    ========================================= */
:root {
    --color-fondo: #f8f9fa;
    --color-blanco: #ffffff;
    --color-texto: #333;
    --color-texto-suave: #666;
    --color-primario: #8b5e3c;
    --radio-borde: 12px;
    --transicion-suave: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --sombra-ligera: 0 2px 8px rgba(0, 0, 0, 0.1);
    --sombra-media: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Wrapper general para aislamiento */
.tienda-body-wrapper {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--color-fondo);
    color: var(--color-texto);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.tienda-body-wrapper a {
    text-decoration: none;
    color: inherit;
}

/* =========================================
    ESTILOS PARA PLANTILLA POR DEFECTO (Solo aplican si no hay diseño custom)
    ========================================= */
.tienda-header-container {
    background-color: var(--color-blanco);
    border-radius: var(--radio-borde);
    overflow: hidden;
    box-shadow: var(--sombra-media);
    margin: 20px auto;
    max-width: 1200px;
}

.tienda-cover-image {
    height: 280px;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #e0e0e0;
}

.edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transicion-suave);
    cursor: pointer;
    color: white;
    font-weight: 600;
}

.tienda-cover-image:hover .edit-overlay {
    opacity: 1;
}

.tienda-perfil-info {
    display: flex;
    align-items: flex-end;
    padding: 0 40px 25px 40px;
    gap: 25px;
    position: relative;
}

.tienda-avatar-wrapper {
    position: relative;
    margin-top: -75px;
    z-index: 10;
    flex-shrink: 0;
}

.tienda-avatar-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 6px solid var(--color-blanco);
    object-fit: cover;
    background-color: var(--color-blanco);
    box-shadow: var(--sombra-ligera);
}

.avatar-edit-trigger {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--color-primario);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 3px solid white;
    cursor: pointer;
    transition: transform 0.2s;
}

.avatar-edit-trigger:hover {
    transform: scale(1.1);
}

.tienda-textos {
    flex: 1;
    padding-bottom: 10px;
}

.tienda-titulo {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.tienda-slogan {
    margin: 5px 0 0 0;
    color: var(--color-texto-suave);
    font-size: 1.05rem;
}

.tienda-nav {
    border-top: 1px solid #f0f0f0;
    margin-top: 15px;
}

.nav-lista {
    display: flex;
    list-style: none;
    padding: 0 40px;
    gap: 40px;
    margin-bottom: 0;
}

.nav-link {
    display: block;
    padding: 20px 0;
    color: var(--color-texto-suave);
    font-weight: 600;
    position: relative;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.activo {
    color: var(--color-primario);
}

.nav-link.activo::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-primario);
    border-radius: 3px 3px 0 0;
}

.contenedor-maestro-tienda {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 20px 60px;
}

.tienda-intro p {
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-texto-suave);
    margin-bottom: 40px;
}

.coleccion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.seccion-titulo {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-texto);
    margin: 0;
}

.tienda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 10px;
    padding-top: 20px; /* Espacio para que las tarjetas suban sin cortarse */
}

.producto-card {
    border: none;
    background: transparent;
    display: block;
    transition: transform 0.3s ease;
}

.producto-card:hover {
    transform: translateY(-5px);
}

.producto-imagen-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f4f4f4;
    display: block;
    transform: translateZ(0);
}

.producto-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.4s ease;
}

.img-front {
    z-index: 10;
    opacity: 1;
}

.img-back {
    z-index: 5;
    opacity: 0;
}

.producto-imagen-wrapper:hover .img-front {
    opacity: 0;
}

.producto-imagen-wrapper:hover .img-back {
    opacity: 1;
}

.producto-info {
    margin-top: 12px;
}

.producto-nombre {
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    color: #333;
}

.producto-precio {
    font-size: 0.95rem;
    font-weight: 700;
    color: #000;
}

.categoria-tag {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-add-wrapper {
    display: block;
    text-decoration: none !important;
    height: 100%;
}

.btn-add-full {
    width: 100%;
    height: 280px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: var(--transicion-suave);
    box-sizing: border-box;
}

.card-add-wrapper:hover .btn-add-full {
    border-color: #333;
    color: #333;
    background-color: #fcfcfc;
}

.icon-plus {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 10px;
    font-weight: 300;
}

.text-add {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Mensaje vacío mejorado */
.mensaje-vacio {
    text-align: center;
    padding: 50px 20px;
    color: var(--color-texto-suave);
}

.mensaje-vacio i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ccc;
}

/* =========================================
    BOTÓN FLOTANTE DE GESTIÓN (FAB) - Ahora en esquina superior derecha
    ========================================= */
.admin-fab-container {
    position: fixed;
    top: 80px;  /* Cambiado de bottom a top */
    right: 30px;
    z-index: 9999;
    font-family: system-ui, -apple-system, sans-serif;
}

.admin-fab-btn {
    width: 60px;
    height: 60px;
    background-color: #2c3e50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    border: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.admin-fab-btn:hover {
    transform: scale(1.1);
    background-color: #34495e;
}

.admin-fab-icon {
    font-size: 24px;
}

.admin-menu {
    position: absolute;
    top: 70px;  /* Cambiado de bottom a top para abrir hacia abajo desde arriba */
    right: 0;
    width: 240px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.admin-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.admin-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.admin-menu-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.admin-menu-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.admin-menu-header {
    padding: 8px 20px;
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid #e9ecef;
}

/* Responsive */
@media (max-width: 768px) {
    .tienda-perfil-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .tienda-avatar-wrapper {
        margin-top: -50px;
    }

    .nav-lista {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
    }

    .tienda-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .producto-imagen-wrapper,
    .btn-add-full {
        height: 200px;
    }

    .admin-menu {
        width: 200px; /* Más estrecho en móvil */
    }
}


.admin-menu-label {
    display: block;
    padding: 10px 15px;
    font-weight: bold;
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.admin-submenu {
    padding-left: 10px;
    border-left: 2px solid #eee;
    margin-left: 15px;
    margin-bottom: 10px;
}
.admin-submenu-item {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.admin-submenu-item:hover {
    color: #2d5a27;
    padding-left: 20px;
}