:root {
    --malta-red: #FF5F5F;
    --malta-red-dark: #E54545;
    --malta-red-light: #ff7f7f;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    min-height: 100vh;
    overflow-x: hidden;
}

body.sheet-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.top-bar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    padding: calc(12px + var(--safe-area-top)) 16px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.back-btn:hover {
    background: var(--gray-200);
}

.back-btn svg {
    width: 20px;
    height: 20px;
    color: var(--gray-700);
}

.top-bar-logo {
    height: 32px;
    width: 32px;
    object-fit: contain;
}

.top-bar-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gray-900);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.island-pill {
    padding: 6px 12px;
    background: var(--gray-100);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-600);
    white-space: nowrap;
    flex-shrink: 0;
}

.hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 7;
    max-height: 320px;
    min-height: 180px;
    overflow: hidden;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 40%;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 60%,
        rgba(0, 0, 0, 0.6) 100%
    );
    pointer-events: none;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px;
    z-index: 1;
}

.hero-title {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    margin-bottom: 4px;
}

.hero-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.filters-section {
    position: sticky;
    top: calc(64px + var(--safe-area-top));
    z-index: 90;
    background: white;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.search-wrap {
    position: relative;
    margin-bottom: 12px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--gray-50);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--malta-red);
    box-shadow: 0 0 0 3px rgba(255, 95, 95, 0.1);
}

.search-input::placeholder {
    color: var(--gray-400);
}

.chips-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chips-row::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 8px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: white;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chip:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.chip.active {
    background: var(--malta-red);
    border-color: var(--malta-red);
    color: white;
}

.chip.clear-chip {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-600);
}

.chip.clear-chip:hover {
    background: var(--gray-200);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px calc(24px + var(--safe-area-bottom));
}

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

@media (min-width: 600px) {
    .guide-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .guide-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

.guide-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.12);
}

.guide-card:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 95, 95, 0.3);
}

.guide-card-image {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--malta-red-light), var(--malta-red));
    overflow: hidden;
}

.guide-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slideshow {
    position: relative;
    width: 100%;
    height: 100%;
}

.slideshow-track {
    display: flex;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.slideshow-slide {
    flex: 0 0 100%;
    height: 100%;
}

.slideshow-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slideshow-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 3;
}

.slideshow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.slideshow-dot.active {
    background: white;
    transform: scale(1.25);
}

.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.slideshow-nav svg {
    width: 14px;
    height: 14px;
    color: var(--gray-700);
}

.guide-card:hover .slideshow-nav,
.sheet-slideshow .slideshow-nav {
    opacity: 1;
}

.slideshow-nav.prev {
    left: 8px;
}

.slideshow-nav.next {
    right: 8px;
}

.sheet-slideshow {
    aspect-ratio: 16 / 10;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--malta-red-light), var(--malta-red));
}

.sheet-slideshow .slideshow-nav {
    opacity: 1;
    width: 32px;
    height: 32px;
}

.sheet-slideshow .slideshow-nav svg {
    width: 16px;
    height: 16px;
}

.guide-card-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-700);
}

.guide-card-body {
    padding: 16px;
}

.guide-card-name {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.guide-card-area {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.guide-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.guide-tag {
    padding: 4px 8px;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
}

.guide-status,
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.guide-status-icon,
.no-results-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--gray-300);
}

.guide-status-title,
.no-results-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sheet-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
    background: white;
    border-radius: 24px 24px 0 0;
    z-index: 210;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    padding-bottom: var(--safe-area-bottom);
}

.bottom-sheet.visible {
    transform: translateY(0);
}

.sheet-handle-area {
    padding: 12px 20px 8px;
    cursor: grab;
    flex-shrink: 0;
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 0 auto;
}

.sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.sheet-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.sheet-subtitle {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.sheet-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.sheet-close:hover {
    background: var(--gray-200);
}

.sheet-close svg {
    width: 20px;
    height: 20px;
    color: var(--gray-600);
}

.sheet-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.detail-text {
    font-size: 0.95rem;
    color: var(--gray-700);
    line-height: 1.6;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tag {
    padding: 6px 12px;
    background: var(--gray-100);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.detail-tag.highlight {
    background: linear-gradient(135deg, var(--malta-red), var(--malta-red-light));
    color: white;
}

.detail-bullets {
    list-style: none;
}

.detail-bullets li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--gray-700);
}

.detail-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    background: var(--malta-red);
    border-radius: 50%;
}

.caution-box {
    padding: 12px 16px;
    background: #fef3c7;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #92400e;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.caution-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.sheet-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.maps-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: var(--malta-red);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.maps-btn:hover {
    background: var(--malta-red-dark);
}

.maps-btn:active {
    transform: scale(0.98);
}

.maps-btn svg {
    width: 20px;
    height: 20px;
}

@media (min-width: 768px) {
    .bottom-sheet {
        position: fixed;
        top: 50%;
        left: 50%;
        bottom: auto;
        right: auto;
        transform: translate(-50%, -50%) scale(0.95);
        max-width: 520px;
        width: calc(100% - 40px);
        max-height: 85vh;
        border-radius: 24px;
        opacity: 0;
        visibility: hidden;
        transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
    }

    .bottom-sheet.visible {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        visibility: visible;
    }

    .sheet-handle-area {
        display: none;
    }

    .sheet-header {
        padding-top: 20px;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[role="button"],
[tabindex="0"] {
    cursor: pointer;
}

*:focus-visible {
    outline: 2px solid var(--malta-red);
    outline-offset: 2px;
}
