/*
Theme Name: Multi-Country Watch Repair Directory
Author: chronodirectory.com
Author URI: https://chronodirectory.com
Description: A multi-region directory theme for watch repair shops.
Version: 1.1.0
*/

/* --- Core Variables --- */
:root {
   --primary-color: #1a237e;
   --secondary-color: #5c6bc0;
   --background-color: #f5f5f5;
   --accent-color: #ffc107;
   --text-color: #333;
   --white-color: #fff;
   --border-radius: 8px;
   --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* --- Global Styles & Typography --- */
body {
   font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
   line-height: 1.6;
   color: var(--text-color);
   background-color: var(--background-color);
   margin: 0;
   padding: 0;
   /* padding-top: 100px; */ /* Adjust this value based on the actual height of your header */
}

.container {
   max-width: 1200px;
   margin: 0 auto;
   padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
   color: var(--primary-color);
   line-height: 1.2;
}

a {
   color: var(--secondary-color);
   text-decoration: none;
   transition: color 0.3s ease;
}

a:hover {
   color: var(--primary-color);
}

img {
   max-width: 100%;
   height: auto;
}

/* --- Header --- */
.site-header {
   background-color: var(--white-color);
   box-shadow: var(--box-shadow);
   padding: 0.25rem 0; /* Further reduced padding */
   position: sticky;
   top: 0;
   z-index: 1020;
   width: 100%;
   transition: padding 0.3s ease;
}

.site-header.header-scrolled {
   padding-top: 0.25rem;
   padding-bottom: 0.25rem;
   box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.site-header > .container {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 1rem;
}

.site-branding {
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.site-branding img {
   max-height: 55px; /* Increased logo size */
   transition: max-height 0.3s ease;
}

.header-scrolled .site-branding img {
    max-height: 45px; /* Adjusted scrolled logo size */
}

.main-navigation {
   display: flex;
   align-items: center;
   gap: 1.5rem;
}

.main-navigation ul {
   margin: 0;
   padding: 0;
   list-style: none;
   display: flex;
   gap: 1.5rem;
}

.country-selector select,
.city-search-form select {
   padding: 0.5rem;
   border: 1px solid #ccc;
   border-radius: var(--border-radius);
   background-color: var(--white-color);
}

/* --- Hero Section --- */
.hero-section {
   min-height: 500px; /* Adjusted from 800px for better balance */
   background-size: cover;
   background-position: center;
   display: flex;
   align-items: center;
   justify-content: center;
   text-align: center;
   color: var(--white-color);
   position: relative;
}

.hero-section::before {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: rgba(0, 0, 0, 0.5);
}

.hero-content {
   position: relative;
   z-index: 1;
   padding: 0 20px; /* Add horizontal padding to prevent text from touching screen edges */
}

.hero-content h1,
.hero-content h2,
.hero-content p {
    color: var(--white-color);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}

.hero-content h1 {
   font-size: 3rem;
   margin-bottom: 0.5rem;
}

.hero-content h2 {
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.4;
    max-width: 800px; /* Constrain width for better readability */
    margin: 1rem auto 0 auto;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.parallax-hero {
   min-height: 800px;
   background-attachment: fixed;
   background-position: center;
   background-repeat: no-repeat;
   background-size: cover;
}

/* --- Card Layouts --- */
.card-layout,
.card-layout-2-columns,
.card-layout-3-columns,
.card-layout-4-columns {
   display: grid;
   gap: 20px;
   margin-top: 20px;
}

.card-layout-2-columns { grid-template-columns: repeat(auto-fill, minmax(45%, 1fr)); }
.card-layout-3-columns { grid-template-columns: repeat(auto-fill, minmax(30%, 1fr)); }
.card-layout-4-columns { grid-template-columns: repeat(auto-fill, minmax(22%, 1fr)); }

.popular-listings-section .card-layout {
   grid-template-columns: repeat(auto-fill, minmax(22%, 1fr));
}

.card {
   background: var(--white-color);
   border-radius: var(--border-radius);
   box-shadow: var(--box-shadow);
   overflow: hidden;
   transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
   transform: translateY(-5px);
   box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.card a {
   display: block;
   padding: 20px;
}

.card .card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.card h4 {
   margin-top: 0;
   margin-bottom: 10px;
}

/* --- Sections --- */
.search-by-city-section,
.browse-by-region-section,
.popular-listings-section,
.latest-articles-section {
   padding: 40px 0;
   border-bottom: 1px solid #eee;
}

.city-search-form {
   display: flex;
   gap: 1rem;
   margin-top: 1rem;
}

/* --- Footer --- */
.site-footer {
   background-color: var(--primary-color);
   color: var(--white-color);
   text-align: center;
   padding: 2rem;
   margin-top: 40px;
}

.site-footer a {
   color: var(--accent-color);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .site-header > .container {
        flex-direction: column;
        align-items: stretch; /* Stretch items to full width */
        gap: 0.5rem; /* Reduced gap */
    }

    .site-branding {
        text-align: center; /* Center the logo */
        padding: 0.1rem 0; /* Reduced padding */
    }

    .header-center {
        display: none;
    }

    .header-right {
        order: 2;
        width: 100%; /* Ensure it takes full width on mobile */
    }

    .header-interactive-elements {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        transition: max-height 0.5s ease-in-out, opacity 0.3s ease, visibility 0.3s;
        max-height: 100px; /* Set a large enough max-height for the content */
        opacity: 1;
        visibility: visible;
        overflow: hidden;
    }

    .header-interactive-elements.hidden-on-scroll {
        display: none;
    }

    .header-search {
        flex-grow: 1;
    }

    .main-navigation {
        flex-shrink: 0;
    }

    .current-country {
        padding: 0.6rem;
    }
 
   /* Removed rule that was hiding the modal content container */
 
   .hero-content h1 {
       font-size: 2rem;
   }
 
   .hero-content h2 {
       font-size: 1.1rem;
       line-height: 1.5;
   }

   .popular-listings-section .card-layout, /* More specific selector for homepage */
   .card-layout-2-columns,
   .card-layout-3-columns,
   .card-layout-4-columns {
       grid-template-columns: 1fr;
   }

   .city-search-form {
       flex-direction: column;
   }
}

/* --- Country Selector (Dropdown) --- */
.country-selector-wrapper {
    display: flex;
    align-items: center;
}

.selector-label {
    margin-right: 8px;
    font-size: 0.9em;
    color: #555;
    white-space: nowrap;
}

.country-selector {
    position: relative;
    display: inline-block;
}

.current-country {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem; /* Larger font size */
    transition: background-color 0.3s ease;
}

.current-country:hover {
    background-color: #e0e0e0;
}

.country-flag {
    width: 30px; /* Larger flag */
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Dropdown styles removed as it's no longer in use */

/* --- Header Layout --- */
.header-center {
    flex-grow: 1;
    text-align: center;
}

.site-title {
    margin: 0;
    font-size: 1.75rem; /* Adjust size as needed */
    font-weight: bold;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: flex-end;
}

.header-interactive-elements {
    display: contents; /* On desktop, make this a non-visual wrapper */
}

.site-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.header-search .search-form {
    position: relative;
    display: flex;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--white-color);
}

.header-search .search-field {
    border: none;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    width: 300px; /* Default desktop width */
    color: var(--text-color);
    transition: width 0.3s ease;
}

.header-search .search-submit {
    background-color: var(--secondary-color);
    border: none;
    color: var(--white-color);
    padding: 0 1.25rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon {
    color: var(--white-color);
}

.header-search .search-submit:hover {
    background-color: var(--primary-color);
}

/* Redundant header layout adjustments removed */

/* --- Star Rating --- */
.star-rating {
    color: var(--accent-color);
    font-size: 1.2rem;
    display: inline-block;
}

.star-rating .star {
    display: inline-block;
}

.star-rating .half-star {
    position: relative;
    display: inline-block;
    width: 0.6em; /* Half the width of a full star */
    overflow: hidden;
    color: var(--accent-color);
}

.star-rating .half-star::before {
    content: '★';
    position: absolute;
    left: 0;
}

.star-rating .empty-star {
    color: #ccc;
}

/* --- Shop Card Enhancements --- */
.card.shop-card a {
    padding: 0; /* Remove padding from the link to allow content to fill it */
}

.card .card-content {
    padding: 20px;
}

.card .address {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.customer-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: bold;
}

.customer-rating .rating-text {
    font-size: 0.9rem;
    color: #555;
    font-weight: normal;
}

.review-topics {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.review-topics h5 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: var(--primary-color);
}

.review-topics .topics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.review-topics .topic-tag {
    background-color: #eef2f7;
    color: #5c6bc0;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* --- Button Styles --- */
.button,
.view-on-map-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--secondary-color);
    color: var(--white-color);
    text-align: center;
    border-radius: var(--border-radius);
    font-weight: bold;
    transition: background-color 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.button:hover,
.view-on-map-btn:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.card-footer {
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    text-align: right;
}

/* --- Country Selector Modal (Mobile) --- */
.country-modal {
   display: none; /* Hidden by default */
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   z-index: 2000;
}

.country-modal-overlay {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(0, 0, 0, 0.6);
}

.country-modal-content {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   background: var(--white-color);
   padding: 2rem;
   border-radius: var(--border-radius);
   width: 90%;
   max-width: 500px;
   max-height: 80vh;
   overflow-y: auto;
}

.country-modal-close {
   position: absolute;
   top: 1rem;
   right: 1rem;
   background: none;
   border: none;
   font-size: 2rem;
   line-height: 1;
   cursor: pointer;
   color: #aaa;
}

.country-modal-close:hover {
   color: #333;
}

.country-modal-content h4 {
   margin-top: 0;
   margin-bottom: 1.5rem;
   text-align: center;
}

.country-modal-list {
   list-style: none;
   padding: 0;
   margin: 0;
}

.country-modal-list li a {
   display: flex;
   align-items: center;
   gap: 1rem;
   padding: 1rem;
   border-radius: var(--border-radius);
   transition: background-color 0.2s ease;
}

.country-modal-list li a:hover {
   background-color: #f5f5f5;
}

/* Show modal when body has .modal-open class */
body.modal-open .country-modal {
   display: block;
}

/* Responsive logic for selector is now unified to modal-only */
/* The media queries for hiding/showing dropdown vs modal are no longer needed */

/* --- Back to Parent Link --- */
.back-to-parent-link {
    display: inline-block;
    padding: 12px 24px;
    margin-bottom: 20px;
    background-color: var(--secondary-color);
    color: var(--white-color);
    border: none;
    border-radius: var(--border-radius);
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.back-to-parent-link:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* --- Footer Overhaul --- */
.site-footer {
    padding: 2rem 0;
    background-color: var(--primary-color);
    color: var(--white-color);
    border-top: 1px solid #eee;
}

.site-footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 20px;
}

.footer-left, .footer-center, .footer-right {
    text-align: center;
}

.footer-left {
    flex: 1;
    text-align: left;
    font-size: 0.9rem;
    color: #ccc; /* Lighter text color for dark background */
}

.footer-left a {
    color: var(--accent-color); /* Accent color for the link */
}

.footer-center {
    display: none; /* Hide the standalone separator on larger screens */
}

.footer-right {
    flex: 2;
    text-align: right;
}

.footer-right a {
    color: var(--white-color);
    text-decoration: none;
    margin: 0 8px;
    font-size: 0.9rem;
}

.footer-right a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

.footer-right .footer-link-separator {
    color: #ccc;
}

/* Responsive Footer */
@media (max-width: 992px) {
    .site-footer-container {
        flex-direction: column;
        gap: 15px;
    }

    .footer-left, .footer-right {
        text-align: center;
        flex-basis: 100%;
    }

    .footer-center {
        display: none; /* Always hide this */
    }
    
    .footer-right {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .footer-right .footer-link-separator {
        display: none; /* Hide separators on mobile */
    }
}

/* --- Country Selector Modal Enhancements --- */
.country-modal-list {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap to the next line */
    gap: 1rem; /* Add some space between items */
    justify-content: flex-start; /* Align items to the start */
}

.country-modal-list li {
    flex-basis: calc(33.333% - 1rem); /* Aim for 3 items per row, adjusting for gap */
    min-width: 120px; /* Minimum width for smaller containers */
}

.country-modal-list li a {
    justify-content: flex-start; /* Align content within the link */
}

/* --- Single Post Styles --- */
.post-thumbnail {
    margin-bottom: 2rem;
    text-align: center;
}

.post-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.entry-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* --- Comments Area --- */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.comments-title {
    margin-bottom: 2rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    margin-bottom: 2rem;
}

.comment-body {
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    position: relative;
    background: var(--white-color);
}

.comment-author {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.comment-author .avatar {
    border-radius: 50%;
    margin-right: 1rem;
}

.comment-author .fn {
    font-weight: bold;
    font-style: normal;
    color: var(--primary-color);
}

.comment-meta {
    font-size: 0.85rem;
    color: #777;
}

.comment-content {
    clear: both;
}

.reply {
    margin-top: 1rem;
}

.reply .comment-reply-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--secondary-color);
    color: var(--white-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.reply .comment-reply-link:hover {
    background-color: var(--primary-color);
}

/* --- Comment Form --- */
.comment-respond {
    margin-top: 2rem;
    /* Remove card-like background to match new design */
}

.comment-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.comment-form-comment,
.comment-form-url,
.comment-form-cookies-consent,
.form-submit,
.comment-notes {
    width: 100%;
}

.comment-form-author,
.comment-form-email {
    width: calc(50% - 1rem);
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    background-color: #f9f9f9;
    box-sizing: border-box; /* Add this */
}

.comment-form .form-submit .submit {
    display: inline-block;
    padding: 12px 24px;
    background-color: #4CAF50; /* Green background */
    color: var(--white-color);
    text-align: center;
    border-radius: var(--border-radius);
    font-weight: bold;
    transition: background-color 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.comment-form .form-submit .submit:hover {
    background-color: #45a049; /* Darker green on hover */
}

/*--------------------------------------------------------------
## Shop Card Location Info
--------------------------------------------------------------*/
.shop-card .location-info {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.shop-card .location-info a {
    color: #4a5568;
    text-decoration: none;
}

.shop-card .location-info a:hover {
    text-decoration: underline;
}

.shop-card .location-info .separator {
    margin: 0 5px;
    color: #ccc;
}

/*--------------------------------------------------------------
## Footer Menu
--------------------------------------------------------------*/
.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.footer-menu li {
    margin: 0;
    padding: 0 10px;
}

.footer-menu li a {
    text-decoration: none;
    color: inherit;
}

.footer-menu li:not(:last-child)::after {
    content: '|';
    margin-left: 20px;
    color: #666;
    display: inline-block;
    transform: translateX(-5px);
}

/* --- Narrow Mobile Header Stack --- */
@media (max-width: 768px) {
    .header-search .search-form .search-field {
        width: 100%; /* Full width on tablet */
    }
}

@media (max-width: 500px) {
    /* The 768px media query already handles the layout well.
       This section is for fine-tuning the search bar interaction on very small screens. */
    .header-search .search-form:not(.active) {
        justify-content: center;
    }

    .header-search .search-form .search-field {
        width: 0;
        padding: 0.6rem 0;
        border-right: none;
    }

    .header-search .search-form.active .search-field {
        width: 100%;
        padding: 0.6rem 1rem;
    }

    .header-search .search-submit {
        background-color: var(--secondary-color); /* Default background color */
        color: var(--white-color);
        padding: 0.6rem; /* Make it squarer */
        border-radius: var(--border-radius);
    }
    
    .header-search .search-form:not(.active) .search-submit {
         color: var(--white-color);
    }
    
    .header-search .search-form.active .search-submit {
        background-color: var(--secondary-color);
        color: var(--white-color);
    }
}