/* ==========================================================================
   FORMULARIO DE PRESUPUESTO v2 - Garbi
   Solo layout/estructura - Todo lo visual hereda del tema
   ========================================================================== */

/* Reset - Quitar shadows y estilos visuales que deben heredar del tema */
.garbi-presupuesto-form,
.garbi-presupuesto-form * {
    box-shadow: none !important;
}

/* Estilos globales para iconos */
.garbi-presupuesto-form .dashicons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

/* Contenedor principal */
.garbi-presupuesto-form.garbi-form-v2 {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Layout de dos columnas */
.garbi-form-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

/* Columna principal (formulario) */
.garbi-form-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Columna lateral (resumen) */
.garbi-form-sidebar {
    position: relative;
}

.garbi-sidebar-sticky {
    position: sticky;
    top: 100px;
}

/* ==========================================================================
   SECCIONES
   ========================================================================== */

.garbi-section {
    border: 1px solid;
    overflow: hidden;
}

.garbi-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid;
    cursor: pointer;
    transition: background 0.2s;
}

/* Boton toggle de seccion */
.garbi-section-toggle {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.garbi-section-toggle .garbi-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.garbi-section-toggle .dashicons {
    width: 16px;
    height: 16px;
    line-height: 1;
}

.garbi-section.is-open .garbi-section-toggle .garbi-toggle-icon {
    transform: rotate(180deg);
}

/* Preview de seccion cuando esta cerrada */
.garbi-section-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    margin-left: auto;
    padding: 4px 10px;
    transition: opacity 0.2s;
}

.garbi-section.is-open .garbi-section-preview {
    opacity: 0;
    width: 0;
    padding: 0;
    max-width: 0;
}

.garbi-section-number {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.garbi-section-header h3 {
    margin: 0;
    flex: 1;
}

.garbi-section-status {
}

.garbi-section-body {
    padding: 24px;
    display: none;
}

.garbi-section.is-open .garbi-section-body {
    display: block;
    animation: slideDown 0.3s ease;
}

/* Seccion completada con cuerpo oculto */
.garbi-section.completed:not(.is-open) .garbi-section-header {
    border-bottom: none;
}

/* Secciones bloqueadas (no se puede avanzar sin completar la anterior) */
.garbi-section.is-locked .garbi-section-header {
    cursor: not-allowed;
    opacity: 0.5;
}

.garbi-section.is-locked .garbi-section-toggle {
    cursor: not-allowed;
}

/* Acciones de seccion (boton confirmar) */
.garbi-section-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid;
    display: flex;
    justify-content: flex-end;
}

.garbi-btn-confirm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.garbi-btn-confirm:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.garbi-btn-confirm .dashicons {
    width: 16px;
    height: 16px;
    line-height: 1;
}

.garbi-section-hint {
    margin: 0 0 20px;
}

/* ==========================================================================
   CAMPOS DE FORMULARIO
   ========================================================================== */

.garbi-field {
    margin-bottom: 16px;
}

/* Campos de formulario */
.garbi-field input[type="text"],
.garbi-field input[type="email"],
.garbi-field input[type="tel"],
.garbi-field input[type="number"],
.garbi-field select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid;
    transition: border-color 0.2s;
}

.garbi-field input:focus,
.garbi-field select:focus {
    outline: none;
}

.garbi-field-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
}

/* ==========================================================================
   SECCION UBICACION
   ========================================================================== */

.garbi-ubicacion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.garbi-ubicacion-campos {
    display: flex;
    flex-direction: column;
}

.garbi-ubicacion-mapa {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.garbi-mapa-wrapper {
    position: relative;
    overflow: hidden;
}

#garbi-map-container {
    width: 100%;
    height: 200px;
    z-index: 1;
}

.garbi-mapa-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 2;
    transition: opacity 0.3s;
}

.garbi-mapa-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.garbi-mapa-overlay .dashicons {
    width: 32px;
    height: 32px;
}

.garbi-mapa-overlay p {
    margin: 0;
}

.garbi-btn-ubicacion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
}

/* ==========================================================================
   ESTANCIAS v2 - ACORDEON
   ========================================================================== */

.garbi-estancia-v2 {
    border: 1px solid;
    margin-bottom: 16px;
    overflow: hidden;
}

