/*
Theme Name: Fuerteventura Wiki
Description: A WordPress theme for Fuerteventura Wiki with interactive map functionality
Version: 1.0.0
Author: Your Name
*/

/* Theme Parameters */
.theme-font-sans-serif {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.theme-primary-cyan {
    --tblr-primary: #00b8d4 !important;
    --tblr-primary-rgb: 0, 184, 212 !important;
}

.theme-base-gray {
    --tblr-bg-surface: #f8f9fa !important;
    --tblr-bg-surface-secondary: #f1f3f4 !important;
    --tblr-border-color: #dee2e6 !important;
    --tblr-color: #212529 !important;
    --tblr-color-muted: #6c757d !important;
}

.theme-radius-1 {
    --tblr-border-radius: 0.375rem !important;
}

.theme-dark {
    --tblr-bg-surface: #1e1e2d !important;
    --tblr-bg-surface-secondary: #151521 !important;
    --tblr-border-color: #2d2d3f !important;
    --tblr-color: #ffffff !important;
    --tblr-color-muted: #a1a5b7 !important;
}

/* Ensure Tabler theme is applied to all components */
body {
    background-color: var(--tblr-bg-surface);
    color: var(--tblr-color);
    /* Remove any default margins/padding that might cause borders */
    margin: 0 !important;
    padding: 0 !important;
}

/* Override any Tabler.io content padding */
.page {
    --tblr-content-padding: 0 !important;
}

.page-body {
    --tblr-content-padding: 0 !important;
}

.navbar {
    background-color: var(--tblr-bg-surface) !important;
    border-bottom: 1px solid var(--tblr-border-color) !important;
}

.btn {
    border-radius: var(--tblr-border-radius);
}

.form-control, .form-select {
    border-radius: var(--tblr-border-radius);
    border-color: var(--tblr-border-color);
    background-color: var(--tblr-bg-surface);
    color: var(--tblr-color);
}

.offcanvas {
    background-color: var(--tblr-bg-surface) !important;
    border-color: var(--tblr-border-color) !important;
}

.modal-content {
    background-color: var(--tblr-bg-surface) !important;
    border-color: var(--tblr-border-color) !important;
}

/* Page Layout */
.page-wrapper {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.page-body {
    padding: 0 !important;
    margin: 0 !important;
    /* Remove any potential Tabler.io content padding */
    --tblr-content-padding: 0 !important;
}

.page-body .container-xl {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.page-body .row {
    margin: 0 !important;
}

.page-body .col-12 {
    padding: 0 !important;
}

/* Bottom Navigation Bar Styles */
.fvw-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
    z-index: 1040; /* Just below Bootstrap offcanvas/modals */
    padding-bottom: env(safe-area-inset-bottom); /* For modern smartphones/iPhones */
}

.theme-dark .fvw-bottom-nav {
    background: rgba(30, 30, 45, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.fvw-nav-items {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    padding: 0; /* Remove padding to let items stretch fully */
    width: 100%;
}

/* Ensure both direct links and .dropup containers take equal space */
.fvw-nav-items > .fvw-nav-item,
.fvw-nav-items > .dropup {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.fvw-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; /* Take full width of parent (.dropup) or itself */
    height: 100%;
    color: var(--tblr-color-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    padding: 6px 0;
}

.fvw-nav-item:hover, .fvw-nav-item:focus,
.fvw-nav-item:hover .fvw-nav-link-inner, .fvw-nav-item:focus .fvw-nav-link-inner {
    color: var(--tblr-primary) !important;
    background: rgba(0, 184, 212, 0.05);
    text-decoration: none !important;
}

.fvw-nav-item.active,
.fvw-nav-item.active .fvw-nav-link-inner {
    color: var(--tblr-primary) !important;
}

.fvw-nav-item .icon,
.fvw-nav-link-inner .icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    stroke-width: 1.5;
}

.fvw-nav-item.active .icon,
.fvw-nav-item.active .fvw-nav-link-inner .icon {
    stroke-width: 2;
}

.fvw-nav-item span,
.fvw-nav-link-inner span {
    font-size: 11px;
    font-weight: 500;
}

/* Bottom Dropdown Styles (Filtros & Capas) */
.fvw-custom-idioma-dropdown .dropdown-toggle::after {
    display: none !important;
}
.dropup .dropdown-menu-bottom {
    bottom: 100% !important;
    top: auto !important;
    margin-bottom: 10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    min-width: 200px;
    animation: slideUpFade 0.2s ease-out;
}

/* Completely hide the third-party GTranslate floating widget globally - we use a Headless UI */
body > .gtranslate_wrapper,
.gtranslate_wrapper,
#gtranslate_wrapper {
    opacity: 0 !important;
    pointer-events: none !important;
    position: fixed !important;
    bottom: -9999px !important;
    left: -9999px !important;
    z-index: -1 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Format our custom Headless Idioma Dropdown in the bottom nav */
.fvw-custom-idioma-dropdown {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1;
    position: relative;
    padding-top: 5px;
}

/* Force language dropdown to open UPWARDS */
.fvw-custom-idioma-dropdown .dropdown-menu-bottom {
    bottom: 100% !important; 
    top: auto !important;
    margin-bottom: 15px !important;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Map Container */
#fvw-mapa {
    width: 100vw !important;
    height: 100vh !important; /* Full height since there is no top navbar */
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
    z-index: 1;
}

/* Adjust map controls to not hide behind bottom nav or language selector */
.leaflet-bottom {
    bottom: calc(75px + env(safe-area-inset-bottom) + 35px) !important;
}

/* Categories Offcanvas Grid */
.fvw-categories-offcanvas {
    height: auto !important;
    max-height: 85vh;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

/* Adjust column spacing for the grid */
.fvw-categories-offcanvas .row.g-2 {
    margin: 0 -5px; /* Pull edges to allow more width */
}
.fvw-categories-offcanvas .row.g-2 > [class*="col-"] {
    padding: 0 5px; /* Reduce gap between columns */
}

.fvw-category-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center horizontally and vertically */
    padding: 12px 8px; /* Slightly more padding for balance */
    background: var(--tblr-bg-surface-secondary);
    border-radius: 12px;
    text-decoration: none;
    color: var(--tblr-color);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    height: 100%;
    min-height: 90px;
}

.fvw-category-grid-item:hover, .fvw-category-grid-item:active {
    background: rgba(0, 184, 212, 0.1);
    border-color: rgba(0, 184, 212, 0.3);
    transform: translateY(-2px);
    text-decoration: none;
}

.fvw-category-grid-item:hover .icon,
.fvw-category-grid-item:hover i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.fvw-category-grid-item .icon,
.fvw-category-grid-item i {
    width: 28px;
    height: 28px;
    margin-bottom: 8px; /* Maintain gap between icon and text */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fvw-category-grid-item span {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    word-break: break-word; /* Allow breaking large words if strictly necessary */
    hyphens: auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Subcategory Styling in Grid */
.fvw-category-grid-item.fvw-subcategory {
    background-color: rgba(255, 255, 255, 0.03); 
    border: 1px dashed rgba(255, 255, 255, 0.15); 
    padding: 10px 4px;
    min-height: 80px;
}

.theme-light .fvw-category-grid-item.fvw-subcategory,
[data-bs-theme="light"] .fvw-category-grid-item.fvw-subcategory {
    background-color: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

.fvw-category-grid-item.fvw-subcategory:hover {
    background-color: rgba(0, 184, 212, 0.08); 
    border-color: rgba(0, 184, 212, 0.25);
    border-style: solid;
}

.fvw-category-grid-item.fvw-subcategory .icon,
.fvw-category-grid-item.fvw-subcategory i {
    font-size: 20px !important;
    width: 20px;
    height: 20px;
    margin-bottom: 6px;
    opacity: 0.85;
}

.fvw-category-grid-item.fvw-subcategory span {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.9;
}

/* Floating Search Bar */
.fvw-search-container {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 1000;
}

.fvw-floating-search {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    height: 48px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.theme-dark .fvw-floating-search {
    background: rgba(30, 30, 45, 0.85);
    border: 1px solid rgba(255,255,255,0.05);
}

.fvw-floating-search:focus-within {
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    width: 95%; /* Expands slightly on focus */
}

/* Ensure input takes up space properly */
#fvw-search-input {
    color: var(--tblr-color);
    padding: 0 10px;
    font-size: 16px; /* Prevents iOS zoom */
}
#fvw-search-input:focus {
    box-shadow: none;
}

#fvw-search-input::placeholder {
    color: var(--tblr-color-muted);
    opacity: 0.8;
}

.fvw-search-results-dropdown {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 1000;
    background: var(--tblr-bg-surface);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--tblr-border-color);
}
.fvw-search-result-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--tblr-border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}
.fvw-search-result-item:last-child {
    border-bottom: none;
}
.fvw-search-result-item:hover {
    background: var(--tblr-bg-surface-secondary);
}

/* Subcategory Toggle and Menu */
@keyframes fvw-blink {
    0% { opacity: 1; transform: scale(1) translate(-50%, -50%); }
    50% { opacity: 0.4; transform: scale(1.1) translate(-50%, -50%); }
    100% { opacity: 1; transform: scale(1) translate(-50%, -50%); }
}

.fvw-blink {
    animation: fvw-blink 1.5s infinite ease-in-out;
}

#fvw-subcat-menu {
    position: absolute;
    top: 70px; /* same as search results dropdown */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 1000;
    background: var(--tblr-bg-surface);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 12px;
    border: 1px solid var(--tblr-border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fvw-subcat-pill {
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-color);
    font-size: 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--tblr-border-color);
    transition: all 0.2s;
}

.fvw-subcat-pill:hover, .fvw-subcat-pill.active {
    background: rgba(0, 184, 212, 0.1);
    border-color: rgba(0, 184, 212, 0.3);
    color: var(--tblr-primary);
}

/* Map Popup Styles */
.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
    min-width: 300px;
    background: transparent;
    line-height: 1.3;
    font-size: 1.08333em;
    min-height: 1px;
}

.leaflet-popup-content-wrapper {
    background: white !important; /* Force white background to remove gray box effect */
    color: #212529 !important; /* Force dark text for readability on white */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: var(--tblr-border-radius) !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 500px !important;
    overflow: hidden !important;
}

.theme-dark .leaflet-popup-content-wrapper,
.theme-dark .leaflet-popup-tip {
    background: #252535 !important; /* Slightly lighter than pure dark for contrast, but not the heavy gray */
    color: #fff !important;
}

.leaflet-popup-tip {
    background: white !important; /* Match wrapper */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-popup-content .card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: var(--tblr-border-radius) !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 400px !important;
}

/* Ensure no gray background classes affect the card */
.leaflet-popup-content .card.bg-dark,
.leaflet-popup-content .card.text-white {
    background-color: transparent !important;
    color: inherit !important;
}

.leaflet-popup-content .card-img-top {
    height: 150px;
    object-fit: cover;
    width: 100%;
    background-color: #f8f9fa; /* Light gray placeholder for missing images */
}

.theme-dark .leaflet-popup-content .card-img-top {
    background-color: #1a1a24;
}

.leaflet-popup-content .card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: inherit; /* Inherit from forced wrapper color */
    padding: 0 20px;
    margin-top: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.leaflet-popup-content .text-secondary {
    font-size: 14px !important;
    line-height: 1.5 !important;
    margin-bottom: 0 !important;
    color: inherit !important;
    padding: 0 10px !important;
    opacity: 0.7 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.leaflet-popup-content .card-body {
    padding: 15px 0;
}

.leaflet-popup-content .card-footer {
    background: var(--tblr-bg-surface-secondary);
    border-top: 1px solid var(--tblr-border-color);
    padding: 10px 15px;
    margin: 0;
}



/* Style nav-pills in popup */
.leaflet-popup-content .nav-pills {
    margin: 0;
    padding: 0;
    gap: 5px;
}

.leaflet-popup-content .nav-pills .nav-item {
    margin: 0;
}

.leaflet-popup-content .nav-pills .nav-link {
    font-size: 12px;
    padding: 6px 12px;
    color: var(--tblr-color-muted);
    background: transparent;
    border: none;
    border-radius: var(--tblr-border-radius);
    transition: all 0.2s ease;
    text-decoration: none;
}

.leaflet-popup-content .nav-pills .nav-link:hover {
    color: var(--tblr-color);
    background: var(--tblr-bg-surface-secondary);
    text-decoration: none;
}

.leaflet-popup-content .nav-pills .nav-link:active {
    color: var(--tblr-color);
    background: var(--tblr-primary);
}



/* Hide default Leaflet close button */
.leaflet-popup-close-button {
    display: none !important;
}

/* Override any Leaflet default popup styles */
.leaflet-popup {
    margin: 0 !important;
    padding: 0 !important;
}

/* Adjust popup tip container */
.leaflet-popup-tip-container {
    margin-top: -13px;
}

/* Fix popup positioning to align correctly over the point */
.leaflet-popup {
    bottom: 25px !important;
}

/* Custom map popup styling */
.fvw-map-popup .leaflet-popup-content-wrapper {
    background: var(--tblr-bg-surface) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: var(--tblr-border-radius) !important;
    border: none !important;
    padding: 0 !important;
}

.fvw-map-popup .leaflet-popup-tip {
    background: var(--tblr-bg-surface) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Day Selection Message */
.fvw-dia-seleccionado-mensaje {
    position: absolute;
    top: 90px; /* Under the floating search bar with space */
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    z-index: 1000;
    background: var(--tblr-bg-surface);
    color: var(--tblr-color);
    padding: 8px 16px;
    border-radius: 20px;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--tblr-border-color);
    white-space: nowrap;
    animation: fvw-slideDownFade 0.3s ease-out;
}

@keyframes fvw-slideDownFade {
    from {
        opacity: 0;
        transform: translate(-50%, -15px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Itinerary Offcanvas Styles */
#fvw-itinerary-offcanvas {
    width: 350px;
    background: var(--tblr-bg-surface);
    border-right: 1px solid var(--tblr-border-color);
    z-index: 99999 !important;
}

#fvw-itinerary-offcanvas .offcanvas-header {
    background: var(--tblr-bg-surface-secondary);
    border-bottom: 1px solid var(--tblr-border-color);
    flex-shrink: 0;
}

#fvw-itinerary-offcanvas .offcanvas-title {
    color: var(--tblr-color);
    font-weight: 600;
}

#fvw-itinerary-offcanvas .offcanvas-body {
    overflow-y: auto;
    padding: 1rem;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

#fvw-itinerario {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.fvw-itinerario-day {
    margin-bottom: 15px;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    overflow: hidden;
    background: var(--tblr-bg-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fvw-day-header {
    background: var(--tblr-bg-surface-secondary);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--tblr-border-color);
}

.fvw-day-clickable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.fvw-day-clickable:hover {
    background-color: var(--tblr-bg-surface) !important;
}

.fvw-day-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--tblr-color);
}

