/* ==========================================================================
   1. GLOBAL RESET & BASE STYLES
   ========================================================================== */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: sans-serif; 
}

body { 
    padding: 0 20px 20px 20px; 
    background-color: #ffffff; 
}

.container {
    width: 100%;
    padding: 0; 
}

/* ==========================================================================
   2. HEADER LAYOUT RULES
   ========================================================================== */
.main-header {
    display: flex;
    align-items: flex-start; 
    justify-content: space-between; 
    gap: 30px; 
    padding: 0 0 15px 0;
    width: 100%;
    margin-top: 0;
    min-height: 130px; 
    box-sizing: border-box;
}

.logo { 
    display: flex; 
    align-items: center;
    flex-shrink: 0; 
    min-width: 180px; 
}

.logo img {
    max-width: 300px; 
    width: 100%;           
    height: auto;      
}

.header-center-column {
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 15px;
    margin-top: 4px;
}

.top-banner-placeholder {
    width: 100%;
    height: 90px;
    display: flex;
    gap: 20px;
    justify-content: flex-start; 
    align-items: center;
    background: transparent; 
    border: none; 
}

/* ==========================================================================
   3. NAVIGATION & CATEGORY PILLS
   ========================================================================== */
.main-nav {
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    padding-top: 0; 
    padding-bottom: 0; 
    margin-top: 5px; 
    margin-bottom: 25px !important;
}

.nav-categories {
    display: flex;
    flex-wrap: wrap; 
    gap: 10px;
}

.nav-pill {
    background-color: #f4f4f4;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    border: 1px solid #ddd;
}

.nav-pill:hover {
    background-color: #e0e0e0;
}

/* ==========================================================================
   4. STRUCTURAL CORE LAYOUT ENGINE (HOMEPAGE & PROFILE MATRIX)
   ========================================================================== */
.main-layout {
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    gap: 15px; 
    max-width: 1150px;
    margin: 10px auto 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
}

.side-panel {
    padding: 12px; 
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    height: fit-content;
    width: 220px;
    max-width: 220px;
    box-sizing: border-box;
}

.sponsors-title {
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    color: #888888;
    letter-spacing: 1.5px;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
    font-weight: bold;
}

/* ==========================================================================
   5. SIDEBAR ADVERT CONTENT STRUCTURES
   ========================================================================== */
.ad-image-wrapper {
    display: block !important;
    padding: 0;
    overflow: hidden;
    border: none;
    margin-bottom: 15px;
    max-width: 190px !important; 
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.side-ad-image { 
    width: 100% !important; 
    height: auto !important; 
    max-width: 100% !important;
    object-fit: contain; 
    display: block; 
    border-radius: 4px; 
}

.text-article-card {
    background: #fdfdfd;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    display: block;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    word-break: break-word; 
}

.text-article-card:hover {
    border-color: #003366;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.text-article-card h4 {
    margin: 0;
    color: #003366;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.3;
}

.ad-caption {
    display: block;
    color: #64748b;
    font-style: italic;
    margin: 2px 0 6px 0;
    font-size: 11px;
}

.ad-spacer {
    margin-top: 6px;
}

.ad-body {
    margin: 0;
    color: #444;
    font-size: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: #0056b3;
    font-size: 11px;
    font-weight: bold;
    margin-top: 8px;
    display: block;
}

/* ==========================================================================
   6. HOTEL MAIN GRID ROW COMPONENTS (INDEX.PHP)
   ========================================================================== */
.product-grid {
    display: block;
}

.listings-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    width: 100% !important;
}

.hotel-horizontal-row {
    position: relative;
    display: flex !important;
    flex-direction: row;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    width: 100% !important;
    box-sizing: border-box;
}

.hotel-image-wrapper {
    width: 300px;
    max-width: 300px;
    flex-shrink: 0;
    background: #f4f6f9;
    position: relative;
}

.hotel-image-wrapper a {
    width: 100%;
    height: 100%;
    display: block;
}

.hotel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 180px;
}

.no-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    color: #999;
    height: 100%;
    min-height: 180px;
    width: 100%;
    font-weight: bold;
}

.hotel-info-card {
    padding: 15px;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px;
    width: 100% !important;
    box-sizing: border-box;
    background: #ffffff;
    flex-grow: 1;
    min-width: 0;
    position: relative;
}

.dog-friendly-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    z-index: 5;
    pointer-events: none;
}

.dog-friendly-badge img {
    width: 45px;
    height: 45px;
    display: block;
}

.hotel-heading-area {
    text-align: left;
    display: block;
    width: 100%;
    padding-right: 55px;
}

.hotel-title {
    font-size: 19px;
    font-weight: bold;
    color: #003366;
    margin: 0 0 1px 0;
    padding: 0;
    line-height: 1.2;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.hotel-title a {
    color: #003366;
    text-decoration: none;
}

.hotel-category {
    font-size: 12px;
    font-weight: 600;
    color: #666666;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.hotel-price-tag {
    font-size: 16px;
    font-weight: bold;
    color: #222222;
    margin: 0;
    display: block;
    text-align: left;
}

.price-prefix {
    font-size: 14px;
    font-weight: normal;
    color: #555;
}

.price-suffix {
    font-size: 13px;
    font-weight: normal;
    color: #666;
}

.hotel-description {
    font-size: 13px;
    color: #555555;
    line-height: 1.4;
    margin: 0;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: normal;
    padding-right: 20px;
}

.hotel-action-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin-top: auto;
    padding-top: 10px;
    box-sizing: border-box;
}