.garbi-estancia-header-v2 {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid;
    cursor: pointer;
    transition: background 0.2s;
}

/* Boton toggle del acordeon */
.garbi-estancia-toggle {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.garbi-estancia-toggle .dashicons {
    width: 16px;
    height: 16px;
    line-height: 1;
}

.garbi-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.garbi-estancia-v2.is-open .garbi-toggle-icon {
    transform: rotate(180deg);
}

.garbi-estancia-title-v2 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.garbi-estancia-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
}

.garbi-estancia-icon .dashicons {
    width: 16px;
    height: 16px;
    line-height: 1;
}

.garbi-estancia-nombre {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.2s;
    min-width: 0;
}

.garbi-estancia-nombre:focus {
    outline: none;
}

/* Preview cuando esta cerrado */
.garbi-estancia-preview {
    white-space: nowrap;
    padding: 4px 10px;
    transition: opacity 0.2s;
}

.garbi-estancia-v2.is-open .garbi-estancia-preview {
    opacity: 0;
    width: 0;
    padding: 0;
    overflow: hidden;
}

.garbi-remove-estancia-v2 {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.garbi-estancia-v2:first-child .garbi-remove-estancia-v2 {
    display: none;
}

/* Body del acordeon */
.garbi-estancia-body-v2 {
    padding: 20px;
    display: none;
}

.garbi-estancia-v2.is-open .garbi-estancia-body-v2 {
    display: block;
    animation: slideDown 0.3s ease;
}

/* Paso 1: Campo nombre grande */
.garbi-step-nombre {
    margin-bottom: 0;
}

.garbi-step-label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 15px;
}

.garbi-input-nombre-large {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    transition: border-color 0.2s;
}

.garbi-input-nombre-large:focus {
    border-color: #333;
    outline: none;
}