.fvw-day-total-time {
    font-size: 12px;
    color: var(--tblr-color-muted);
    font-weight: normal;
}

.fvw-clear-day {
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 4px;
}

.fvw-day-items {
    padding: 10px;
    min-height: 50px;
}

.fvw-day-items:empty::after {
    content: "Arrastra sitios o rutas aquí";
    display: block;
    text-align: center;
    color: var(--tblr-color-muted);
    font-style: italic;
    padding: 20px 10px;
    font-size: 12px;
}

.fvw-itinerario-item {
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fvw-itinerario-item:hover {
    border-color: var(--tblr-primary);
    box-shadow: 0 2px 8px rgba(var(--tblr-primary-rgb), 0.2);
}

/* Item image styles */
.fvw-item-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--tblr-bg-surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fvw-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fvw-item-placeholder {
    background: var(--tblr-bg-surface-secondary);
    border: 1px solid var(--tblr-border-color);
}

.fvw-placeholder-icon {
    font-size: 20px;
    color: var(--tblr-color-muted);
}

/* Item content styles */
.fvw-item-content {
    flex: 1;
    min-width: 0;
}

.fvw-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--tblr-color);
    margin-bottom: 4px;
    line-height: 1.2;
}

.fvw-item-type {
    font-size: 12px;
    color: var(--tblr-color-muted);
    margin-bottom: 4px;
}

