/*
Theme Name: Sea Properties Professional Styles
Description: Модерни стилове за визуализация на имоти с фокус върху UX и конверсии.
Version: 1.0.0
*/

:root {
    /* Основна палитра */
    --sea-teal: #0e7490;         /* Основен бранд цвят */
    --sea-teal-hover: #155e75;   /* Тъмен вариант за hover */
    --sea-teal-light: #ecfeff;   /* Светъл фон */
    
    --sea-coral: #f97316;        /* Акцент (Call to Action) */
    --sea-coral-hover: #ea580c;  
    
    --sea-pink: #db2777;         /* Акцент за цени */
    --sea-sand: #fffbeb;         /* Топъл фон за етикети */
    
    --sea-dark: #0f172a;         /* Тъмен текст/заглавия */
    --sea-text: #334155;         /* Основен текст */
    --sea-gray: #64748b;         /* Вторичен текст */
    --sea-border: #e2e8f0;       /* Бордери */
    --sea-bg-gray: #f8fafc;      /* Лек фон за секции */

    /* Системни цветове */
    --status-success: #10b981;
    --status-danger: #ef4444;

    /* Размери и Ефекти */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   1. GLOBAL WRAPPER & LAYOUT
   ========================================= */

.sea-listing-wrapper {
    width: 94%;
    max-width: 1440px; /* Стандарт за големи екрани */
    margin: 0 auto;
    padding: 40px 0;
    font-family: 'Manrope', 'Open Sans', sans-serif; /* Fallback */
    color: var(--sea-text);
    box-sizing: border-box;
}

.sea-listing-wrapper * {
    box-sizing: border-box;
}

/* 3-Column Grid Layout */
.listing-3col-layout {
    display: grid;
    grid-template-columns: 260px 1fr 380px; /* Ляво | Съдържание | Дясно */
    gap: 40px;
    align-items: start;
}

/* =========================================
   2. GALLERY SYSTEM (MODERN)
   ========================================= */

.listing-gallery-modern {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
    background: #000; /* За да не белее при зареждане */
}

.gallery-hero {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gallery-hero img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.gallery-hero:hover img {
    transform: scale(1.03);
}

.gallery-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.75); /* Полупрозрачно тъмно */
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(8px);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Thumbnails Grid */
.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-top: 4px;
}

.thumb-link {
    position: relative;
    overflow: hidden;
    display: block;
    height: 100px;
}

.thumb-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.thumb-link:hover img {
    opacity: 0.8;
}

.more-count {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(14, 116, 144, 0.9); /* Teal Overlay */
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    transition: var(--transition);
}

.thumb-link:hover .more-count {
    background: rgba(14, 116, 144, 0.95);
}

/* =========================================
   3. HEADER & TITLE INFO
   ========================================= */

.badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.card-badges {
    position: absolute;
    top: 15px; left: 15px;
    z-index: 2;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.listing-badge, .card-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Цветове за баджовете */
.bg-blue { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }      /* ИМОТ */
.bg-dark { background: #f8fafc; color: #334155; border: 1px solid #cbd5e1; }      /* БИЗНЕС */
.bg-purple { background: #f3e8ff; color: #7e22ce; border: 1px solid #d8b4fe; }    /* УСЛУГА */
.bg-green { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }     /* ПРОДАЖБА */
.bg-orange { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }    /* НАЕМ */

.listing-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 15px 0;
    color: var(--sea-dark);
    letter-spacing: -0.5px;
}

.listing-address {
    color: var(--sea-text);
    font-size: 1.1rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.listing-address i {
    color: var(--sea-coral);
}

.map-link-scroll {
    font-size: 0.9rem;
    color: var(--sea-teal);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.map-link-scroll:hover {
    color: var(--sea-teal-hover);
}

/* =========================================
   4. STATS GRID (Квадратите с инфо)
   ========================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Автоматично пренареждане */
    gap: 15px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border: 1px solid var(--sea-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--sea-teal);
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
}

.stat-card .icon {
    width: 42px;
    height: 42px;
    background: var(--sea-teal-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sea-teal);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-card .info {
    display: flex;
    flex-direction: column;
}

.stat-card .label {
    font-size: 0.75rem;
    color: var(--sea-gray);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-card .value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--sea-dark);
    line-height: 1.1;
}

/* =========================================
   5. CONTENT BOXES & SECTIONS
   ========================================= */

.content-box {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
    border: 1px solid var(--sea-border);
    transition: var(--transition);
}

/* Лек ховър ефект на секциите */
.content-box:hover {
    box-shadow: var(--shadow-soft);
    border-color: #cbd5e1;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 25px 0;
    color: var(--sea-dark);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sea-border);
    padding-bottom: 15px;
}

.section-title i {
    color: var(--sea-coral);
    background: #fff7ed;
    padding: 8px;
    border-radius: 8px;
    font-size: 1rem;
}

.listing-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--sea-text);
}

.listing-text p {
    margin-bottom: 1.5em;
}

/* Feature List Styling */
.features-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--sea-text);
    font-size: 1rem;
}