.btn-more-info, .btn-check-dates {
    flex: 1;
    text-align: center;
    padding: 8px 5px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    box-sizing: border-box;
}

.btn-more-info {
    background: #e5a900;
    color: #001a33;
    border: 1px solid #c68e00;
    transition: background 0.15s ease;
}

.btn-check-dates {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.admin-delete-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(211, 8, 28, 0.95);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.database-error-alert {
    color: white;
    background: #dc3545;
    padding: 15px;
    text-align: center;
    margin: 20px 0;
}

.empty-directory-box {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px dashed #ccc;
    width: 100%;
}

/* ==========================================================================
   7. ITINERARY SHORTLIST COMPONENT DATA STATS
   ========================================================================== */
.loop-shortlist-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 6px 10px;
    width: fit-content;
    margin: 2px 0 4px 0;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.loop-shortlist-box:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.loop-shortlist-box input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    cursor: pointer;
    accent-color: #28a745;
}

.loop-shortlist-box label {
    font-size: 12px;
    font-weight: bold;
    color: #475569;
    cursor: pointer;
    margin: 0;
}

/* ==========================================================================
   8. PAGINATION COMPONENT ELEMENT ENGINE
   ========================================================================== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 15px 0;
    border-top: 1px solid #ddd;
    width: 100%;
}

.pagination-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    text-decoration: none;
}

.active-nav {
    background: #003366;
    color: white;
}

.disabled-nav {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

.pagination-page-indicator {
    font-size: 14px;
    color: #333;
    font-weight: bold;
}

/* ==========================================================================
   9. EXTENDED STRUCTURAL FOOTER
   ========================================================================== */
.main-footer {
    background-color: #002244; 
    color: #ffffff;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 4px solid #cc0000; 
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr; 
    gap: 40px;
}

.footer-column:nth-child(2) {
    justify-self: center;
}

