/* ========================================
   SUPPLIER DIRECTORY & REGISTRATION
   ======================================== */

/* --- Supplier Archive Header --- */
.archive-header-bar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 1.25rem 0;
    margin-bottom: 1.875rem;
    border-radius: 5px;
    overflow: hidden;
}

.container-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mobile adjustment for header is already in media queries below */

.header-content-left h1 {
    margin: 0;
    font-size: 3rem;
    color: var(--baltic-blue, #2c3e50);
}

.archive-description {
    margin-top: 5px;
    color: #666;
}

/* --- Top Section 50/50 --- */
.supplier-top-section {
    display: flex;
    gap: 1.875rem;
    margin-bottom: 2.5rem;
}

.top-col-left,
.top-col-right {
    flex: 1;
    background: #fff;
    padding: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.top-col-left h3,
.top-col-right h3 {
    margin-top: 0;
    color: var(--baltic-blue, #2c3e50);
}

/* Right Column (CTA) Background update per user request */
.top-col-right .supplier-cta-card {
    background: var(--alice-blue, #eaf4fb);
    padding: 1.25rem;
    border-radius: 0.5rem;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* --- Forms (Standardized) --- */
.tgc-registration-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.25rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-row {
    margin-bottom: 10px;
}

.form-row label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.form-row select,
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="url"],
.form-row textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    box-sizing: border-box;
    /* Added for safety */
}

.form-row.two-col {
    display: flex;
    gap: 0.9375rem;
}

.form-row.two-col>div {
    flex: 1;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: 1.875rem;
}

.form-actions .button {
    flex: 1;
}

.reset-link {
    font-size: 0.9em;
    color: #888;
    text-decoration: none;
}

/* Custom Multi-Select Dropdown */
.tgc-multi-select {
    position: relative;
    width: 100%;
}

.tgc-multi-select-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    cursor: pointer;
    user-select: none;
}

.tgc-multi-select-toggle:hover {
    border-color: #bbb;
}

.tgc-multi-select-arrow {
    font-size: 0.8em;
    color: #666;
    transition: transform 0.2s ease;
}

.tgc-multi-select.active .tgc-multi-select-arrow {
    transform: rotate(180deg);
}

.tgc-multi-select-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.tgc-multi-select.active .tgc-multi-select-panel {
    display: block;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 15px;
    margin: 0;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: normal;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.checkbox-label:last-child {
    border-bottom: none;
}

.checkbox-label:hover {
    background: #f9f9f9;
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    background: var(--alice-blue, #eaf4fb);
    color: var(--baltic-blue, #2c3e50);
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Buttons */
/* Base button style matching site theme */
.button-primary,
.button-contact,
.button-search,
.button-reset,
.button-register,
.button-visit-site {
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    font-weight: 600;
    font-family: var(--font-body, 'National Park', 'Arial', sans-serif);
    box-sizing: border-box;
    appearance: none;
    height: 46px;
}

/* Default Colors */
.button-primary,
.button-contact {
    background: var(--baltic-blue, #2c3e50);
    color: #fff;
    width: 100%;
}

.button-primary:hover {
    background: var(--rich-cerulean, #427aa1);
}

.button-contact:hover {
    background: var(--sage-green, #6b8e23);
}

.button-visit-site {
    background: var(--sage-green, #6b8e23);
    color: #fff;
    width: auto;
    height: auto;
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
}

.button-visit-site:hover {
    background: var(--rich-cerulean, #427aa1);
    color: #fff;
}

/* Specific Button Colors requested by user:
   "Search on light green background and reset on light blue, and the alternate on hover"
   "Register ... light green and light blue hover"
*/

.button-search {
    background: var(--sage-green, #6b8e23);
    /* Light Green standard */
    color: #fff;
    width: 100%;
}

.button-search:hover {
    background: var(--rich-cerulean, #3b7ea1);
    /* Light Blue Hover */
}

.button-reset {
    background: var(--rich-cerulean, #3b7ea1);
    /* Light Blue standard */
    color: #fff;
    width: 100%;
}

.button-reset:hover {
    background: var(--sage-green, #6b8e23);
    /* Light Green Hover */
}

.button-register {
    background: var(--baltic-blue, #05668d);
    color: #fff;
    width: auto;
    display: inline-block;
    margin-top: 0.625rem;
}

.button-register:hover {
    background: var(--rich-cerulean, #427aa1);
}


/* CTA */
.supplier-cta-card h3 {
    margin-top: 0;
    color: var(--baltic-blue);
}

.supplier-cta-card p {
    color: #555;
}

/* --- Supplier Listing Cards --- */
.supplier-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.supplier-card {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    /* 3 Columns: Image | content | Action */
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 0;
    margin: 0.9375rem 0;
}

.supplier-col-img {
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.supplier-col-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 200px;
}

.supplier-col-details {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    overflow-wrap: break-word;
}

.supplier-title {
    margin-top: 0;
    font-size: 1.4rem;
    color: var(--baltic-blue, #2c3e50);
    margin-bottom: 0.625rem;
}

.desc-row {
    color: #555;
    font-size: 0.95em;
    margin-bottom: 0.625rem;
}

.services-row {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 0.625rem;
}

.web-row a.website-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--alice-blue, #eaf4fb);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    font-size: 0.85em;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.web-row a.website-pill:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.website-pill .pill-label {
    background: var(--alice-blue, #eaf4fb);
    color: var(--baltic-blue, #2c3e50);
    padding: 4px 12px;
    font-weight: 600;
}

.website-pill .pill-url {
    padding: 4px 12px;
    color: #555;
    background: #fff;
}

/* Star Ratings */
.contact-middle.tgc-supplier-rating {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tgc-stars {
    font-size: 1.5rem;
    line-height: 1;
    color: #e0e0e0;
}

.tgc-star {
    transition: color 0.2s ease;
}

.tgc-star.filled {
    color: #ffc107;
}

/* Pointer cursor for all unvoted stars — clicking shows modal for non-premium */
.tgc-stars:not(.has-voted) {
    cursor: pointer;
}

/* Hover highlight only for premium users who can actually rate */
.tgc-stars.can-rate:not(.has-voted):not(.vote-submitting) .tgc-star:hover,
.tgc-stars.can-rate:not(.has-voted):not(.vote-submitting) .tgc-star.hover {
    color: #ffca28;
}

.tgc-rating-count {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

.tgc-rating-count .review-count-text {
    font-size: 0.8rem;
    color: #888;
}

/* Contact Modal Redesign */
.tgc-modal-content {
    padding: 0;
    overflow: hidden;
}

.tgc-modal-header {
    background: var(--alice-blue, #eaf4fb);
    padding: 25px 30px;
    text-align: center;
    border-bottom: 1px solid #dce8f4;
}

.tgc-modal-header h3 {
    margin: 0 0 5px 0;
    color: var(--baltic-blue, #2c3e50);
}

.tgc-modal-header p {
    margin: 0;
    color: #555;
    font-size: 0.95em;
}

.tgc-modal-body {
    padding: 30px;
    background: #fff;
}

.tgc-modal-body .form-group {
    margin-bottom: 15px;
}

.tgc-modal-body input[type="text"],
.tgc-modal-body input[type="email"],
.tgc-modal-body select,
.tgc-modal-body textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
}

.tgc-modal-body textarea {
    resize: vertical;
}

#tgc-enquiry-message {
    display: none;
    margin-top: 15px;
    text-align: center;
}

#tgc-rating-restrict-modal .tgc-modal-body {
    text-align: center;
}

#tgc-rating-register-btn {
    display: inline-block;
    margin-top: 10px;
    text-decoration: none;
}

.button-submit-enquiry {
    background: var(--sage-green, #679436);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-family: var(--font-body, 'National Park', 'Arial', sans-serif);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.button-submit-enquiry:hover {
    background: var(--rich-cerulean, #3b7ea1);
}

.tgc-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--baltic-blue);
    line-height: 1;
    z-index: 10;
}

.supplier-col-contact {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem;
    background: #f9fcf9;
    border-left: 1px solid #eee;
    text-align: center;
    min-width: 0;
    overflow: hidden;
}

.contact-top {
    font-weight: bold;
    color: #555;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.contact-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Modal --- */
.tgc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.tgc-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 90%;
    max-width: 500px;
    z-index: 1000;
    border-radius: 0.5rem;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

.tgc-modal-close {
    position: absolute;
    right: 0.9375rem;
    top: 0.625rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-rowing {
    display: flex;
    gap: 0.625rem;
}

/* Legacy name from inline, keeping for safety */
.form-half {
    flex: 1;
}

.tgc-modal-body .form-group {
    margin-bottom: 0.9375rem;
}

.tgc-modal-body .form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.3125rem;
    font-size: 0.9em;
}

.tgc-modal-body .form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    resize: vertical;
}

.message-success {
    color: green;
}

.message-error {
    color: red;
}

/* --- Responsive Adjustments --- */

/* Tablet: switch to stacked before the middle column gets too narrow */
@media (max-width: 1024px) {
    .supplier-top-section {
        flex-direction: column;
    }

    .supplier-card {
        grid-template-columns: 1fr;
    }

    .supplier-col-img {
        height: 200px;
        order: -1;
        /* always render image first */
    }

    .supplier-col-contact {
        border-left: none;
        border-top: 1px solid #eee;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 1rem;
        text-align: center;
    }

    .supplier-col-contact .button-contact {
        width: auto;
        min-width: 140px;
    }

    /* Mobile button fix: full width, no overflow */
    .button-primary,
    .button-contact,
    .button-search,
    .button-reset,
    .button-register,
    .button-submit-enquiry {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .button-register {
        width: auto;
        min-width: 160px;
    }
}


/* ===== Single Supplier Page ===== */
.supplier-back-nav {
    margin-top: 20px;
    margin-bottom: 20px;
}

.supplier-back-nav a {
    color: var(--sage-green);
    text-decoration: none;
    font-weight: bold;
}

.supplier-single-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.supplier-header {
    display: flex;
    flex-wrap: wrap;
    padding: 30px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.supplier-logo {
    flex: 0 0 150px;
    margin-right: 30px;
}

.supplier-logo-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.supplier-logo-placeholder {
    width: 150px;
    height: 150px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #aaa;
}

.supplier-intro {
    flex: 1;
    min-width: 300px;
}

.badges {
    margin-bottom: 10px;
}

.badge.tier-badge {
    background: #005670;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 5px;
}

.badge.cat-badge {
    background: #e2e8f0;
    color: #4a5568;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 5px;
}

.supplier-single-card .entry-title {
    margin: 0 0 10px 0;
    font-size: 2.2rem;
}

.supplier-single-card .location {
    color: #666;
    margin: 0;
}

.supplier-cta {
    flex: 0 0 100%;
    text-align: left;
    margin-top: 20px;
}

.supplier-visit-site {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    text-decoration: none;
    padding: 15px 30px;
    text-align: center;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.1rem;
}

.supplier-cta small {
    display: inline-block;
    margin-left: 15px;
    color: #999;
    font-size: 0.85rem;
}

.supplier-body {
    padding: 30px;
}

.supplier-quick-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.info-item {
    flex: 1;
    min-width: 200px;
}

.info-item strong {
    display: block;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
}

.info-item a {
    font-weight: 600;
    color: var(--baltic-blue);
}

.info-item .info-value {
    font-weight: 600;
    color: #333;
}

.premium-offer {
    background: #fff4e6;
    border: 1px solid #ffcc99;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}

.premium-offer h5 {
    margin: 0 0 10px 0;
    color: #e67e22;
    font-size: 1.1rem;
}

.premium-offer>p {
    margin: 0;
    font-weight: bold;
    color: #333;
    font-size: 1.05rem;
}

.premium-offer .upsell-note {
    margin: 10px 0 0 0;
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
}

.premium-offer .upsell-note a {
    color: #e67e22;
    font-weight: bold;
}

.supplier-main-content h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--sage-green);
    display: inline-block;
    padding-bottom: 5px;
    color: var(--baltic-blue);
}

.supplier-main-content .entry-content {
    line-height: 1.8;
    color: #333;
    margin-top: 15px;
}

.featured-products {
    margin-top: 40px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.featured-products h4 {
    margin-top: 0;
    color: var(--baltic-blue);
}

.featured-products p {
    margin-bottom: 0;
    line-height: 1.6;
}

/* Single supplier page: mobile layout */
@media (max-width: 600px) {
    .supplier-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .supplier-logo {
        flex: 0 0 auto;
        width: 120px;
        margin-right: 0;
        margin-bottom: 16px;
    }

    .supplier-intro {
        min-width: unset;
        width: 100%;
    }

    .supplier-cta {
        text-align: center;
    }

    .supplier-cta small {
        display: block;
        margin-left: 0;
        margin-top: 6px;
    }
}

/* ===== Supplier Dashboard Form ===== */

/* Inline label+input row (logo field, website address) */
.supplier-form .form-group--inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.supplier-form .form-group--inline label {
    margin-bottom: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.supplier-form .form-group--inline input[type="file"],
.supplier-form .form-group--inline input[type="url"] {
    flex: 1;
    min-width: 0;
    width: auto;
}

/* Thumbnail preview above logo field */
.logo-preview {
    margin-bottom: 10px;
}

.logo-preview .logo-thumb {
    max-width: 80px;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.logo-preview p {
    margin: 4px 0 0;
}

/* Section headers in supplier form */
.form-section-header {
    margin-top: 24px;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

/* Submit row */
.form-submit-row {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Two-column supplier contact section */
.tgc-supplier-contact-cols {
    display: flex;
    gap: 20px;
    margin-bottom: 4px;
}

.tgc-supplier-contact-cols .tgc-form-col {
    flex: 1;
    min-width: 0;
}

.tgc-supplier-contact-cols .form-row {
    margin-bottom: 20px;
}

.tgc-supplier-contact-cols .form-row label {
    margin-bottom: 5px;
}

/* Form section separator */
.tgc-form-section-sep {
    border: 0;
    border-top: 1px solid hsla(205, 42%, 45%, 1);
    margin: 14px 0;
}

/* Single-line inline form rows (label left, control right) */
.tgc-form-row-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.tgc-form-row-inline>label {
    min-width: 148px;
    flex-shrink: 0;
    font-weight: bold;
    font-size: 0.9em;
    margin: 0;
}

.tgc-form-row-inline .tgc-inline-field {
    flex: 1;
    max-width: 440px;
}

.tgc-form-row-inline .tgc-inline-field input[type="text"],
.tgc-form-row-inline .tgc-inline-field input[type="email"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    box-sizing: border-box;
}

.tgc-form-row-inline small {
    display: block;
    margin-top: 3px;
    font-size: 0.8em;
    color: #666;
}

/* Services checkboxes */
.service-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 6px;
}

.service-checkboxes .check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: background 0.15s, border-color 0.15s;
}

.service-checkboxes .check-label:hover {
    border-color: var(--sage-green);
    background: #f4f9f0;
}

.service-checkboxes .check-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}