﻿//* ==========================================================================
   1. STRONA GŁÓWNA - TAGWALL (Sztywna siatka / Grid)
   ========================================================================== */

/* ==========================================================================
   1. STRONA GŁÓWNA - TAGWALL (Pancerny układ GRID)
   ========================================================================== */
.wall-section { padding: 20px 0; }

/* Mobile (Wymuszone 2 kolumny) */
.tagwall-container {
    display: grid !important; 
    grid-template-columns: repeat(2, 1fr) !important; 
    gap: 12px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Karta oferty */
.tagwall-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    height: 100%;
    margin-bottom: 0 !important; /* Usuwamy stary margines */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tagwall-card:active { transform: scale(0.98); }

.tagwall-image-wrapper { position: relative; width: 100%; }

/* --- ZDJĘCIE (Rozwiązanie problemu wielkich zdjęć!) --- */
.tagwall-image {
    width: 100%;
    height: auto !important; /* Kasujemy potężne 28vh */
    aspect-ratio: 4 / 3; /* To wymusza idealny, zgrabny prostokąt */
    object-fit: cover;
    display: block;
}

.tagwall-price {
    position: absolute; bottom: 8px; right: 8px; background: rgba(49, 52, 60, 0.9);
    color: #ffffff; padding: 4px 8px; border-radius: 6px; font-weight: 700; font-size: 0.85rem; backdrop-filter: blur(2px);
}

.tagwall-content { padding: 8px 10px; flex-grow: 1; }

.tagwall-title {
    font-size: 0.85rem; font-weight: 600; color: #333; margin: 0 0 6px 0;
    line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.tagwall-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tagwall-tag-mini { font-size: 0.7rem; color: #666; background: #f4f4f4; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }

/* Tablet (3 kolumny) */
@media (min-width: 768px) {
    .tagwall-container { grid-template-columns: repeat(3, 1fr) !important; gap: 15px; }
}

/* Desktop (Wymuszone 5 kolumn) */
@media (min-width: 1024px) {
    .tagwall-container { 
        grid-template-columns: repeat(5, 1fr) !important; 
        gap: 20px; 
        padding: 20px 0; 
    }
    .tagwall-card:hover { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
}

/* ==========================================================================
   2. OKNO MODALNE (Idealny podział ekranu)
   ========================================================================== */

/* Mobile domyślnie */
.modal-body-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 90vh; 
    overflow-y: auto; /* Pozwala na płynny scroll na ekranie telefonu */
}

.modal-image-side {
    width: 100%;
    height: 300px; /* Sztywne, zgrabne zdjęcie na telefonie */
    flex-shrink: 0;
    position: relative;
    background: #f8f9fa;
}
.modal-image-side img#modalImg { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-badge { position: absolute; bottom: 15px; left: 15px; background: rgba(255,255,255,0.95); padding: 6px 12px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.modal-right-side {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.modal-info-side { padding: 20px; flex-grow: 1; }
.modal-header-info { margin-bottom: 20px; }
.modal-title { font-size: 1.4rem; font-weight: 800; color: #1a252f; margin: 0 0 10px 0; line-height: 1.2; }
.modal-location { font-size: 0.9rem; color: #666; display: flex; align-items: center; gap: 6px; }
.modal-location svg { color: var(--tm-orange); }

.modal-price-box { background: var(--tm-gray-light); border-left: 4px solid var(--tm-orange); padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.modal-price-box .price-label { display: block; font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: #888; letter-spacing: 0.5px; margin-bottom: 5px; }
.modal-price-large { font-size: 2.2rem; font-weight: 900; color: #1a252f; line-height: 1; letter-spacing: -1px; }

#modalDesc { font-size: 0.95rem; line-height: 1.7; color: #555; margin-bottom: 20px; }

.tag-pill { background: #f8f9fa; color: var(--tm-orange); padding: 6px 12px; border-radius: 50px; font-weight: 600; font-size: 0.85rem; border: 1px solid rgba(255, 131, 0, 0.3); cursor: pointer; transition: all 0.2s; display: inline-block; }
.tag-pill:hover { background: var(--tm-orange); color: #fff; border-color: var(--tm-orange); }

.modal-action-box { 
    padding: 15px 20px; background: #ffffff; border-top: 1px solid #eee; 
    position: sticky; bottom: 0; z-index: 10; 
}

.btn-primary-reserve { width: 100%; background: var(--tm-orange); color: #ffffff; border: none; padding: 16px 20px; border-radius: 12px; font-size: 1.15rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: 0 6px 20px rgba(255, 107, 0, 0.3); }
.btn-primary-reserve:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(255, 107, 0, 0.45); background: var(--tm-orange-hover, #e65c00); }
.btn-primary-reserve:active { transform: scale(0.98) translateY(0); box-shadow: 0 2px 10px rgba(255, 107, 0, 0.2); }

/* --- DESKTOP (Split Screen) --- */
@media (min-width: 768px) {
    .modal-content { height: 600px; max-height: 90vh; }
    .modal-body-wrapper { flex-direction: row; height: 100%; overflow-y: hidden; }
    
    .modal-image-side { width: 50%; height: 100%; }
    
    .modal-right-side {
        width: 50%;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    .modal-info-side {
        overflow-y: auto; /* Tylko tekst ma suwak, zdjęcie stoi sztywno! */
        padding: 30px;
    }
    .modal-action-box { padding: 20px 30px; }
}

/* Nav Strzałki */
.modal-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.85); border: none; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 15; color: var(--tm-dark); box-shadow: 0 4px 15px rgba(0,0,0,0.15); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); backdrop-filter: blur(4px); }
.modal-nav-btn svg { width: 24px; height: 24px; stroke-width: 2.5px; }
.modal-nav-btn:hover { background: #ffffff; color: var(--tm-orange); transform: translateY(-50%) scale(1.1); }
.modal-nav-btn:active { transform: translateY(-50%) scale(0.95); }
.nav-prev { left: 15px; }
.nav-next { right: 15px; }

@media (max-width: 767px) {
    .modal-nav-btn { width: 38px; height: 38px; background: rgba(255, 255, 255, 0.95); }
    .nav-prev { left: 10px; }
    .nav-next { right: 10px; }
}

/* ==========================================================================
   2. OKNO MODALNE (Szczegóły Oferty)
   ========================================================================== */
.modal-body-wrapper { display: flex; flex-direction: column; width: 100%; height: 100%; max-height: 90vh; }
.modal-image-side { width: 100%; height: 35vh; flex-shrink: 0; position: relative; background: #f8f9fa; }
.modal-image-side img#modalImg { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-badge { position: absolute; bottom: 15px; left: 15px; background: rgba(255,255,255,0.95); padding: 6px 12px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.modal-info-side { width: 100%; padding: 25px 20px 0 20px; display: flex; flex-direction: column; flex-grow: 1; overflow: hidden; }
.modal-header-info { margin-bottom: 20px; }
.modal-title { font-size: 1.4rem; font-weight: 800; color: #1a252f; margin: 0 0 10px 0; line-height: 1.2; }
.modal-location { font-size: 0.9rem; color: #666; display: flex; align-items: center; gap: 6px; }
.modal-location svg { color: var(--tm-orange); }
.modal-price-box { background: var(--tm-gray-light); border-left: 4px solid var(--tm-orange); padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.modal-price-box .price-label { display: block; font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: #888; letter-spacing: 0.5px; margin-bottom: 5px; }
.modal-price-large { font-size: 2.2rem; font-weight: 900; color: #1a252f; line-height: 1; letter-spacing: -1px; }
.modal-desc-scroll { flex-grow: 1; overflow-y: auto; padding-right: 10px; margin-bottom: 10px; }
.modal-desc-scroll::-webkit-scrollbar { width: 6px; }
.modal-desc-scroll::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.modal-desc-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.modal-desc-scroll::-webkit-scrollbar-thumb:hover { background: #aaa; }
.modal-desc-scroll h5 { font-size: 1.1rem; font-weight: 700; margin: 0 0 10px 0; color: #1a252f; }
#modalDesc { font-size: 0.95rem; line-height: 1.7; color: #555; margin-bottom: 20px; }
.tag-pill { background: #f8f9fa; color: var(--tm-orange); padding: 6px 12px; border-radius: 50px; font-weight: 600; font-size: 0.85rem; border: 1px solid rgba(255, 131, 0, 0.3); cursor: pointer; transition: all 0.2s; display: inline-block; }
.tag-pill:hover { background: var(--tm-orange); color: #fff; border-color: var(--tm-orange); }
.modal-action-box { padding: 15px 20px; background: #ffffff; border-top: 1px solid #eee; z-index: 10; }
.btn-primary-reserve { width: 100%; background: var(--tm-orange); color: #ffffff; border: none; padding: 16px 20px; border-radius: 12px; font-size: 1.15rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: 0 6px 20px rgba(255, 107, 0, 0.3); }
.btn-primary-reserve:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(255, 107, 0, 0.45); background: var(--tm-orange-hover, #e65c00); }
.btn-primary-reserve:active { transform: scale(0.98) translateY(0); box-shadow: 0 2px 10px rgba(255, 107, 0, 0.2); }
.btn-primary-reserve:hover svg { animation: pulseIcon 1s infinite; }
@keyframes pulseIcon { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }

.modal-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.85); border: none; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 15; color: var(--tm-dark); box-shadow: 0 4px 15px rgba(0,0,0,0.15); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); backdrop-filter: blur(4px); }
.modal-nav-btn svg { width: 24px; height: 24px; stroke-width: 2.5px; }
.modal-nav-btn:hover { background: #ffffff; color: var(--tm-orange); transform: translateY(-50%) scale(1.1); }
.modal-nav-btn:active { transform: translateY(-50%) scale(0.95); }
.nav-prev { left: 15px; }
.nav-next { right: 15px; }

@media (max-width: 767px) {
    .modal-nav-btn { width: 38px; height: 38px; background: rgba(255, 255, 255, 0.95); }
    .nav-prev { left: 10px; }
    .nav-next { right: 10px; }
}

@media (min-width: 768px) {
    .modal-content { height: 600px; }
    .modal-body-wrapper { flex-direction: row; }
    .modal-image-side { width: 50%; height: 100%; }
    .modal-info-side { width: 50%; height: 100%; padding: 30px 30px 0 30px; }
    .modal-action-box { padding: 20px 30px 30px 30px; }
}