.features-list li i {
    color: var(--sea-teal);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Map Container */
#listing-map {
    height: 450px;
    width: 100%;
    border-radius: var(--radius-md);
    z-index: 1;
    border: 1px solid var(--sea-border);
    background: var(--sea-bg-gray); /* Placeholder преди зареждане */
}

.map-note {
    font-size: 0.85rem;
    color: var(--sea-gray);
    margin-top: 12px;
    text-align: center;
    font-style: italic;
    background: var(--sea-bg-gray);
    padding: 8px;
    border-radius: var(--radius-sm);
}

/* =========================================
   6. SIDEBAR & AGENT CARD
   ========================================= */

.sticky-sidebar {
    position: sticky;
    top: 120px; /* Регулирай спрямо височината на хедъра на сайта */
}

.price-card-desktop {
    background: var(--sea-pink);
    /* Лек градиент за повече дълбочина */
    background: linear-gradient(135deg, var(--sea-pink) 0%, #be185d 100%);
    color: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 15px 30px rgba(219, 39, 119, 0.25);
    position: relative;
    overflow: hidden;
}

.price-card-desktop::before {
    /* Декоративен кръг */
    content: '';
    position: absolute;
    top: -20px; left: -20px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.price-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.9;
    letter-spacing: 1px;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 10px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.price-sqm {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sea-pink);
    background: white;
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Agent Card */
.agent-card {
    background: white;
    border: 1px solid var(--sea-border);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.agent-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.agent-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 20px 0;
    color: var(--sea-dark);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--sea-bg-gray);
}

.agent-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.agent-avatar img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.agent-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sea-dark);
    line-height: 1.2;
}

.agent-role {
    font-size: 0.9rem;
    color: var(--sea-teal);
    font-weight: 600;
    margin-top: 4px;
}

/* Action Buttons */
.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    margin-bottom: 10px;
    border: none;
    font-size: 1rem;
}

.btn-phone {
    background: var(--sea-coral);
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.btn-phone:hover {
    background: var(--sea-coral-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(249, 115, 22, 0.35);
}

.btn-email {
    background: white;
    border: 2px solid var(--sea-border);
    color: var(--sea-text);
}

.btn-email:hover {
    border-color: var(--sea-teal);
    color: var(--sea-teal);
    background: var(--sea-teal-light);
}

.security-note {
    font-size: 0.8rem;
    color: var(--status-success);
    background: #ecfdf5;
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}

/* =========================================
   7. RESPONSIVE DESIGN (Media Queries)
   ========================================= */

@media (max-width: 1280px) {
    .listing-3col-layout {
        grid-template-columns: 1fr 350px; /* Скриваме левия сайдбар */
    }
    .col-side-left {
        display: none;
    }
}

@media (max-width: 900px) {
    .sea-listing-wrapper {
        width: 100%;
        padding: 0;
    }
    
    .listing-3col-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .col-center {
        padding: 20px;
        padding-bottom: 120px; /* Място за sticky footer */
    }

    /* Скриваме десктоп елементи */
    .col-side-right,
    .desktop-header-info {
        display: none;
    }

    /* Мобилен хедър */
    .mobile-header {
        display: block;
        padding: 20px 20px 0 20px;
    }

    .mobile-title {
        font-size: 1.75rem;
    }

    /* Мобилна галерия */
    .listing-gallery-modern {
        border-radius: 0;
        margin: 0 -20px 30px -20px;
    }

    .gallery-hero img {
        height: 350px;
    }

    .gallery-thumbs {
        padding: 0 20px;
    }

    /* Content Box на мобилно */
    .content-box {
        padding: 25px 20px;
        margin: 0 -20px 20px -20px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        border-bottom: 1px solid var(--sea-border);
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr; /* По 2 на ред */
    }
    
    .features-list {
        grid-template-columns: 1fr; /* Една колона за екстри */
    }
}

/* =========================================
   8. MOBILE STICKY FOOTER
   ========================================= */

.mobile-sticky-footer {
    display: none; /* Скрито по подразбиране */
}

@media (max-width: 900px) {
    .mobile-sticky-footer {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 12px 20px;
        /* Safe Area за iPhone X+ */
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
        z-index: 1000;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid var(--sea-border);
    }

    .sticky-info {
        display: flex;
        flex-direction: column;
    }

    .sticky-label {
        font-size: 0.7rem;
        color: var(--sea-gray);
        text-transform: uppercase;
        font-weight: 700;
    }

    .sticky-price {
        font-size: 1.3rem;
        font-weight: 800;
        color: var(--sea-pink);
        line-height: 1.1;
    }

    .sticky-actions {
        display: flex;
        gap: 10px;
    }

    .sticky-btn {
        border: none;
        border-radius: 50px; /* Pill shape */
        padding: 0 20px;
        height: 48px;
        font-weight: 700;
        font-size: 0.95rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        transition: transform 0.2s;
    }

    .sticky-btn:active {
        transform: scale(0.95);
    }

    .btn-call {
        background: var(--sea-coral);
        color: white;
        width: 48px;
        padding: 0;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(249, 115, 22, 0.3);
    }

    .btn-msg {
        background: var(--sea-dark);
        color: white;
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
    }
}

/* =========================================
   9. PRINT STYLES (За принтиране на обява)
   ========================================= */
@media print {
    /* Скриваме всичко излишно */
    .col-side-left, 
    .sticky-actions, 
    .btn-action, 
    .gallery-thumbs, 
    .map-link-scroll,
    .mobile-sticky-footer,
    header, footer, .sidebar-banners-area {
        display: none !important;
    }

    .sea-listing-wrapper {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    .listing-3col-layout {
        display: block; /* Премахваме Grid-а */
    }

    .col-center, .col-side-right {
        width: 100%;
        float: none;
    }
    
    .gallery-hero img {
        height: 300px; /* По-малка снимка */
    }

    .content-box {
        border: none;
        padding: 0;
        margin-bottom: 20px;
        page-break-inside: avoid; /* Да не се реже по средата */
    }

    .listing-text {
        font-size: 12pt;
        color: black;
    }

    .price-card-desktop {
        background: none;
        color: black;
        border: 2px solid black;
        box-shadow: none;
        padding: 10px;
    }
    
    .price-value {
        color: black;
    }

    a[href]:after {
        content: " (" attr(href) ")"; /* Показваме URL при принт */
        font-size: 0.8rem;
    }
    
    
}

/* =========================================
   10. ARCHIVE & GRID STYLES (Резултати)
   ========================================= */

.sea-archive-wrapper {
    background-color: #f8fafc;
    padding: 60px 0 100px 0;
    min-height: 60vh;
}

.sea-archive-container {
    width: 94%;
    max-width: 1350px;
    margin: 0 auto;
}

.sea-archive-header {
    margin-bottom: 40px;
    text-align: center;
}

.archive-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--sea-dark);
    margin: 0 0 10px 0;
}

.archive-subtitle {
    font-size: 1.1rem;
    color: var(--sea-gray);
}

/* Решетка за картите */
.sea-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* Карта на имот */
.property-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--sea-border);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.card-image-wrapper {
    position: relative;
    display: block;
    height: 240px;
    overflow: hidden;
    background: #0f172a;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.property-card:hover .card-img {
    transform: scale(1.05);
}