.fvw-item-time {
    font-size: 11px;
    color: var(--tblr-color-muted);
}

.fvw-remove-item {
    flex-shrink: 0;
    padding: 4px;
    font-size: 12px;
    border-radius: var(--tblr-border-radius);
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    color: var(--tblr-color-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.fvw-remove-item:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.fvw-remove-item .icon {
    width: 14px;
    height: 14px;
}

.fvw-clear-day {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 4px;
    border-radius: var(--tblr-border-radius);
    transition: all 0.2s ease;
}

.fvw-clear-day:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.fvw-clear-day .icon {
    width: 12px;
    height: 12px;
}

/* Sortable Styles */
.fvw-itinerario-item.ui-sortable-helper {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: rotate(2deg);
}

.fvw-itinerario-item.ui-sortable-placeholder {
    background: #e9ecef;
    border: 2px dashed #adb5bd;
    visibility: visible !important;
}

/* Itinerary Actions */
.fvw-itinerario-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface);
    position: sticky;
    bottom: 0;
    padding-bottom: 10px;
}

/* Action Button Styles - Tabler.io inspired */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-action:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-action .icon {
    flex-shrink: 0;
    margin-right: 0.5rem;
}

/* Action button variants */
.btn-action.btn-success {
    background-color: var(--tblr-success);
    border-color: var(--tblr-success);
    color: white;
}

