/* ============================================
   ECUAVIAJE — Utility Classes (Public Side)
   ============================================ */

/* === Responsive Overflow Fix (Global) === */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

*, *::before, *::after {
    box-sizing: border-box;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* === Card Grid Responsive === */
.listings__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-lg);
}

@media (max-width: 1024px) {
    .listings__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .listings__grid {
        grid-template-columns: 1fr;
        gap: var(--sp-md);
    }
}

/* === Explore Layout === */
.explore-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--sp-xl);
}

@media (max-width: 900px) {
    .explore-layout {
        grid-template-columns: 1fr;
    }
    .explore-sidebar {
        order: -1;
    }
}

/* === Category Grid Responsive === */
.categories__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--sp-md);
}

@media (max-width: 480px) {
    .categories__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--sp-sm);
    }
}

/* === Gallery Responsive === */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--sp-sm);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.gallery__item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.gallery__main img {
    height: 300px;
}

@media (max-width: 640px) {
    .gallery {
        grid-template-columns: 1fr;
    }
    .gallery__main img,
    .gallery__item img {
        height: 200px;
    }
}

/* === Detail Page Responsive === */
.detail-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: var(--sp-xl);
}

@media (max-width: 900px) {
    .detail-content {
        grid-template-columns: 1fr;
    }
}

/* === Detail Header Responsive === */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--sp-md);
}

@media (max-width: 640px) {
    .detail-header {
        flex-direction: column;
    }
}

/* === Common Badge / Tag === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    white-space: nowrap;
}

.badge--primary {
    background: rgba(0, 212, 0, 0.15);
    color: #5d7a00;
}

/* === Swiper Slider Override (no overflow) === */
.listings__slider.swiper {
    overflow: hidden;
    padding-bottom: 40px;
}

/* === CTA Steps Section === */
.cta-steps .container {
    max-width: 1000px;
}

/* === Filter Sidebar === */
.filter-section {
    margin-bottom: var(--sp-lg);
    padding-bottom: var(--sp-lg);
    border-bottom: 1px solid #e2e8f0;
}

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

.filter-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    margin-bottom: var(--sp-sm);
    color: var(--black);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: var(--fs-sm);
    cursor: pointer;
    color: var(--gray-dark, #4b5563);
}

.filter-option input[type="checkbox"] {
    accent-color: var(--primary);
}

/* === Iframe Responsive === */
iframe {
    max-width: 100%;
    border: none;
}

/* === Mobile Text & Layout === */
@media (max-width: 640px) {
    .card__name {
        font-size: 0.95rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .detail-header__name {
        font-size: 1.4rem;
    }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }
    .container {
        padding-left: var(--sp-md);
        padding-right: var(--sp-md);
    }
    .hero__title {
        font-size: 1.6rem !important;
    }
    .hero__subtitle {
        font-size: 0.95rem !important;
    }
    .hero__search {
        flex-direction: column !important;
    }
    .hero__search-group {
        width: 100% !important;
    }
    .swiper-button-next,
    .swiper-button-prev {
        display: none !important;
    }
}

/* === Sidebar Card Fix === */
.sidebar-card {
    background: var(--white, #fff);
    border-radius: var(--radius-lg, 12px);
    border: 1px solid #e2e8f0;
    padding: var(--sp-lg);
    margin-bottom: var(--sp-md);
}

/* === Explore No Results === */
.explore-page {
    min-height: 50vh;
}

/* === Card Style Fixes === */
.card {
    display: flex;
    flex-direction: column;
    background: var(--white, #fff);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.card__image-wrap {
    position: relative;
    overflow: hidden;
}

.card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card__body {
    padding: var(--sp-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card__name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
}

.card__location {
    color: var(--gray, #6b7280);
    font-size: 0.85rem;
    margin-bottom: auto;
}

.card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--sp-sm);
    padding-top: var(--sp-sm);
    border-top: 1px solid #f1f5f9;
}

.card__rating {
    font-size: 0.8rem;
    color: var(--primary, #00d400);
    font-weight: 600;
}

.card__detail-link {
    font-size: 0.8rem;
    color: var(--primary, #00d400);
    font-weight: 600;
}


/* === Global Share Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.share-modal-box {
    background: #fff;
    width: 100%;
    max-width: 450px;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .share-modal-box {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.share-modal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 5px;
}

.share-item:hover { transform: translateY(-3px); }

.share-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.share-item span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

/* Redes Colors */
.share-item.wa .share-icon { background: #25D366; }
.share-item.fb .share-icon { background: #1877F2; }
.share-item.x .share-icon { background: #000; }
.share-item.tg .share-icon { background: #0088cc; }
.share-item.mail .share-icon { background: #64748b; }
.share-item.print .share-icon { background: #94a3b8; }
.share-item.copy .share-icon { background: var(--primary); }

.copy-notice {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 100;
}

.copy-notice.show { opacity: 1; }

@media (max-width: 480px) {
    .share-modal-grid { grid-template-columns: repeat(3, 1fr); }
}

/* === Swiper Navigation Custom Arrows === */
.swiper-button-next::after,
.swiper-button-prev::after {
    display: none !important;
}

.swiper-button-next i,
.swiper-button-prev i {
    font-size: 20px;
    font-weight: 900;
}

/* Ensure buttons are visible and styled */
.swiper-button-next,
.swiper-button-prev {
    background: rgba(255, 255, 255, 0.9);
    width: 45px !important;
    height: 45px !important;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex !important; /* Force display since we added display:none in mobile earlier */
    align-items: center;
    justify-content: center;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: var(--primary);
    color: #fff !important;
    transform: scale(1.1);
}

@media (max-width: 640px) {
    /* Override the previous display:none for mobile if we want them visible now */
    .swiper-button-next,
    .swiper-button-prev {
        display: flex !important;
        width: 35px !important;
        height: 35px !important;
    }
    .swiper-button-next i,
    .swiper-button-prev i {
        font-size: 16px;
    }
}