.card-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: rgba(255,255,255,0.2);
}

.card-badges {
    position: absolute;
    top: 15px; left: 15px;
    z-index: 2;
}

.offer-badge {
    background: var(--sea-sand);
    color: #b45309;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.card-price-overlay {
    position: absolute;
    bottom: 15px; left: 15px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px);
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.1rem;
    z-index: 2;
}

.card-content {
    padding: 25px 20px;
    flex: 1;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.card-title a {
    color: var(--sea-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.card-title a:hover { color: var(--sea-teal); }

.card-location {
    font-size: 0.9rem;
    color: var(--sea-gray);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    border-top: 1px solid var(--sea-border);
    padding-top: 15px;
}

.meta-item {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sea-text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.meta-item i { color: var(--sea-teal); }

.card-footer {
    padding: 15px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--sea-border);
}

.card-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--sea-teal);
    font-weight: 700;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.card-btn:hover { color: var(--sea-teal-hover); }

/* Пагинация */
.sea-pagination { margin-top: 50px; text-align: center; }
.sea-pagination ul { list-style: none; padding: 0; display: inline-flex; gap: 8px; }
.sea-pagination a, .sea-pagination span {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 8px; font-weight: 700;
    background: #fff; border: 1px solid var(--sea-border); color: var(--sea-text); text-decoration: none; transition: 0.2s;
}
.sea-pagination a:hover { border-color: var(--sea-teal); color: var(--sea-teal); }
.sea-pagination .current { background: var(--sea-teal); color: #fff; border-color: var(--sea-teal); }

/* Няма резултати */
.sea-no-results {
    text-align: center; padding: 80px 20px; background: #fff;
    border-radius: var(--radius-lg); border: 1px dashed #cbd5e1;
}
.no-results-icon { font-size: 4rem; color: #cbd5e1; margin-bottom: 20px; }
.sea-no-results h3 { font-size: 1.5rem; color: var(--sea-dark); margin-bottom: 10px; }
.sea-no-results p { color: var(--sea-gray); font-size: 1.1rem; }

/* =========================================
   11. FAVORITES (Сърчица)
   ========================================= */
.sea-fav-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    color: #94a3b8;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.sea-fav-btn:hover {
    transform: scale(1.1);
    color: #ef4444; /* Червено при посочване */
}

.sea-fav-btn.active {
    color: #ef4444; /* Плътно червено, когато е запазено */
}

/* Стил за бутона вътре в самата обява (single-listing) */
.desktop-header-info .sea-fav-btn {
    position: static;
    width: auto;
    height: auto;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    gap: 8px;
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.desktop-header-info .sea-fav-btn:hover {
    border-color: #fca5a5;
    background: #fef2f2;
}

.desktop-header-info .sea-fav-btn.active {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}