.btn-action.btn-success:hover {
    background-color: var(--tblr-success-hover);
    border-color: var(--tblr-success-hover);
    color: white;
}

.btn-action.btn-outline-primary {
    background-color: transparent;
    border-color: var(--tblr-primary);
    color: var(--tblr-primary);
}

.btn-action.btn-outline-primary:hover {
    background-color: var(--tblr-primary);
    border-color: var(--tblr-primary);
    color: white;
}

.btn-action.btn-outline-danger {
    background-color: transparent;
    border-color: var(--tblr-danger);
    color: var(--tblr-danger);
}

.btn-action.btn-outline-danger:hover {
    background-color: var(--tblr-danger);
    border-color: var(--tblr-danger);
    color: white;
}

/* Focus states for accessibility */
.btn-action:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(var(--tblr-primary-rgb), 0.25);
}

.btn-action.btn-success:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--tblr-success-rgb), 0.25);
}

.btn-action.btn-outline-danger:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--tblr-danger-rgb), 0.25);
}

/* Detail Bottom Sheet / Offcanvas Styles */
.fvw-detail-panel {
    position: fixed;
    background: var(--tblr-bg-surface);
    z-index: 1050; /* Above leaflet map (400) but below modals (1055) */
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.fvw-detail-header {
    padding: 1rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--tblr-bg-surface);
}

