/* ================================================================
   W Dental Directory - Listing Display Styles
   ================================================================ */

:root {
    --wddm-primary: #2563eb;
    --wddm-primary-dark: #1d4ed8;
    --wddm-secondary: #059669;
    --wddm-accent: #f59e0b;
    --wddm-text: #1e293b;
    --wddm-text-light: #64748b;
    --wddm-bg: #ffffff;
    --wddm-bg-light: #f8fafc;
    --wddm-border: #e2e8f0;
    --wddm-radius: 12px;
    --wddm-radius-sm: 8px;
    --wddm-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --wddm-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --wddm-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

/* ================================================================
   SINGLE LISTING PAGE
   ================================================================ */

.wddm-listing-single {
    max-width: 1100px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Hero Section */
.wddm-listing-hero {
    position: relative;
    border-radius: var(--wddm-radius);
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--wddm-bg-light);
}

.wddm-hero-image img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
}

.wddm-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.wddm-category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wddm-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--wddm-primary);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.wddm-category-badge:hover {
    background: var(--wddm-primary-dark);
    color: #fff;
    text-decoration: none;
}

.wddm-rating-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.95);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--wddm-text);
}

.wddm-rating-badge .fa-star,
.wddm-rating-badge .fa-star-half-alt {
    color: var(--wddm-accent);
    font-size: 14px;
}

.wddm-rating-badge .far.fa-star {
    color: #d1d5db;
    font-size: 14px;
}

.wddm-review-count {
    color: var(--wddm-text-light);
    font-weight: 400;
    font-size: 13px;
}

/* Photo Gallery */
.wddm-photo-gallery {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.wddm-gallery-thumb {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border-radius: var(--wddm-radius-sm);
    overflow: hidden;
}

.wddm-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Layout */
.wddm-listing-content {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 30px;
    align-items: start;
}

.wddm-main-col {
    min-width: 0;
}

.wddm-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Highlights Bar */
.wddm-highlights-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f0fdf4;
    border-radius: var(--wddm-radius-sm);
    border: 1px solid #bbf7d0;
}

.wddm-highlight-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #86efac;
    border-radius: 20px;
    font-size: 13px;
    color: #166534;
    font-weight: 500;
}

.wddm-highlight-tag .fa-rainbow { color: #a855f7; }
.wddm-highlight-tag .fa-wheelchair { color: var(--wddm-primary); }
.wddm-highlight-tag .fa-venus { color: #ec4899; }
.wddm-highlight-tag .fa-medal { color: #b45309; }

/* Sections */
.wddm-section {
    margin-bottom: 28px;
}

.wddm-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--wddm-text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--wddm-border);
}

.wddm-section h2 i {
    color: var(--wddm-primary);
    font-size: 16px;
}

.wddm-section-content {
    color: var(--wddm-text);
    line-height: 1.7;
    font-size: 15px;
}

/* Services Grid */
.wddm-services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.wddm-service-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--wddm-bg-light);
    border-radius: var(--wddm-radius-sm);
    font-size: 14px;
    color: var(--wddm-text);
}

.wddm-service-item i {
    color: var(--wddm-secondary);
    font-size: 13px;
    flex-shrink: 0;
}

/* Business Hours */
.wddm-hours-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wddm-hours-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
}

.wddm-hours-row:nth-child(odd) {
    background: var(--wddm-bg-light);
}

.wddm-hours-row.wddm-today {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-weight: 500;
}

.wddm-day {
    font-weight: 500;
    color: var(--wddm-text);
    min-width: 100px;
}

.wddm-time {
    color: var(--wddm-text-light);
}

.wddm-time.wddm-closed {
    color: #ef4444;
    font-weight: 500;
}

.wddm-today-badge {
    background: var(--wddm-primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Sidebar Cards */
.wddm-contact-card,
.wddm-categories-card {
    background: var(--wddm-bg);
    border: 1px solid var(--wddm-border);
    border-radius: var(--wddm-radius);
    padding: 20px;
    box-shadow: var(--wddm-shadow);
}

.wddm-contact-card h3,
.wddm-categories-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--wddm-text);
}

.wddm-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--wddm-border);
    color: var(--wddm-text);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.wddm-contact-item:last-child {
    border-bottom: none;
}

a.wddm-contact-item:hover {
    color: var(--wddm-primary);
    text-decoration: none;
}

.wddm-contact-item i {
    width: 20px;
    text-align: center;
    color: var(--wddm-primary);
    font-size: 15px;
    flex-shrink: 0;
}

.wddm-phone-link {
    font-weight: 600;
    font-size: 16px;
    color: var(--wddm-secondary);
}

.wddm-phone-link i {
    color: var(--wddm-secondary);
}

.wddm-maps-link {
    background: var(--wddm-primary);
    color: #fff !important;
    border-radius: var(--wddm-radius-sm);
    padding: 12px 16px !important;
    justify-content: center;
    border-bottom: none !important;
    font-weight: 500;
    margin-top: 8px;
}

.wddm-maps-link i {
    color: #fff !important;
}