/* Campos ocultos hasta poner nombre */
.garbi-estancia-fields {
    display: none;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.garbi-estancia-v2.has-nombre .garbi-estancia-fields {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Secciones del formulario */
.garbi-estancia-fields > div {
    margin-bottom: 24px;
}

.garbi-estancia-fields > div:last-child {
    margin-bottom: 0;
}

/* Texto opcional */
.garbi-optional {
    font-weight: normal;
    opacity: 0.6;
    font-size: 0.9em;
}

/* Nombre en cabecera */
.garbi-estancia-nombre-display {
    font-weight: 500;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   SELECTOR DE MEDIDA (m2 / Ancho x Largo)
   ========================================================================== */

.garbi-superficie-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid;
}

.garbi-superficie-label {
    display: block;
    margin-bottom: 12px;
}

/* Selector de medida - estilo controlador/switch */
.garbi-medida-selector {
    display: inline-flex;
    gap: 0;
    margin-bottom: 16px;
    background: var(--garbi-medida-bg, #f3f4f6);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--garbi-medida-border, #e5e7eb);
}

/* Botones de selector de medida - estilos independientes */
.garbi-superficie-section .garbi-medida-selector .garbi-medida-btn {
    flex: 0 0 auto;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    padding: 8px 16px !important;
    border: none !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: var(--garbi-medida-text, #6b7280) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none !important;
    text-transform: none !important;
    min-height: auto !important;
    line-height: 1.4 !important;
    position: relative;
}

.garbi-superficie-section .garbi-medida-selector .garbi-medida-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--garbi-text, #374151) !important;
    transform: none !important;
}

.garbi-superficie-section .garbi-medida-selector .garbi-medida-btn.active {
    background: var(--garbi-medida-active-bg, #fff) !important;
    color: var(--garbi-medida-active-text, #1f6fbf) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.garbi-superficie-section .garbi-medida-selector .garbi-medida-btn .dashicons {
    width: 14px !important;
    height: 14px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Modos de medida */
.garbi-medida-mode {
    display: none;
}

.garbi-medida-mode.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* Modo m2 */
.garbi-superficie-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.garbi-input-m2 {
    width: 120px;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.garbi-input-m2:focus {
    outline: none;
    border-color: var(--garbi-primary, #059669);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.garbi-input-suffix {
    color: #6b7280;
    font-weight: 500;
}

/* Modo Ancho x Largo */
.garbi-dimensions-inputs {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.garbi-dimension-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.garbi-dimension-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.garbi-dimension-input input {
    width: 80px;
    padding: 10px 12px;
    border: 1px solid;
    text-align: center;
}

.garbi-dimension-input input:focus {
    outline: none;
}

.garbi-dimension-separator {
    padding-bottom: 10px;
}

.garbi-dimension-result {
    padding-bottom: 10px;
}

.garbi-dimension-total {
    padding: 10px 16px;
}

/* Servicios v2 */
.garbi-servicios-v2,
.garbi-objetos-v2 {
    margin-bottom: 20px;
}

.garbi-servicios-label,
.garbi-objetos-label {
    display: block;
    margin-bottom: 12px;
}

.garbi-servicios-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Objetos con contadores */
.garbi-objetos-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Imagenes */
.garbi-imagenes-section {
    margin-top: 0;
}

.garbi-required {
    color: #c00;
}

/* Dropzone con error */
.garbi-dropzone.has-error {
    border-color: #c00;
    background: rgba(204,0,0,0.03);
}

.garbi-dropzone.has-error .garbi-dropzone-hint {
    color: #c00;
}

/* Dropzone */
.garbi-dropzone {
    position: relative;
    border: 2px dashed #ccc;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.garbi-dropzone:hover {
    border-color: #666;
    background: rgba(0,0,0,0.02);
}

.garbi-dropzone.is-dragover {
    border-color: #0073aa;
    background: rgba(0,115,170,0.05);
}

.garbi-dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.garbi-dropzone-content {
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.garbi-dropzone-content .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #999;
}

.garbi-dropzone:hover .dashicons,
.garbi-dropzone.is-dragover .dashicons {
    color: #0073aa;
}

.garbi-dropzone-text {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Preview de imagenes */
.garbi-dropzone-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.garbi-dropzone-preview:empty {
    display: none;
}

.garbi-preview-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid #ddd;
}

.garbi-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.garbi-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.garbi-preview-remove:hover {
    background: #c00;
}

.garbi-preview-remove .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Boton anadir estancia */
.garbi-btn-add-estancia {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 2px dashed;
    cursor: pointer;
    transition: all 0.2s;
}

/* ==========================================================================
   SECCION CONTACTO
   ========================================================================== */

.garbi-contacto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.garbi-field-full {
    grid-column: span 2;
}

.garbi-crear-cuenta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid;
}

.garbi-crear-cuenta label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.garbi-crear-cuenta input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Password fields - hidden by default, shown when "crear cuenta" checked */
.garbi-password-fields {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.garbi-password-fields .garbi-contacto-grid {
    margin-bottom: 8px;
}

.garbi-password-fields input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid;
    font-size: 15px;
}

.garbi-password-fields input[type="password"]:focus {
    outline: none;
    border-color: var(--garbi-primary, #2563eb);
}

.garbi-password-fields input.garbi-error {
    border-color: #dc2626 !important;
    background-color: rgba(220, 38, 38, 0.05);
}

.garbi-password-hint {
    margin: 0;
    font-size: 13px;
    color: #666;
    opacity: 0.8;
}

.garbi-usuario-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid;
}

.garbi-usuario-info .dashicons {
    width: 24px;
    height: 24px;
}

.garbi-usuario-info div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ==========================================================================
   SIDEBAR - RESUMEN DE PRECIO
   ========================================================================== */

.garbi-resumen-card {
    border: 1px solid;
    padding: 24px;
    box-shadow: none !important;
}

.garbi-resumen-card h4 {
    margin: 0 0 20px;
}

.garbi-resumen-items {
    min-height: 60px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid;
}

.garbi-resumen-empty {
    text-align: center;
    padding: 20px 0;
    margin: 0;
}

.garbi-resumen-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
}

.garbi-resumen-item-name {
    flex: 1;
}

.garbi-resumen-item-price {
    white-space: nowrap;
    margin-left: 12px;
}

.garbi-resumen-totales {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.garbi-resumen-linea {
    display: flex;
    justify-content: space-between;
}

.garbi-resumen-total {
    padding-top: 12px;
    border-top: 2px solid;
    margin-top: 4px;
}

/* Boton de envio */
.garbi-btn-submit {
    width: 100%;
    padding: 16px 24px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.garbi-btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
}

.garbi-btn-submit:disabled {
    cursor: not-allowed;
}

/* Garantias */
.garbi-resumen-garantias {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.garbi-garantia {
    display: flex;
    align-items: center;
    gap: 8px;
}

.garbi-garantia .dashicons {
    width: 14px;
    height: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.garbi-estancia-v2 {
    animation: fadeIn 0.3s ease;
}

.garbi-resumen-total span:last-child.updated {
    animation: pulse 0.3s ease;
}

/* ==========================================================================
   BOTONES ANADIR SERVICIO/OBJETO
   ========================================================================== */

.garbi-section-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.garbi-btn-add-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.2;
}

.garbi-btn-add-item:hover {
    transform: translateY(-1px);
}

.garbi-btn-add-item .dashicons {
    width: 18px;
    height: 18px;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    margin-top: -2px;
}

.garbi-btn-add-item .dashicons::before {
    line-height: 1;
}

.garbi-empty-message {
    text-align: center;
    padding: 20px;
    margin: 0;
    border: 1px dashed;
}

.garbi-servicios-selected:not(:empty) + .garbi-servicios-empty,
.garbi-objetos-selected:not(:empty) + .garbi-objetos-empty {
    display: none;
}

/* Items seleccionados */
.garbi-selected-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.garbi-selected-item-icon {
    width: 36px;
    height: 36px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.garbi-selected-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.garbi-selected-item-icon .dashicons {
    width: 18px;
    height: 18px;
    line-height: 1;
}

.garbi-selected-item-info {
    flex: 1;
    min-width: 0;
}

.garbi-selected-item-name {
}

.garbi-selected-item-price {
    white-space: nowrap;
}

.garbi-selected-item-remove {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

/* Objeto con contador */
.garbi-selected-item .garbi-counter {
    margin-left: auto;
    margin-right: 8px;
}

.garbi-counter {
    display: flex;
    align-items: center;
    gap: 4px;
}

.garbi-counter-btn {
    width: 32px;
    height: 32px;
    border: 1px solid;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.garbi-counter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.garbi-counter-input {
    width: 48px;
    height: 32px;
    text-align: center;
    border: 1px solid;
}

/* ==========================================================================
   MODALES
   ========================================================================== */

.garbi-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.garbi-modal.is-open {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.garbi-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.garbi-modal-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.garbi-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid;
}

.garbi-modal-header h3 {
    margin: 0;
}

.garbi-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

/* Barra de búsqueda del modal */
.garbi-modal-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--garbi-border, #e5e7eb);
    background: var(--garbi-bg, #f9fafb);
}

.garbi-modal-search .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    color: var(--garbi-text-light, #9ca3af);
    flex-shrink: 0;
}

.garbi-modal-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    padding: 4px 0;
    outline: none;
    color: var(--garbi-text, #1f2937);
}

.garbi-modal-search-input::placeholder {
    color: var(--garbi-text-light, #9ca3af);
}

.garbi-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.garbi-modal-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.garbi-modal-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border: 1px solid;
    border-bottom: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.garbi-modal-item:last-child {
    border-bottom: 1px solid;
}

.garbi-modal-item.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Item seleccionado */
.garbi-modal-item.is-selected {
    border-color: var(--garbi-selected-border, #1f6fbf) !important;
}

.garbi-modal-item.is-selected + .garbi-modal-item {
    border-top-color: var(--garbi-selected-border, #1f6fbf) !important;
}

/* Solo el header tiene fondo de selección */
.garbi-modal-item.is-selected .garbi-modal-item-header-row {
    background: var(--garbi-selected-bg, #f0f7ff);
}

.garbi-modal-item.is-selected .garbi-modal-item-name {
    color: var(--garbi-selected-text, #1f6fbf);
}

.garbi-modal-item.is-selected .garbi-modal-item-price-compact {
    color: var(--garbi-selected-text, #1f6fbf);
}

.garbi-modal-item.is-selected .garbi-modal-item-arrow .dashicons {
    color: var(--garbi-selected-text, #1f6fbf);
}

/* Header del acordeón - siempre visible */
.garbi-modal-item-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    min-height: 52px;
}

/* Icono */
.garbi-modal-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: all 0.2s;
}

.garbi-modal-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.garbi-modal-item-icon .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
    opacity: 0.7;
}

.garbi-modal-item:hover .garbi-modal-item-icon .dashicons,
.garbi-modal-item.is-selected .garbi-modal-item-icon .dashicons {
    opacity: 1;
}

/* Content wrapper */
.garbi-modal-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Info - nombre y descripción */
.garbi-modal-item-info {
    flex: 1;
    min-width: 0;
}

.garbi-modal-item-name {
    line-height: 1.3;
    margin-bottom: 0;
    text-transform: none;
    font-size: 14px;
    font-weight: 500;
}

/* Descripción - oculta por defecto, visible al expandir */
.garbi-modal-item-desc {
    display: none;
    line-height: 1.4;
    margin: 0;
    padding: 0 14px 12px 58px;
    font-size: 13px;
}

.garbi-modal-item.is-expanded .garbi-modal-item-desc {
    display: block;
}

/* Flecha de expandir */
.garbi-modal-item-arrow {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.garbi-modal-item-arrow .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.garbi-modal-item.is-expanded .garbi-modal-item-arrow {
    transform: rotate(180deg);
}

/* Precio en el header */
.garbi-modal-item-price-compact {
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 4px;
}

.garbi-modal-item-expand {
    display: none;
}

/* Detalles de objetos - ocultos por defecto */
.garbi-modal-item-details {
    display: none;
    padding: 0 14px 12px 58px;
    flex-direction: column;
    gap: 10px;
}

.garbi-modal-item-details .garbi-modal-item-desc {
    display: block;
    padding: 0;
}

.garbi-modal-item.is-expanded .garbi-modal-item-details {
    display: flex;
}

/* Cantidad en detalles */
.garbi-modal-item-details .garbi-modal-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Footer con precio y cantidad - ya no se usa */
.garbi-modal-item-footer {
    display: none;
}

/* Check indicator */
.garbi-modal-item-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--garbi-check-border, #d1d5db);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background: transparent;
}

.garbi-modal-item-check .dashicons {
    width: 14px;
    height: 14px;
    line-height: 1;
    opacity: 0;
    color: var(--garbi-check-active-color, #fff);
}

/* Check activo */
.garbi-modal-item.is-selected .garbi-modal-item-check {
    background: var(--garbi-check-active-bg, #1f6fbf);
    border-color: var(--garbi-check-active-bg, #1f6fbf);
}

.garbi-modal-item.is-selected .garbi-modal-item-check .dashicons {
    opacity: 1;
}

/* Quantity selector for objects (inside footer) */
.garbi-modal-item-quantity {
    display: flex;
    align-items: center;
    gap: 6px;
}

.garbi-qty-label {
}

.garbi-qty-input {
    width: 50px;
    height: 28px;
    border: 1px solid;
    text-align: center;
}

.garbi-qty-input:focus {
    outline: none;
}

/* Ocultar elementos que no se usan en modo compacto */
.garbi-modal-item-header,
.garbi-modal-item-body,
.garbi-modal-item-footer,
.garbi-modal-item-selected-badge {
    display: none;
}

/* Empty state */
.garbi-modal-empty {
    text-align: center;
    padding: 40px 20px;
}

.garbi-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid;
}

.garbi-btn-primary,
.garbi-btn-secondary {
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.garbi-btn-secondary {
    border: 1px solid;
}

/* ==========================================================================
   BARRA STICKY MOVIL
   ========================================================================== */

.garbi-mobile-sticky-bar {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid;
    z-index: 99999;
    padding: 14px 16px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

/* Show on mobile/tablet only - using CSS media query for reliability */
@media (max-width: 1023px) {
    .garbi-mobile-sticky-bar {
        display: block !important;
    }
}

/* Also support JS class for additional control */
.garbi-mobile-sticky-bar.is-visible {
    display: block !important;
}

.garbi-mobile-sticky-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.garbi-mobile-sticky-total {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.garbi-mobile-sticky-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.garbi-mobile-sticky-price {
    line-height: 1.2;
}

.garbi-mobile-sticky-btn {
    flex-shrink: 0;
    padding: 14px 28px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.garbi-mobile-sticky-btn:disabled {
    cursor: not-allowed;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .garbi-form-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .garbi-form-sidebar {
        order: -1;
    }

    .garbi-sidebar-sticky {
        position: relative;
        top: 0;
    }

    .garbi-resumen-card {
        border: 1px solid;
    }

    .garbi-resumen-totales {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .garbi-resumen-linea {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
}

/* Movil */
@media (max-width: 768px) {
    .garbi-presupuesto-form.garbi-form-v2 {
        padding: 10px;
    }

    .garbi-form-main {
        gap: 16px;
    }

    .garbi-section-header {
        padding: 14px 16px;
        gap: 10px;
    }

    .garbi-section-number {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }

    .garbi-section-toggle {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }

    .garbi-section-toggle .dashicons {
        width: 14px;
        height: 14px;
    }

    .garbi-section-preview {
        display: none;
    }

    .garbi-section-body {
        padding: 16px;
    }

    .garbi-section-actions {
        margin-top: 20px;
        padding-top: 16px;
    }

    .garbi-btn-confirm {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    .garbi-ubicacion-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .garbi-field-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .garbi-mapa-wrapper {
        margin-top: 8px;
    }

    #garbi-map-container {
        height: 180px;
    }

    .garbi-btn-ubicacion {
        width: 100%;
        justify-content: center;
    }

    .garbi-estancia-header-v2 {
        padding: 12px;
        gap: 8px;
    }

    .garbi-estancia-toggle {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }

    .garbi-estancia-toggle .dashicons {
        width: 14px;
        height: 14px;
    }

    .garbi-estancia-icon {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }

    .garbi-estancia-icon .dashicons {
        width: 14px;
        height: 14px;
    }

    .garbi-estancia-nombre {
        padding: 6px 10px;
    }

    .garbi-estancia-preview {
        display: none;
    }

    .garbi-remove-estancia-v2 {
        width: 32px;
        height: 32px;
    }

    .garbi-estancia-body-v2 {
        padding: 16px;
    }

    .garbi-dimensions-inputs {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .garbi-dimension-field {
        width: 100%;
    }

    .garbi-dimension-input {
        width: 100%;
    }

    .garbi-dimension-input input {
        width: 100%;
        flex: 1;
    }

    .garbi-dimension-separator,
    .garbi-dimension-result {
        display: none;
    }

    .garbi-dimension-total {
        text-align: center;
        margin-top: 8px;
    }

    .garbi-servicios-list,
    .garbi-objetos-list {
        gap: 6px;
    }

    .garbi-btn-add-estancia {
        padding: 12px;
    }

    .garbi-contacto-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .garbi-field-full {
        grid-column: span 1;
    }

    .garbi-usuario-info {
        padding: 12px;
    }

    .garbi-resumen-card {
        padding: 16px;
    }

    .garbi-resumen-card h4 {
        margin-bottom: 16px;
    }

    .garbi-resumen-items {
        min-height: 40px;
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .garbi-resumen-totales {
        gap: 8px;
        margin-bottom: 16px;
    }

    .garbi-btn-submit {
        padding: 14px 20px;
    }

    .garbi-resumen-garantias {
        gap: 8px;
    }

    .garbi-presupuesto-form.garbi-form-v2 {
        padding-bottom: 100px;
    }

    .garbi-modal {
        padding: 0;
        align-items: flex-end;
    }

    .garbi-modal-container {
        max-width: 100%;
        max-height: 90vh;
    }

    .garbi-modal-header {
        padding: 16px 20px;
    }

    .garbi-modal-body {
        padding: 12px 20px;
    }

    .garbi-modal-footer {
        padding: 12px 20px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .garbi-section-label-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .garbi-btn-add-item {
        width: 100%;
        justify-content: center;
    }
}

/* Movil pequeno */
@media (max-width: 480px) {
    .garbi-presupuesto-form.garbi-form-v2 {
        padding: 8px;
    }

    .garbi-section-header {
        padding: 12px 14px;
    }

    .garbi-section-body {
        padding: 14px;
    }

    .garbi-estancia-body-v2 {
        padding: 14px;
    }

    .garbi-field input,
    .garbi-field select {
        padding: 10px 12px;
    }

    .garbi-input-m2 {
        width: 100px;
        padding: 10px 12px;
    }

    .garbi-resumen-card {
        padding: 14px;
    }
}

/* ==========================================================================
   ESTADOS DE VALIDACION
   ========================================================================== */

.garbi-section.completed .garbi-section-status::after {
    content: '\2713';
}

/* ==========================================================================
   LEAFLET OVERRIDES
   ========================================================================== */

#garbi-map-container .leaflet-control-attribution {
}