.fvw-detail-title {
    color: var(--tblr-color);
    font-weight: 600;
}

.fvw-detail-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

/* Desktop behavior (Sidebar right) */
@media (min-width: 768px) {
    .fvw-detail-panel {
        top: 0;
        right: 0;
        bottom: 0;
        width: 400px;
        border-left: 1px solid var(--tblr-border-color);
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    }
    .fvw-detail-panel.fvw-detail-closed {
        transform: translateX(100%);
    }
}

/* Mobile behavior (Bottom Sheet / Fullscreen) */
@media (max-width: 767.98px) {
    .fvw-detail-panel {
        top: 0; /* Fullscreen overlay */
        left: 0;
        right: 0;
        bottom: 0;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }
    
    .fvw-detail-panel.fvw-detail-closed {
        transform: translateY(100%);
    }

    .fvw-detail-drag-handle {
        width: 40px;
        height: 5px;
        background-color: var(--tblr-border-color);
        border-radius: 3px;
        margin: 10px auto 0;
    }
    
    .fvw-detail-header {
        padding-top: 0.5rem;
        border-bottom: none;
    }
}

/* Detail Content Styles */
.detail-main-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.detail-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--tblr-color);
}

.detail-excerpt {
    font-size: 14px;
    color: var(--tblr-color-muted);
    margin-bottom: 15px;
    line-height: 1.5;
}

.detail-description {
    font-size: 14px;
    color: var(--tblr-color);
    margin-bottom: 15px;
    line-height: 1.6;
}

.detail-time {
    font-size: 14px;
    color: var(--tblr-primary);
    font-weight: 600;
    margin-bottom: 15px;
}

.detail-categories {
    margin-bottom: 15px;
}

.detail-gallery {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-gallery img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

@media (max-width: 767.98px) {
    .detail-gallery img {
        width: calc(33.333% - 6px); /* 3 images per row smoothly */
        height: 100px;
    }
}

.detail-gallery img:hover {
    transform: scale(1.05);
}

.detail-actions {
    margin-top: 20px;
    padding-bottom: 30px; /* Safe area bottom for mobile */
}

/* Gallery Modal Styles */
#fvw-gallery-modal {
    z-index: 999999 !important;
}

.fvw-gallery-modal .modal-content {
    background: rgba(0, 0, 0, 0.9);
    border: none;
    border-radius: 0;
}

