﻿/* ===================================================
   LAYOUT RESPONSIVE Y PANTALLA COMPLETA
   =================================================== */

/* Contenedor Principal */
.designer-app-container {
    display: flex;
    gap: 20px;
    max-width: 1400px; /* Limita el ancho máximo en pantallas ultrawide */
    margin: 0 auto;
    box-sizing: border-box;
    align-items: flex-start;
}

/* Columna Izquierda: Panel de herramientas */
.designer-sidebar {
    width: 380px; /* Ancho fijo ideal para el catálogo */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Reducimos la altura del catálogo y agregamos scroll interno */
.beads-catalog-wrapper {
    max-height: 70vh; /* Al reducir de 500px a 320px todo sube verticalmente */
    overflow-y: auto;
    padding: 10px;
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Columna Derecha: Vista previa y Canvas */
.designer-main-content {
    flex-grow: 1; /* Ocupa todo el espacio sobrante a la derecha */
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 15px;
    box-sizing: border-box;
}

/* Ajuste del Canvas para que no se desborde verticalmente */
.preview-panel canvas,
.preview-panel svg {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* ===================================================
   1. ESTILOS BASE Y COMPONENTES
   =================================================== */

/* Los componentes usan estas variables para cambiar dinámicamente */
.designer-card {
    background-color: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-effect);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.designer-title {
    font-family: var(--font-heading);
    color: var(--accent-color);
    text-shadow: var(--text-glow);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing);
}

.btn-primary {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: var(--btn-border);
    border-radius: var(--border-radius);
    font-family: var(--font-heading);
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    box-shadow: var(--shadow-effect);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        filter: brightness(1.2);
    }

/* Asegura que el fondo ocupe toda la pantalla */
body {
    background-color: var(--bg-main) !important;
    color: var(--text-color) !important;
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ===================================================
   HEADER OPTIMIZADO & BOTONES DE TEMA
   =================================================== */

.header-container {
    padding: 8px 16px !important;
    margin-bottom: 1px !important;
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.header-content {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 20px !important;
    width: 100% !important;
}

/* Título más pequeño y sin márgenes sobrantes */
.brand-title {
    font-size: 1.25rem !important;
    margin: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* Contenedor de Botones de Colección (Estilo Selector) */
.collections-selector {
    display: flex !important;
    gap: 6px !important;
    background-color: var(--bg-main) !important;
    padding: 3px !important;
    border-radius: var(--border-radius) !important;
    border: 1px solid var(--border-color) !important;
}

/* Estilo individual para los botones de colección */
.btn-collection {
    background: transparent !important;
    color: var(--text-color) !important;
    border: none !important;
    border-radius: calc(var(--border-radius) - 2px) !important;
    padding: 6px 14px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    font-family: var(--font-heading), sans-serif !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    opacity: 0.7;
}

    .btn-collection:hover {
        opacity: 1;
    }

    /* Botón de colección Seleccionado / Activo */
    .btn-collection.active {
        background-color: var(--accent-color) !important;
        color: var(--bg-main) !important;
        opacity: 1 !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    }

/* ===================================================
   BARRA DE HERRAMIENTAS VISUAL DEL CANVAS
   =================================================== */

.canvas-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 6px 10px;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: fit-content;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
    margin: 0 4px;
}

/* Estilo base del botón icónico */
.tool-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    /* Ajuste de dimensiones: más alto y más ancho */
    width: 58px !important;
    height: 52px !important;
    padding: 4px 2px !important;
    box-sizing: border-box !important;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    cursor: pointer;
    outline: none;
}



    .tool-btn:hover {
        transform: translateY(-2px);
        border-color: var(--accent-color);
        box-shadow: var(--shadow-effect);
    }

    .tool-btn:active {
        transform: translateY(0);
    }

/* El icono de Bootstrap */
.tool-icon {
    font-size: 1.2rem !important; /* Tamaño visible para el icono */
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Micro-texto opcional y discreto */
/* El texto debajo del icono */
.tool-label {
    font-size: 0.52rem !important; /* Reducimos ligeramente para texto largo */
    font-weight: 700 !important;
    margin-top: 3px !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
    width: 100%;
    white-space: nowrap; /* Evita saltos de línea extraños */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Variación para acción de advertencia (Eliminar pieza) */
.tool-btn-warning:hover {
    border-color: #f39c12 !important;
    color: #f39c12 !important;
}

/* Variación para acción destructiva (Vaciar todo) */
.tool-btn-danger:hover {
    border-color: #e74c3c !important;
    color: #e74c3c !important;
    background-color: rgba(231, 76, 60, 0.08) !important;
}


/* ===================================================
   BOTÓN DE ACCIÓN PRIMARIA (DESCARGAR)
   =================================================== */

.tool-btn-primary {
    background-color: var(--accent-color) !important;
    color: var(--bg-main) !important; /* Texto oscuro o contrastante */
    border-color: var(--accent-color) !important;
    font-weight: bold;
}

    .tool-btn-primary .tool-label {
        opacity: 1 !important;
    }

    .tool-btn-primary:hover {
        filter: brightness(1.15);
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    }


/* ===================================================
   LAYOUT DE 2 COLUMNAS (CANVAS + STATS RPG)
   =================================================== */

@media (min-width: 769px) {

    /* Contenedor principal de las 2 columnas */
    .workspace-layout {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 20px;
        width: 100%;
        margin-top: 15px;
        box-sizing: border-box;
    }

    /* Columna 1: El Canvas de la Pulsera */
    #canvasContainer {
        width: 100%;
        max-width: 500px;
        aspect-ratio: 1 / 1 !important; /* 🔑 Obliga a ser un cuadrado perfecto */
        margin: 0 auto;
        position: relative;
        touch-action: none !important;
    }

        #canvasContainer canvas,
        .konvajs-content canvas {
            width: 100% !important;
        }


        /* Bloquea el scroll de la página únicamente sobre el lienzo de la pulsera */
        #canvasContainer,
        #canvasContainer canvas,
        .konvajs-content,
        .konvajs-content canvas {
            touch-action: none !important;
            -webkit-user-select: none;
            user-select: none;
        }

    /* Columna 2: Desglose de piezas (Stats RPG) */
    #beadSummaryContainer.stats-sidebar,
    #beadSummaryContainer {
        flex: 1 1 42% !important; /* Ocupa el 42% a la derecha */
        width: 100% !important;
        background-color: var(--bg-main, #ffffff) !important;
        border: 1px solid var(--border-color, #e0e0e0) !important;
        border-radius: var(--border-radius, 8px) !important;
        padding: 14px !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
    }
}

/* ===================================================
   2. COLECCIÓN: ANIME POP / SCI-FI NEÓN
   =================================================== */
[data-theme="anime"] {
    /* Paleta de Fondos Claros */
    --bg-main: #eef2f9; /* Fondo general con ligero matiz helado */
    --bg-card: #ffffff; /* Blanco puro en la tarjeta para resaltar los colores pop */
    /* Textos (Oscuros para legibilidad) */
    --text-color: #0f172a; /* Azul noche muy oscuro */
    /* Detalles visuales */
    --accent-color: #0088cc; /* Azul cian contrastante para el precio */
    --accent-secondary: #d90062; /* Magenta/Rosa Neón */
    --border-color: #cbd5e1; /* Borde gris/azul claro */
    /* Fuentes y Formas */
    --font-heading: 'Orbitron', 'Chakra Petch', sans-serif;
    --letter-spacing: 1.5px;
    --border-radius: 6px;
    --border-width: 2px;
    /* Sombra con un leve toque de luz cian en el hover */
    --shadow-effect: 0 4px 14px rgba(0, 180, 216, 0.2);
    --text-glow: none;
}


/* ===================================================
   3. COLECCIÓN: PROTECCIÓN / MÍSTICA (Piedras & Tierra)
   =================================================== */
[data-theme="proteccion"] {
    /* Paleta de Fondos Claros */
    --bg-main: #f0eae1; /* Fondo general de la página */
    --bg-card: #f9f6f0; /* Fondo de las tarjetas del catálogo */
    /* Textos (Oscuros para legibilidad) */
    --text-color: #2c221e; /* Marrón oscuro/Casi negro */
    /* Detalles visuales */
    --accent-color: #b8860b; /* Dorado/Mostaza (Precios y selecciones) */
    --accent-secondary: #6b3e75; /* Púrpura sutil */
    --border-color: #d8c8b0; /* Borde fino estilo arena/dorado suave */
    /* Fuentes y Formas */
    --font-heading: 'Cinzel', 'Georgia', serif;
    --letter-spacing: 1px;
    --border-radius: 10px;
    --border-width: 1px;
    /* Sombra suave para dar volumen sobre fondo claro */
    --shadow-effect: 0 4px 12px rgba(90, 70, 50, 0.12);
    --text-glow: none;
}


/* ===================================================
   ADAPTACIÓN RESPONSIVE PARA MÓVILES (Max 768px)
   =================================================== */

@media (max-width: 768px) {

    /* 1. Cambiamos el contenedor principal de 2 columnas a 1 columna */
    .designer-app-container {
        flex-direction: column-reverse; /* Pone el Canvas ARRIBA y la Sidebar ABAJO */

        gap: 15px;
    }

    /* 2. Ajustes en la columna del Canvas (Ahora va primero) */
    .designer-main-content {
        width: 100% !important;
        padding: 1px !important;
    }



    /* 3. Toolbar de Botones (Deshacer, Vaciar, Guardar) */
    .canvas-toolbar {
        width: 100% !important;
        justify-content: space-around !important; /* Distribuye los botones a lo ancho */
        padding: 4px !important;
        gap: 2px !important;
    }

    .tool-btn {
        width: 48px !important; /* Ligeramente más compactos */
        height: 48px !important;
    }

    /* 4. Ajustes en la Sidebar (Catálogo y Opciones) */
    .designer-sidebar {
        width: 100% !important;
    }

    /* El Grid de Cuentas en Móvil */
    .beads-grid {
        /* Ajusta tarjetas a un mínimo de 90px para que quepan 3 o 4 por fila */
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
        gap: 8px !important;
    }

    .bead-card {
        width: 30% !important; /* Ocupa el ancho de la celda de la cuadrícula */
        height: 110px !important;
    }

    /* 5. Acordeón / Colapsable para "Desglose de piezas" u "Opciones" */
    /* Si el desglose de piezas es muy largo, le damos scroll interno para no empujar la pantalla */
    .desglose-container {
        max-height: 120px;
        overflow-y: auto;
    }
}

/* ===================================================
   AJUSTES RESPONSIVE MÓVIL (PANTALLA LIMPIA)
   =================================================== */

@media (max-width: 768px) {

    /* --- A) HEADER COMPACTO --- */
    .header-container {
        padding: 8px 12px !important;
    }

    .header-top {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin-bottom: 6px !important;
    }

    /* Reducimos el título "TUS PULSERAS" en móvil */
    .brand-title {
        font-size: 1.1rem !important; /* Bastante más pequeño y discreto */
        margin: 0 !important;
        line-height: 1 !important;
    }

    /* Botón de catálogo compacto alineado a la derecha */
    .btn-toggle-catalog {
        width: auto !important; /* Ya no ocupa el 100% de la pantalla */
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        margin: 0 !important;
    }

    /* Botones de selección de colección más pequeños */
    .collections-selector {
        display: flex !important;
        gap: 6px !important;
    }

    .btn-collection {
        font-size: 0.72rem !important;
        padding: 4px 8px !important;
        flex: 1;
    }


    /* --- B) CANVAS Y PANEL DE VISTA PREVIA --- */
    .preview-panel {
        display: flex !important;
        flex-direction: column !important;
    }

    /* 1. Hacemos que el Lienzo aparezca PRIMERO */
    .canvas-wrapper {
        order: 1 !important;
        width: 100% !important;
        max-width: 320px !important; /* Controla el ancho máximo en teléfono */
        margin: 0 auto 10px auto !important;
        /* MAGIA CSS: Mantiene el lienzo perfectamente cuadrado (1:1) */
        aspect-ratio: 1 / 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

        .canvas-wrapper canvas,
        .canvas-wrapper svg {
            width: 100% !important;
            height: 100% !important;
            object-fit: contain !important; /* Evita que el dibujo se deforme */
        }

    /* 2. Barra de botones SEGUNDO (debajo de la pulsera) */
    .canvas-toolbar {
        order: 2 !important;
        width: 100% !important;
        justify-content: space-around !important;
        margin-bottom: 12px !important;
    }

    /* 3. Desglose de piezas y texto TERCERO (al final) */
    .pieces-summary {
        order: 3 !important;
        font-size: 0.8rem !important;
    }

    .desglose-container {
        max-height: 100px !important; /* Limita altura del desglose con scroll */
        overflow-y: auto !important;
    }
}


/* ===================================================
   MENSAJES DE ESTADO Y NOTIFICACIONES (TOASTS)
   =================================================== */

/* Personalización opcional para Toasts con fondo oscuro místico */
.toast.bg-dark {
    background-color: #2b2520 !important;
    color: #FBF8F3 !important;
    border: 1px solid #C29B38 !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* ===================================================
   DESGLOSE DE PIEZAS (RPG STATS & ATRIBUTOS)
   =================================================== */

/* Título de la sección */
.breakdown-title {
    font-family: var(--font-heading), serif;
    font-size: 0.95rem;
    color: var(--accent-color);
    margin-top: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Lista contenedora */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Tarjeta individual de Atributo */
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 6px 10px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

    .stat-card:hover {
        border-color: var(--accent-color);
        transform: translateX(2px);
    }

/* Info izquierda (Imagen + Nombre + Efecto) */
.stat-main-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Representación visual pequeña de la piedra en la lista */
.stat-bead-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

.stat-bead-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset -2px -2px 4px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
}

/* Textos del atributo */
.stat-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.stat-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-color);
}

.stat-effect {
    font-size: 0.68rem;
    color: var(--accent-color);
    opacity: 0.9;
    font-style: italic;
}

/* Insignia del modificador tipo RPG (ej. +1, +15) */
.stat-buff-badge {
    background: var(--accent-color);
    color: var(--bg-main);
    font-family: var(--font-heading), monospace;
    font-weight: 900;
    font-size: 0.82rem;
    padding: 3px 8px;
    border-radius: calc(var(--border-radius) / 1.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    min-width: 24px;
    text-align: center;
}

/* Mensaje cuando la pulsera no tiene piedras */
.empty-breakdown-msg {
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.6;
    font-style: italic;
    margin: 5px 0;
}

/* ===================================================
   HEADER RESPONSIVE (ESCRITORIO VS MÓVIL)
   =================================================== */

/* 1. ESTILOS PARA PANTALLA GRANDE (Desktop) */
@media (min-width: 769px) {
    .header-content {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 20px !important;
    }

    .collections-selector {
        display: flex !important;
        gap: 6px !important;
    }
}


/* 2. ESTILOS PARA CELULARES (Móvil) */
@media (max-width: 768px) {

    .header-container {
        padding: 10px 12px !important;
    }

    /* Cambiamos a disposición vertical */
    .header-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important; /* Estira los elementos a lo ancho */
        gap: 10px !important;
    }

    /* Fila Superior: Título a la izquierda, Botón Catálogo a la derecha */
    .header-top-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    .brand-title {
        font-size: 1.1rem !important;
        margin: 0 !important;
    }

    /* Botones de Temática: ABAJO DEL TÍTULO */
    .collections-selector {
        display: flex !important;
        width: 100% !important;
        gap: 6px !important;
        background-color: var(--bg-main) !important;
        padding: 3px !important;
        border-radius: var(--border-radius) !important;
        border: 1px solid var(--border-color) !important;
        box-sizing: border-box !important;
    }

    /* Cada botón ocupa el 50% del ancho en móvil */
    .btn-collection {
        flex: 1 !important;
        text-align: center !important;
        padding: 8px 4px !important;
        font-size: 0.75rem !important;
    }
}


/* Botón especial de Asistente en la Toolbar */
.tool-btn-magic {
    background-color: #F8F3E6 !important;
    border-color: #C29B38 !important;
    color: #8C6239 !important;
}

    .tool-btn-magic:hover {
        background-color: #C29B38 !important;
        color: #FFFFFF !important;
        transform: translateY(-1px);
    }

    .tool-btn-magic .tool-icon {
        color: #C29B38;
    }

    .tool-btn-magic:hover .tool-icon {
        color: #FFFFFF;
    }

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
}

.spinner-card {
    background: #2b2520;
    border: 1px solid #C29B38;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.text-gold {
    color: #C29B38 !important;
}

/* ===================================================
   PANELES FLOTANTES DESPLEGABLES (OFFCANVAS)
   =================================================== */

/* Botón Flotante para abrir las Propiedades (Derecha) */
.floating-props-btn {
    position: fixed;
    right: 15px;
    bottom: 15%;
    transform: translateY(-50%);
    z-index: 1000;
    background: var(--bg-card, #2b2520);
    border: 1px solid var(--accent-color, #C29B38);
    color: var(--accent-color, #C29B38);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .floating-props-btn:hover {
        transform: translateY(-50%) scale(1.1);
        background: var(--accent-color, #C29B38);
        color: #fff;
    }

/* Backdrop Oscuro para las Propiedades */
.props-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

    .props-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

/* Drawer / Panel Desplegable desde la Derecha */
.props-drawer-offcanvas {
    position: fixed;
    top: 0;
    right: -360px; /* Oculto fuera de la pantalla */
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-card, #FBF8F3);
    border-left: 2px solid var(--accent-color, #C29B38);
    box-shadow: -5px 0 25px rgba(0,0,0,0.25);
    z-index: 1002;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

    .props-drawer-offcanvas.open {
        right: 0; /* Deslizar hacia adentro */
    }

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color, #E8E2D5);
}

.btn-close-drawer {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
}

/* ===================================================
   COMPORTAMIENTO DUAL: DRAWER (MÓVIL) vs PANEL FIJO (DESKTOP)
   =================================================== */

/* 1. Ocultar botón flotante en pantallas grandes */
@media (min-width: 992px) {
    /* El botón flotante ya no es necesario en PC */
    .floating-props-btn,
    .props-backdrop {
        display: none !important;
    }

    /* Modificar el Drawer para que actúe como columna fija */
    .props-drawer-offcanvas {
        position: static !important; /* Desactiva la posición flotante */
        right: auto !important;
        width: 340px !important;
        max-width: none !important;
        height: auto !important;
        max-height: 520px !important; /* Altura alineada al Canvas */
        border-left: none !important;
        border: 1px solid var(--border-color, #E8E2D5) !important;
        border-radius: var(--border-radius, 12px) !important;
        box-shadow: none !important;
        transition: none !important;
        padding: 15px !important;
        background: var(--bg-card, #FBF8F3) !important;
    }

        /* Ocultar el botón "X" de cerrar en escritorio */
        .props-drawer-offcanvas .btn-close-drawer {
            display: none !important;
        }

    /* Ajustar el contenedor general para que los ponga lado a lado */
    .workspace-layout {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: center !important;
        gap: 20px !important;
    }
}


/* ===================================================
   CONFIGURACIÓN DE PRODUCTO INTEGRADA EN EL CATÁLOGO
   =================================================== */

.catalog-custom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color, #E8E2D5);
}

/* Píldora contenedora */
.catalog-specs-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--bg-main, #FBF8F3);
    border: 1px solid var(--border-color, #E8E2D5);
    border-radius: 20px;
    padding: 3px 10px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.03);
}

.spec-select-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-color, #C29B38);
    font-size: 0.8rem;
}

/* Mini selectores sin bordes pesados */
.mini-spec-select {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color, #3A332C);
    cursor: pointer;
    outline: none;
    padding: 2px 0;
}

    .mini-spec-select:hover {
        color: var(--accent-color, #C29B38);
    }

.pill-divider {
    color: var(--border-color, #E8E2D5);
    font-size: 0.75rem;
    user-select: none;
}

.wizard-custom-input {
    background-color: var(--bg-main, #FBF8F3);
    border: 1px solid var(--accent-color, #C29B38);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    width: 100%;
    box-sizing: border-box;
}

/* Adaptación responsive para pantallas de teléfono muy estrechas */
@media (max-width: 480px) {
    .catalog-custom-header {
        flex-wrap: wrap;
    }

    .catalog-specs-pill {
        width: 100%;
        justify-content: space-around;
        margin-top: 4px;
    }
}

/* ===================================================
   OPTIMIZACIÓN DE TOOLBAR Y MODO MÓVIL SÚPER COMPACTO
   =================================================== */

@media (max-width: 768px) {
    /* Ocultar las etiquetas de texto de los botones solo en móviles */
    .canvas-toolbar .tool-label {
        display: none !important;
    }

    /* Reducir el tamaño de los botones para que quepan los 6 en una sola fila */
    .canvas-toolbar .tool-btn {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
    }

    .canvas-toolbar .tool-icon {
        font-size: 1.2rem !important;
    }

    /* Reducir divisores verticales */
    .canvas-toolbar .toolbar-divider {
        height: 18px !important;
        margin: 0 1px !important;
    }

    .canvas-toolbar {
        gap: 3px !important;
        padding: 4px 6px !important;
    }
}

/* Tarjeta Mini para el Modal de Talla */
.mini-specs-card {
    max-width: 380px !important;
    padding: 22px !important;
    border-radius: 16px !important;
}

/* ===================================================
   BOTÓN FLOTANTE DE WHATSAPP (ESQUINA IZQUIERDA)
   =================================================== */

.btn-whatsapp-float {
    position: fixed;
    right: 20px;
    bottom: 10%;
    z-index: 9990; /* Por debajo de modales y avisos toast */
    width: 52px;
    height: 52px;
    background-color: #25D366;
    color: #FFFFFF !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .btn-whatsapp-float:hover {
        transform: scale(1.1) translateY(-3px);
        background-color: #20ba5a;
        box-shadow: 0 6px 22px rgba(37, 211, 102, 0.6);
        color: #FFFFFF !important;
    }

/* Tooltip emergente al pasar el mouse */
.whatsapp-tooltip {
    position: absolute;
    right: 62px;
    background-color: #2b2520;
    color: #FBF8F3;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    border: 1px solid #C29B38;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateX(-10px);
}

.btn-whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Ocultar tooltip en móviles muy estrechos para no estorbar el canvas */
@media (max-width: 480px) {
    .btn-whatsapp-float {
        right: 15px;
        top: 10%;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .whatsapp-tooltip {
        display: none !important;
    }
}
