/* Breadcrumb */
.breadcrumb {
    background: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #6c757d;
}

/* Loading State */
.loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    background: #f8f9fa;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.loading-spinner p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* Details Content */
.details-content {
    padding: 80px 0 30px 0; /* top padding to clear fixed header */
    background: #f8f9fa;
    min-height: 100vh;
}

/* Back Button */
.back-button {
    margin-bottom: 30px;
}

.btn-back {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Establishment Header */
.establishment-header {
    background: white;
    border-radius: 12px;
    padding: 20px 30px 30px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
}

.header-info h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin: 0 0 15px 0;
    font-weight: 700;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.category-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



.location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 1rem;
}

.location i {
    color: var(--primary);
}

/* Image Gallery */
.image-gallery {
    margin-top: 25px;
}

.main-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    width: 100%;
    position: relative;
}

.main-image {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: 0;
}

.main-image img {
    height: 100%;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.main-image img:hover {
    transform: scale(1.05);
}

.main-image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
}

.main-image-prev {
    left: 20px;
}

.main-image-next {
    right: 20px;
}

.main-image-nav:hover {
    transform: translateY(calc(-50% - 2px));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.main-image-nav:disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}

.main-image-nav i {
    pointer-events: none;
    font-size: 1rem;
}

.thumbnail-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0;
}

.thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail.active {
    border-color: var(--primary);
}

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

.thumbnail:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Content with Sidebar */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
    align-items: start;
}

/* Main Content */
.main-content > section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.main-content h2 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-content h2::before {
    content: '';
    width: 4px;
    height: 30px;
    background: var(--accent);
    border-radius: 2px;
}

#full-description {
    line-height: 1.7;
    color: #555;
    font-size: 1rem;
}

/* Tags Section */
.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.tag-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.tag-item i {
    color: var(--primary);
    font-size: 1.2rem;
    width: 20px;
}

.tag-item span {
    font-weight: 500;
    color: #333;
}

/* Amenities */
.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.amenity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.amenity-item:hover {
    background: #e9f7ff;
    transform: translateY(-1px);
}

.amenity-item i {
    color: var(--primary);
    width: 16px;
}

/* Contact Sidebar */
.contact-sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
}

.contact-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Contact Buttons */
.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.contact-btn.whatsapp {
    background: #25D366;
}

.contact-btn.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.contact-btn.phone {
    background: var(--primary);
}

.contact-btn.website {
    background: #6c757d;
}

/* Map Section */
.map-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.map-section h2 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-section h2::before {
    content: '';
    width: 4px;
    height: 30px;
    background: var(--accent);
    border-radius: 2px;
}

.google-map {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    background: #f0f0f0;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.map-placeholder {
    text-align: center;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.map-placeholder i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.map-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.map-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 150px;
}

.map-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Error State */
.error-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    background: #f8f9fa;
}