.fvw-gallery-content {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fvw-gallery-image {
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.fvw-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    padding: 15px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.fvw-gallery-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fvw-gallery-nav.prev {
    left: 20px;
}

.fvw-gallery-nav.next {
    right: 20px;
}

.fvw-gallery-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.fvw-gallery-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fvw-gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    #fvw-itinerary-offcanvas {
        width: 100%;
    }
    
    #fvw-detail-offcanvas {
        width: 100%;
    }
    
    .fvw-gallery-nav {
        padding: 10px 8px;
        font-size: 20px;
    }
    
    .fvw-gallery-nav.prev {
        left: 10px;
    }
    
    .fvw-gallery-nav.next {
        right: 10px;
    }
    
    .fvw-gallery-close {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 20px;
    }
    
    .fvw-gallery-counter {
        bottom: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Centrar texto en popups en móvil */
    .leaflet-popup-content .card-title {
        text-align: center !important;
    }
    
    .leaflet-popup-content .text-secondary {
        text-align: center !important;
    }
}

/* Custom Marker Styles */
.custom-marker {
    background: transparent;
    border: none;
}

/* Bootstrap Overrides */
.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.btn-close:hover {
    opacity: 0.75;
}

/* Estilos para iconos SVG en categorías */
.dropdown-item .icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.dropdown-item:hover .icon {
    stroke: var(--tblr-primary);
}

/* Asegurar que los iconos SVG de Tabler se muestren correctamente */
.icon {
    display: inline-block;
    vertical-align: middle;
}

.icon-inline {
    display: inline-block;
    vertical-align: middle;
}

/* Debug: mostrar borde para ver si los elementos se están renderizando */
.dropdown-item {
    display: flex;
    align-items: center;
}

.dropdown-item .icon {
    flex-shrink: 0;
}

/* Utility Classes */
.text-muted {
    color: #6c757d !important;
}

.bg-secondary {
    background-color: #6c757d !important;
}

.me-1 {
    margin-right: 0.25rem !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.w-100 {
    width: 100% !important;
}

.p-0 {
    padding: 0 !important;
}



/* Badge positioning for itinerary button */
#fvw-itinerario-button {
    position: relative;
}

#fvw-itinerario-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
}

/* Success notification styles */
.fvw-success-notification {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 15px;
    color: #0c5460;
    font-size: 14px;
    animation: slideInDown 0.3s ease-out;
}

/* Position notification at top-right when it's a shared item */
body > .fvw-success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fvw-success-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fvw-success-icon {
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
}

.fvw-success-text {
    flex: 1;
    margin: 0;
}

.fvw-success-link {
    color: #28a745;
    text-decoration: underline;
    font-weight: 500;
    margin-left: 10px;
}

.fvw-success-link:hover {
    color: #1e7e34;
    text-decoration: underline;
}

.fvw-success-close {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    line-height: 1;
}

.fvw-success-close:hover {
    color: #495057;
}

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

/* Mobile notification styles */
.fvw-mobile-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    background-color: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    animation: slideInDown 0.3s ease-out;
}

.fvw-mobile-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.fvw-mobile-icon {
    font-size: 18px;
    color: var(--tblr-primary);
    flex-shrink: 0;
}

.fvw-mobile-text {
    font-size: 14px;
    color: var(--tblr-color);
    line-height: 1.4;
    flex-grow: 1;
}

.fvw-mobile-close {
    background: none;
    border: none;
    color: var(--tblr-color-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.fvw-mobile-close:hover {
    background-color: var(--tblr-bg-surface-secondary);
    color: var(--tblr-color);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .fvw-mobile-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .fvw-mobile-content {
        padding: 10px 12px;
    }
    
    .fvw-mobile-text {
        font-size: 13px;
    }
}

/* Material Design Clean Leaflet Popups (Hardened Specificity) */
html body.theme-dark .leaflet-container .leaflet-popup.fvw-clean-card-popup .leaflet-popup-content-wrapper,
.leaflet-popup.fvw-clean-card-popup .leaflet-popup-content-wrapper {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: none !important;
}

html body.theme-dark .leaflet-container .leaflet-popup.fvw-clean-card-popup .leaflet-popup-tip,
.leaflet-popup.fvw-clean-card-popup .leaflet-popup-tip {
    background: #ffffff !important;
    background-color: #ffffff !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15) !important;
}

html body.theme-dark .leaflet-container .leaflet-popup.fvw-clean-card-popup .leaflet-popup-content,
.leaflet-popup.fvw-clean-card-popup .leaflet-popup-content {
    margin: 14px 16px !important;
    width: auto !important;
}

/* Fix leaflet attribution overlapping popup modal */
.route-dashboard .leaflet-bottom {
    z-index: 600 !important;
}
