/* =====================
   Reset básico
   ===================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #dde0e6;
    color: #e5e7eb;
}

a {
    color: #38bdf8;
}

/* =====================
   Topbar
   ===================== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #424C42;
    color: #e5e7eb;
    border-bottom: 1px solid #424C42;
    font-size: 14px;
}

.topbar-left strong {
    font-size: 16px;
}

.topbar-right form {
    display: inline;
}

.topbar-right button,
.topbar-right a {
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.topbar-right button {
    background: #f97316;
    color: #111827;
}

.topbar-right button:hover {
    background: #ea580c;
}

.topbar-right a {
    background: #1f2937;
    color: #e5e7eb;
}

/* =====================
   Layout principal
   ===================== */
#app-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 360px;
    grid-template-rows: calc(100vh - 45px);
    height: calc(100vh - 45px);
    overflow: hidden;
}

/* Paneles laterales */
.side-panel {

    background: #020617;
    border-right: 1px solid #111827;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 10px;
}

.left-panel {
    border-radius: 15px;
    border-right: 1px solid #111827;
    margin-top: 20%;
    
}

.right-panel {
    border-radius: 15px;
    margin-top: 20%;
    border-left: 1px solid #111827;
}

/* Panel sections */
.panel-section {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #111827;
}

.panel-section h2,
.panel-section h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.panel-section:last-child {
    border-bottom: none;
}

/* Mapa */
#map-container {
    height: 100%;
}
#map {
    width: 100%;
    height: 100%;
}


/* =====================
   Botones flotantes (mobile)
   ===================== */
.floating-btn {
    position: fixed;
    z-index: 1000;
    top: 60px;
    padding: 8px 10px;
    border-radius: 999px;
    border: none;
    background: #0f172a;
    color: #e5e7eb;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
    display: inline-flex;
}

.floating-btn.left {

    left: 10px;
}

.floating-btn.right {
    right: 10px;
}

/* =====================
   Formularios / inputs
   ===================== */
.form-row {
    margin-bottom: 8px;
    font-size: 14px;
}

.form-row label {
    display: block;
    margin-bottom: 2px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #e5e7eb;
    font-size: 14px;
}

.form-row textarea {
    resize: vertical;
}

.form-row.two-cols {
    display: flex;
    gap: 8px;
}

.form-row.two-cols > div {
    flex: 1;
}

.btn-full {
    width: 100%;
    padding: 8px;
}

.btn-primary {
    background: #22c55e;
    color: #022c22;
    border: none;
    cursor: pointer;
    border-radius: 8px;
}

.btn-primary:hover {
    background: #16a34a;
}

.hint {
    font-size: 12px;
    color: #9ca3af;
}

/* =====================
   Lista de marcadores
   ===================== */
.marker-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.marker-item {
    border-right-color: chocolate;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: #020617;
    border: 1px solid #111827;
    cursor: pointer;
}

.marker-item:hover {
    border-color: #3b82f6;
    background: #020617;
}

.marker-item-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.marker-item-meta {
    font-size: 12px;
    color: #9ca3af;
}

/* =====================
   Detalle e imágenes
   ===================== */
#detail-body p {
    margin: 4px 0;
}

.detail-rating {
    margin-top: 4px;
    font-size: 13px;
    color: #facc15;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.image-grid img,
.detail-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #111827;
}

/* =====================
   Reseñas
   ===================== */
.reviews-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.review-item {
    padding: 6px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: #020617;
    border: 1px solid #111827;
    font-size: 13px;
}

.review-rating {
    font-size: 13px;
    color: #fbbf24;
    margin-bottom: 2px;
}

/* =====================
   Mis lugares (vendedor)
   ===================== */
#my-places-body {
    font-size: 14px;
}

.my-places-card {
    border-radius: 8px;
    background: #020617;
    border: 1px solid #111827;
    padding: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.my-places-card h4 {
    margin: 0 0 2px;
    font-size: 14px;
}

.my-places-card p {
    margin: 0 0 4px;
    font-size: 13px;
}

.place-actions,
.my-places-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.place-actions button,
.my-places-actions button,
.icon-btn {
    flex: 1;
    border-radius: 6px;
    border: none;
    padding: 4px 6px;
    font-size: 12px;
    cursor: pointer;
}

.icon-btn.edit {
    background: #3b82f6;
    color: #eff6ff;
}

.icon-btn.delete {
    background: #ef4444;
    color: #fee2e2;
}

.icon-btn.alert {
    background: #f59e0b;
    color: #451a03;
}

/* =====================
   Alertas
   ===================== */
.alert-banner {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid #f87171;
    margin-bottom: 8px;
    font-size: 13px;
}

.alert-current {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.02);
    border: 1px solid #1d4ed8;
    font-size: 13px;
    margin-bottom: 8px;
}