.wddm-maps-link:hover {
    background: var(--wddm-primary-dark);
    color: #fff !important;
}

/* Map Card */
.wddm-map-card {
    border-radius: var(--wddm-radius);
    overflow: hidden;
    box-shadow: var(--wddm-shadow);
}

/* Category Links */
.wddm-cat-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wddm-cat-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--wddm-bg-light);
    border-radius: var(--wddm-radius-sm);
    color: var(--wddm-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.wddm-cat-link:hover {
    background: #eff6ff;
    color: var(--wddm-primary);
    text-decoration: none;
}

.wddm-cat-link i {
    color: var(--wddm-primary);
    font-size: 13px;
}

/* ================================================================
   ARCHIVE / CATEGORY PAGE CARDS
   ================================================================ */

.wddm-archive-card {
    display: flex;
    background: var(--wddm-bg);
    border: 1px solid var(--wddm-border);
    border-radius: var(--wddm-radius);
    overflow: hidden;
    box-shadow: var(--wddm-shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    margin-bottom: 16px;
}

.wddm-archive-card:hover {
    box-shadow: var(--wddm-shadow-lg);
    transform: translateY(-2px);
}

.wddm-card-image-link {
    flex-shrink: 0;
    width: 200px;
    min-height: 180px;
    display: block;
}

.wddm-card-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wddm-placeholder-img {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wddm-placeholder-img i {
    font-size: 48px;
    color: var(--wddm-primary);
    opacity: 0.3;
}

.wddm-card-body {
    padding: 16px 20px;
    flex: 1;
    min-width: 0;
}

.wddm-card-categories {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.wddm-card-cat {
    display: inline-block;
    background: #eff6ff;
    color: var(--wddm-primary);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

.wddm-card-cat:hover {
    background: var(--wddm-primary);
    color: #fff;
    text-decoration: none;
}

.wddm-card-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}

.wddm-card-title a {
    color: var(--wddm-text);
    text-decoration: none;
}

.wddm-card-title a:hover {
    color: var(--wddm-primary);
}

.wddm-card-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.wddm-card-rating .fa-star,
.wddm-card-rating .fa-star-half-alt {
    color: var(--wddm-accent);
    font-size: 13px;
}

.wddm-card-rating .far.fa-star {
    color: #d1d5db;
    font-size: 13px;
}

.wddm-rating-text {
    font-weight: 600;
    color: var(--wddm-text);
    font-size: 14px;
}

.wddm-reviews-text {
    color: var(--wddm-text-light);
    font-size: 13px;
}

.wddm-card-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--wddm-text-light);
    margin-bottom: 6px;
}

.wddm-card-info i {
    width: 16px;
    text-align: center;
    color: var(--wddm-primary);
    font-size: 12px;
    flex-shrink: 0;
}

.wddm-card-info a {
    color: var(--wddm-text-light);
    text-decoration: none;
}

.wddm-card-info a:hover {
    color: var(--wddm-primary);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 900px) {
    .wddm-listing-content {
        grid-template-columns: 1fr;
    }

    .wddm-sidebar-col {
        order: -1;
    }

    .wddm-hero-image img {
        height: 250px;
    }

    .wddm-services-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .wddm-archive-card {
        flex-direction: column;
    }

    .wddm-card-image-link {
        width: 100%;
        height: 180px;
    }

    .wddm-hero-image img {
        height: 200px;
    }

    .wddm-hero-overlay {
        flex-direction: column;
        align-items: flex-start;
    }

    .wddm-listing-single {
        padding: 0 8px;
    }
}

/* ================================================================
   PAGE WRAPPER (for custom template)
   ================================================================ */

.wddm-page-wrapper {
    padding: 20px 0 60px;
    background: var(--wddm-bg-light);
    min-height: 60vh;
}

.wddm-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.wddm-listing-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--wddm-text);
    margin: 16px 0 20px;
    line-height: 1.3;
}

.wddm-cat-count {
    color: var(--wddm-text-light);
    font-weight: 400;
    font-size: 12px;
    margin-left: auto;
}

/* ================================================================
   GEODIRECTORY OVERRIDE SAFETY
   When our template is active, hide GD's default elements
   and ensure our content is always visible
   ================================================================ */

/* Hide GeoDirectory's default tab system and meta on our pages */
.wddm-page-wrapper ~ .geodir-tabs,
.wddm-page-wrapper ~ .geodir-single-tabs-wrapper,
body.single-gd_place .geodir-tabs,
body.single-gd_place .geodir-single-tabs-wrapper,
body.single-gd_place .geodir-single-reviews-section,
body.single-gd_place .geodir-post-meta-container {
    display: none !important;
}

/* But always show our wrapper and content */
.wddm-page-wrapper,
.wddm-page-wrapper * {
    visibility: visible !important;
}

.wddm-page-wrapper {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    opacity: 1 !important;
}

.wddm-listing-single {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
}

/* Ensure the listing content grid works */
.wddm-listing-content {
    display: grid !important;
    height: auto !important;
}