.footer-column:last-child {
    justify-self: end;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #f4f4f4;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-column p {
    color: #cccccc;
    line-height: 1.6;
    font-size: 14px;
    max-width: 400px; 
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul li a {
    color: #cccccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-column ul li a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.main-footer a {
    color: #ffffff; 
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.main-footer a:hover {
    color: #cccccc; 
    text-decoration: underline;
}

/* ==========================================================================
   10. LISTING DETAILS PAGE CORE BASICS (LISTING.PHP INTERIOR COMPONENTS)
   ========================================================================== */
html { scroll-behavior: smooth; }

.listing-center-grid {
    width: 100%;
}

.photo-deck-column {
    display: flex;
    flex-direction: column;
}

.image-zoom-container { 
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.image-zoom-container img { 
    width: 100%; 
    height: auto;
    max-height: 380px; 
    object-fit: cover; 
    display: block; 
    transition: transform 0.3s ease-in-out; 
}

.image-zoom-container:hover img {
    transform: scale(1.03);
}

.photo-caption-bar {
    padding: 10px 12px;
    background: #fbfbfb;
    border-top: 1px solid #eee;
    font-size: 13px;
    font-style: italic;
    color: #555;
}

.map-location-block {
    margin-top: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 15px;
    width: 100%;
}

#inline-property-map {
    width: 100%;
    height: 400px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    z-index: 1;
}

.duplicate-btn-wrap {
    margin-top: auto;
    padding-top: 25px;
    width: 100%;
}

.btn-global-booking {
    display: block;
    text-align: center;
    background: #28a745;
    color: #ffffff;
    padding: 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.badge-status-row {
    position: relative;
    width: 100%;
}

.category-geo-pill {
    background: #003366;
    color: white;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

.profile-dog-badge {
    position: absolute;
    top: -5px;
    right: 0;
    width: 65px;
    height: 68px;
    z-index: 10;
}

.profile-dog-badge img {
    width: 65px;
    height: 68px;
}

.profile-title-header-box {
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 15px;
    width: 100%;
}

.profile-main-title {
    font-size: 30px;
    font-weight: bold;
    color: #002244;
    margin: 0 0 10px 0;
    line-height: 1.25;
}

.profile-price-display {
    font-size: 20px;
    font-weight: bold;
    color: #2d3748;
}

.price-suffix-text {
    font-size: 14px;
    font-weight: normal;
    color: #718096;
}

.details-subheader-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.block-subheading {
    font-size: 15px;
    color: #003366;
    margin: 0;
    font-weight: bold;
}

.jump-map-link {
    font-size: 14px;
    font-weight: bold;
    color: #0056b3;
    text-decoration: underline;
}

.profile-body-copy {
    font-size: 15px;
    color: #334155;
    line-height: 1.7;
    white-space: pre-line;
}

.reviews-rating-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
}

.admin-edit-panel-bar {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #cbd5e1;
    text-align: right;
}

.admin-modify-btn {
    background: #cc0000;
    color: white;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    text-decoration: none;
}

.shortlist-widget-box {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 12px 15px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
}

.shortlist-widget-box input[type="checkbox"] { width: 18px; height: 18px; accent-color: #2e6f40; }
.shortlist-widget-box label { font-size: 14px; font-weight: bold; color: #334155; }

/* ==========================================================================
   11. RESPONSIVE VIEWPORT ENGINE - HOMEPAGE (INDEX.PHP BREAKPOINTS)
   ========================================================================== */

/* --- TABLET SQUEEZE RULE FOR INDEX.PHP --- */
@media (max-width: 1250px) {
    /* Reconfigure layout into an explicit 2-column track */
    .main-layout:not(:has(> .listing-center-grid)) {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }
    
    /* force hotel grids across full landscape */
    .main-layout:not(:has(> .listing-center-grid)) > .product-grid { 
        grid-column: span 2 !important;
        width: 100% !important;
    }
    
    /* Put the sidebars next to each other at the bottom */
    .main-layout:not(:has(> .listing-center-grid)) > .left-ads { 
        grid-column: 1 !important;
        margin-top: 25px !important;
    }
    
    .main-layout:not(:has(> .listing-center-grid)) > .right-ads { 
        grid-column: 2 !important;
        margin-top: 25px !important;
    }

    .side-panel { 
        width: 100% !important; 
        max-width: 100% !important;
        border: none !important;
        padding: 0 10px !important;
        box-shadow: none !important;
        text-align: center !important;
    }

    .left-ads .text-article-card, 
    .right-ads .text-article-card {
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .ad-image-wrapper {
        max-width: 300px !important; 
        width: 100% !important;
    }
}

/* --- MOBILE CARDS COLLAPSE FOR INDEX.PHP --- */
@media (max-width: 768px) {
    .hotel-horizontal-row {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    .hotel-image-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 10 !important; 
    }
    
    .hotel-img {
        width: 100% !important;
        height: 100% !important;
    }

    .hotel-info-card {
        padding: 20px !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .hotel-heading-area {
        padding-right: 0 !important;
    }

    .hotel-action-buttons {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
    }
}

/* --- MOBILE SIDEBAR STACK ENGINE --- */
@media (max-width: 650px) {
    .main-layout {
        display: flex !important;
        flex-direction: column !important;
    }
}

/* ==========================================================================
   12. RESPONSIVE VIEWPORT ENGINE - DETAIL PAGE (LISTING.PHP BREAKPOINTS)
   ========================================================================== */
@media (max-width: 1250px) {
    /* Stack layout cleanly on profile pages */
    .main-layout:has(> .listing-center-grid) {
        display: flex !important;
        flex-direction: column !important;
    }

    .listing-center-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 20px !important;
    }
    
    .photo-deck-column, 
    .details-profile-column {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }
}

/* ==========================================================================
   13. STRICT DESKTOP COLUMN OVERRIDES FOR LISTING.PHP
   ========================================================================== */
@media (min-width: 1251px) {
    /* Expand parent wrapper window safely exclusively for detail profiles */
    .main-layout:has(> .listing-center-grid) {
        max-width: 1300px !important;
    }

    .main-layout > .listing-center-grid {
        grid-column: 2 / 3 !important;
        display: flex !important;
        flex-direction: row !important; /* Locks left/right content perfectly side-by-side */
        justify-content: space-between !important;
        gap: 25px !important;
        width: 100% !important;
        min-width: 0 !important;
        align-items: flex-start !important;
    }

    .listing-center-grid > .photo-deck-column {
        width: 54% !important;
        max-width: 54% !important;
        flex: 0 0 54% !important;
    }

    .listing-center-grid > .details-profile-column {
        width: 43% !important;
        max-width: 43% !important;
        flex: 0 0 43% !important;
    }

    .main-layout:has(> .listing-center-grid) > .right-ads {
        grid-column: 3 / 4 !important;
    }
}

/* ==========================================================================
   14. BLOG TABLE COMPONENTS
   ========================================================================== */
.blog-table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
}

.blog-table td {
    width: 50%;
    padding: 15px;
    border: 1px solid #e0e0e0;
    vertical-align: top; /* Keeps content aligned to the top */
    position: relative;  /* Allows the button to be placed at the bottom */
}

/* Container for content so it stays top-aligned */
.content-wrapper {
    margin-bottom: 60px; /* Space to make sure text doesn't overlap the button */
    text-align: left;
}

/* Button wrapper pushes to the absolute bottom of the cell */
.button-wrapper {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
}

/* Fixes for text */
.blog-table td p {
    text-align: left !important;
    line-height: 1.3 !important;
    margin: 5px 0 !important;
}

.blog-table td h2 {
    text-align: center !important;
    margin-bottom: 5px !important;
}

.blog-table td img {
    display: block;
    margin: 10px auto;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .blog-table tr { display: block; }
    .blog-table td { width: 100% !important; display: block; }
    .button-wrapper { position: static; margin-top: 15px; }
    .content-wrapper { margin-bottom: 0; }
}