.error-content {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.error-content i {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 20px;
}

.error-content h2 {
    color: #333;
    margin-bottom: 15px;
}

.error-content p {
    color: #666;
    margin-bottom: 25px;
}

/* Category Badge Colors */
.category-badge.pousada { background: var(--accent); }
.category-badge.hotel { background: #1565c0; }
.category-badge.casa { background: #27ae60; }
.category-badge.restaurante { background: #e74c3c; }
.category-badge.servico { background: #3498db; }
.category-badge.passeio { background: #f39c12; }
.category-badge.aluguel-equipamentos { background: #34495e; }
.category-badge.cuidados-pessoais { background: #9b59b6; }
.category-badge.loja { background: #00705a; }

/* Image Lightbox */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-lightbox.show {
  display: flex;
  opacity: 1;
}

.image-lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
  animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
  padding: 8px;
  z-index: 10001;
}

.lightbox-close:hover {
  color: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  cursor: pointer;
  padding: 20px 15px;
  transition: all 0.3s ease;
  z-index: 10001;
}

.lightbox-nav:hover {
  color: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.2);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10001;
}

/* Cursor pointer for images */
.main-image img,
.thumbnail img {
  cursor: pointer;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }

    .contact-sidebar {
        position: static;
        order: -1;
    }

    .map-actions {
        flex-direction: column;
    }

    .map-link {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .details-content {
        padding: clamp(2.5rem, 7.5vh, 3.5rem) 0 clamp(1rem, 3vh, 1.5rem) 0;
    }
    
    .main-image-wrapper {
        gap: 0;
    }
    
    .main-image-nav {
        display: none !important;
    }
    
    .main-image {
        max-width: 100%;
    }
    
    .establishment-header {
        padding: clamp(1rem, 3vw, 1.5rem);
    }

    .header-info h1 {
        font-size: clamp(1.375rem, 5vw, 1.75rem);
    }

    .category-badge {
        padding: clamp(0.375rem, 1.5vw, 0.5rem) clamp(0.75rem, 3vw, 1rem);
        font-size: clamp(0.7rem, 2.25vw, 0.8rem);
    }

    .location {
        font-size: clamp(0.825rem, 2.75vw, 0.95rem);
    }

    .location i {
        font-size: clamp(0.825rem, 2.75vw, 0.95rem);
    }

    .main-image {
        height: clamp(15rem, 35vh, 20rem);
    }

    .main-content > section,
    .contact-card {
        padding: clamp(1rem, 3vw, 1.5rem);
    }

    .main-content h2 {
        font-size: clamp(1.125rem, 4vw, 1.375rem);
    }

    .main-content h2::before {
        height: clamp(1.25rem, 3vh, 1.625rem);
    }

    .contact-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
    }

    .contact-btn {
        flex: 1;
        min-width: 0;
        padding: 12px 8px;
    }

    .contact-btn .contact-text {
        display: none;
    }

    .contact-btn i {
        font-size: 1.25rem;
        margin: 0;
    }

    .map-section {
        padding: clamp(1rem, 3vw, 1.5rem);
    }

    .map-section h2 {
        font-size: clamp(1.125rem, 4vw, 1.375rem);
    }

    .map-section h2::before {
        height: clamp(1.25rem, 3vh, 1.625rem);
    }

    .google-map {
        height: clamp(16rem, 40vh, 22rem);
    }

    /* Mobile-optimized tags grid - 2 columns for better space usage */
    .tags-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* More compact tag items in mobile */
    .tag-item {
        padding: 10px;
        border-left: 2px solid var(--primary);
        gap: 8px;
        font-size: 0.85rem;
    }

    .tag-item i {
        font-size: 0.95rem;
        width: 16px;
        flex-shrink: 0;
    }

    .tag-item span {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    .amenities-grid {
        grid-template-columns: 1fr;
    }

    .breadcrumb {
        padding: clamp(0.5rem, 2vh, 0.75rem) 0;
    }

    .breadcrumb .container {
        font-size: clamp(0.775rem, 2.5vw, 0.9rem);
    }
}

@media (max-width: 480px) {
    .btn-back {
        padding: clamp(0.5rem, 2vh, 0.75rem) clamp(0.875rem, 3.5vw, 1.125rem);
        font-size: clamp(0.775rem, 2.5vw, 0.9rem);
    }

    .btn-back i {
        font-size: clamp(0.775rem, 2.5vw, 0.9rem);
    }

    .thumbnail {
        width: clamp(3.5rem, 15vw, 4.5rem);
        height: clamp(2.625rem, 11.25vw, 3.375rem);
    }

    .main-content h2::before {
        width: clamp(0.1875rem, 0.75vw, 0.25rem);
    }

    /* Ultra-compact tags for small screens */
    .tags-grid {
        gap: 8px;
    }

    .tag-item {
        padding: 8px;
        border-left-width: 2px;
        gap: 6px;
    }

    .tag-item i {
        font-size: 0.9rem;
        width: 14px;
    }

    .tag-item span {
        font-size: 0.8rem;
        line-height: 1.2;
        word-break: break-word;
    }

    .map-link {
        padding: clamp(0.625rem, 2.5vh, 0.875rem) clamp(0.875rem, 3.5vw, 1.125rem);
        font-size: clamp(0.775rem, 2.5vw, 0.9rem);
    }

    .map-link i {
        font-size: clamp(0.775rem, 2.5vw, 0.9rem);
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 2rem;
        padding: 5px;
    }

    .lightbox-nav {
        font-size: 1.5rem;
        padding: 15px 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-counter {
        bottom: 10px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .image-lightbox img {
        max-width: 95%;
        max-height: 95%;
    }
}

/* Extra small devices - single column for better readability */
@media (max-width: 380px) {
    .tags-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tag-item {
        padding: 10px;
    }

    .tag-item span {
        font-size: 0.875rem;
    }
}

/* Mobile-specific tag item enhancements */
@media (max-width: 768px) {
    .tag-item {
        background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
        transition: all 0.2s ease;
    }

    .tag-item:active {
        transform: scale(0.98);
        background: linear-gradient(135deg, #e9f7ff 0%, #f0f8ff 100%);
    }

    /* Hide tags beyond 6th by default on mobile */
    .tags-grid .tag-item:nth-child(n+7) {
        display: none;
    }

    /* Show all when expanded */
    .tags-grid.expanded .tag-item {
        display: flex;
    }

    /* Show More button */
    .tags-show-more {
        margin-top: 15px;
        text-align: center;
    }

    .tags-show-more-btn {
        background: transparent;
        border: 2px solid var(--primary);
        color: var(--primary);
        padding: 10px 20px;
        border-radius: 8px;
        font-weight: 600;
        font-size: 0.9rem;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
    }

    .tags-show-more-btn:active {
        transform: scale(0.95);
        background: var(--primary);
        color: white;
    }

    .tags-show-more-btn i {
        transition: transform 0.3s ease;
    }

    .tags-show-more-btn.expanded i {
        transform: rotate(180deg);
    }
}