/* =====================
   Lightbox
   ===================== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox.hidden {
    display: none;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

/* =====================
   Tooltip de marcador (popup)
   ===================== */
.marker-tooltip {
    font-size: 12px;
    color: #111827;
}

.marker-tooltip strong {
    font-size: 13px;
}

.marker-tooltip-img {
    display: block;
    max-width: 160px;
    max-height: 100px;
    border-radius: 6px;
    object-fit: cover;
    margin-top: 4px;
}

/* =====================
   Mobile / pantallas chicas
   ===================== */
@media (max-width: 900px) {
    #app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: calc(100vh - 45px);
    }

    .left-panel,
    .right-panel {
        margin-top: 8%;
        position: fixed;
        top: 45px;
        bottom: 0;
        width: 260px;
        max-width: 80%;
        z-index: 900;
        transform: translateX(-100%);
        transition: transform 0.2s ease-out;
    }

    .right-panel {
        right: 0;
        left: auto;
        transform: translateX(100%);
    }

    .left-panel.open {
        transform: translateX(0);
    }

    .right-panel.open {
        transform: translateX(0);
    }

}

/* =====================
   Escritorio: gutters para botones flotantes (no tapan el mapa)
   ===================== */
@media (min-width: 901px) {
    /* Ajustá estos valores a tu gusto */
    :root{
        --float-btn-safe: 56px;  /* ancho reservado para el botón */
        --float-btn-gap: 12px;   /* aire extra */
    }

    /* IMPORTANTE: el padding se aplica al contenedor del mapa,
       y el mapa real (#map) queda dentro (se achica solo) */
    #map-container{
        /* opcional: para que el gutter se vea “limpio” */
        background: #dde0e6;
    }

    /* Si el panel izquierdo está cerrado → reservo gutter a la izquierda */
    #app-layout[data-left="closed"] #map-container{
        padding-left: calc(var(--float-btn-safe) + var(--float-btn-gap));
    }

    /* Si el panel derecho está cerrado → reservo gutter a la derecha */
    #app-layout[data-right="closed"] #map-container{
        padding-right: calc(var(--float-btn-safe) + var(--float-btn-gap));
    }

    /* El mapa Leaflet vive en #map; al estar dentro del padding,
       automáticamente no ocupa el gutter */
    #map{
        width: 100%;
        height: 100%;
    }

    /* Botones siguen flotando igual */
    .floating-btn{
        top: 60px; /* ya lo tenías, lo dejo explícito */
    }
}


/* =====================
   Escritorio: botones flotantes + gutters (no tapan mapa)
   ===================== */
@media (min-width: 901px) {
    :root{
        --left-panel-w: 320px;
        --right-panel-w: 360px;

        /* espacio reservado para que el botón no tape el mapa cuando el panel está cerrado */
        --float-btn-safe: 56px;
        --float-btn-gap: 12px;

        /* separación “bonita” del borde del mapa */
        --float-btn-offset: 10px;
    }

    /* GUTTERS: cuando un panel está cerrado, achico el mapa para que el botón no lo tape */
    #app-layout[data-left="closed"] #map-container{
        padding-left: calc(var(--float-btn-safe) + var(--float-btn-gap));
    }
    #app-layout[data-right="closed"] #map-container{
        padding-right: calc(var(--float-btn-safe) + var(--float-btn-gap));
    }

    /* Transición suave al moverse */
    .floating-btn{
        transition: left 0.2s ease-out, right 0.2s ease-out;
    }

    /* BOTÓN IZQUIERDO:
       - si el panel está OPEN → lo corro al borde del mapa (después del panel)
       - si está CLOSED → queda pegado al borde de la ventana */
    #app-layout[data-left="open"] .floating-btn.left{
        left: calc(var(--left-panel-w) + var(--float-btn-offset));
    }
    #app-layout[data-left="closed"] .floating-btn.left{
        left: var(--float-btn-offset);
    }

    /* BOTÓN DERECHO:
       - si el panel está OPEN → lo corro al borde del mapa (antes del panel)
       - si está CLOSED → queda pegado al borde de la ventana */
    #app-layout[data-right="open"] .floating-btn.right{
        right: calc(var(--right-panel-w) + var(--float-btn-offset));
    }
    #app-layout[data-right="closed"] .floating-btn.right{
        right: var(--float-btn-offset);
    }
}

