/*
Theme Name: Makita 2026
Theme URI: https://staging.makita.com.hk
Author: Makita Hong Kong + Grok Expert
Description: Makita 香港官方網站 — parent theme for seasonal child themes. Business logic in Makita Core plugin.
Version: 1.1
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.2
Text Domain: makita-2026
*/

:root {
    --makita-teal: #008a97;
    --makita-teal-dark: #017681;
    --makita-red: #ed1c24;
}

/* Site header — legacy makita.com.hk teal navbar */
.makita-site-header {
    font-family: inherit;
}

.makita-header-search-input {
    width: 100%;
    max-width: 18rem;
    height: 2.375rem;
    border: none;
    border-radius: 0.25rem;
    background: #fff;
    color: #111;
    padding: 0.5rem 2.75rem 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.makita-header-search-input::placeholder {
    color: #6b7280;
    opacity: 0.85;
}

.makita-header-search-input:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 1px;
}

.makita-header-search-btn {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
}

.makita-header-search-btn:hover {
    color: var(--makita-teal);
}

.makita-header-lang {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.makita-header-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.375rem;
    height: 2.375rem;
    padding: 0 0.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
    background-color: var(--makita-teal-dark);
    color: #43a0a9;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.makita-header-lang-btn:hover,
.makita-header-lang-btn.is-active {
    background-color: #fff;
    color: var(--makita-red);
}

.makita-header-nav-link {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}

.makita-header-nav-link:hover {
    opacity: 0.88;
}

.makita-header-social {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.makita-header-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    color: #fff;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.makita-header-social-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

@media (min-width: 1024px) {
    .makita-header-search-input {
        width: 11rem;
        max-width: none;
    }
}

@media (min-width: 1280px) {
    .makita-header-search-input {
        width: 14rem;
    }
}

/* Dealers store locator */
.makita-dealer-filter {
    min-width: 10rem;
    max-width: 100%;
    border: 1px solid var(--makita-teal);
    background: var(--makita-teal);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border-radius: 0.25rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23fff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
}

.makita-dealer-filter:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.makita-dealers-map-section {
    background: #fff;
}

/* Map block with overlaid dealer list (legacy makita.com.hk layout) */
.makita-dealers-map-container {
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    height: 320px;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
    background: #e5e7eb;
}

@media (min-width: 640px) {
    .makita-dealers-map-container {
        height: 440px;
    }
}

@media (min-width: 1024px) {
    .makita-dealers-map-container {
        height: 520px;
    }
}

.makita-dealers-map-container .makita-dealers-map {
    position: relative;
    flex: 1;
    min-height: 0;
    z-index: 1;
    width: 100%;
}

.makita-dealers-panel {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    max-height: 200px;
    flex-shrink: 0;
}

.makita-dealers-panel__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    pointer-events: auto;
}

.makita-dealers-panel__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: #fff;
    opacity: 0.82;
}

@media (min-width: 768px) {
    .makita-dealers-map-container {
        display: block;
    }

    .makita-dealers-map-container .makita-dealers-map {
        position: absolute;
        inset: 0;
    }

    .makita-dealers-panel {
        position: absolute;
        top: 3.5rem;
        bottom: 2.5rem;
        left: 0;
        right: auto;
        max-width: min(390px, 42%);
        max-height: none;
        width: 100%;
        pointer-events: none;
    }

    .makita-dealers-panel__bg {
        opacity: 0.8;
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.08);
    }
}

.makita-dealers-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 0.75rem 1rem 0.75rem 1.25rem;
    -webkit-overflow-scrolling: touch;
}

.makita-dealer-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1rem 0 0.65rem;
    border: none;
    border-top: 2px solid #dadada;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.makita-dealer-item:first-child {
    border-top: none;
    padding-top: 0.35rem;
}

.makita-dealer-item:hover,
.makita-dealer-item.is-active {
    background: rgba(240, 253, 254, 0.65);
}

.makita-dealer-item__title {
    display: block;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #008a97;
    line-height: 1.35;
    margin-bottom: 0.35rem;
}

.makita-dealer-item__address,
.makita-dealer-item__tel {
    display: block;
    font-size: 0.8125rem;
    color: #515151;
    line-height: 1.45;
}

.makita-dealer-item__address {
    margin-bottom: 0.2rem;
}

.makita-dealers-empty {
    padding: 2rem 1.25rem;
    font-size: 1.0625rem;
    font-weight: 700;
    text-align: center;
    color: #008a97;
}

.makita-dealer-pin-wrap {
    background: transparent;
    border: none;
}

.makita-dealer-pin {
    display: block;
    width: 22px;
    height: 22px;
    background: var(--makita-teal);
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    margin: 0 auto;
}

.makita-dealer-popup strong {
    color: var(--makita-teal);
}

/* Polylang language switcher (header + footer) */
.makita-lang-switcher,
.makita-lang-switcher ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.makita-lang-switcher li {
    display: inline-flex;
    align-items: center;
}

.makita-lang-switcher li + li::before {
    content: "|";
    margin-right: 0.75rem;
    color: #d1d5db;
    font-weight: 400;
}

.makita-lang-switcher a {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.15s ease;
}

.makita-lang-switcher a:hover {
    color: var(--makita-teal);
}

.makita-lang-switcher .current-lang a,
.makita-lang-switcher li.current-lang a {
    color: var(--makita-teal);
    font-weight: 600;
    pointer-events: none;
}

footer .makita-lang-switcher a {
    color: rgba(255, 255, 255, 0.85);
}

footer .makita-lang-switcher a:hover,
footer .makita-lang-switcher .current-lang a,
footer .makita-lang-switcher li.current-lang a {
    color: #fff;
}

/* Product list pagination — horizontal row (Tailwind resets can stack <li>) */
.makita-pagination .page-numbers {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.makita-pagination .page-numbers li {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0;
    list-style: none;
}
.makita-pagination .page-numbers a,
.makita-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.makita-pagination .page-numbers a:hover {
    color: var(--makita-teal);
    border-color: var(--makita-teal);
    background: #f0fdfe;
}
.makita-pagination .page-numbers span.current {
    color: #fff;
    background: var(--makita-teal);
    border-color: var(--makita-teal);
}
.makita-pagination .page-numbers span.dots {
    min-width: auto;
    border: none;
    background: transparent;
    color: #9ca3af;
}

/* PDP gallery — stacked slides (full viewport, centered product image) */
[data-carousel-viewport] [data-carousel-slide] {
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}
[data-carousel-viewport] [data-carousel-slide][data-active="true"] {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}
[data-carousel-viewport] [data-carousel-slide] img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
}

.makita-pdp-thumbs-scroll {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.makita-pdp-thumbs-scroll::-webkit-scrollbar {
    height: 6px;
}
.makita-pdp-thumbs-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}
[data-carousel-thumbs-wrap] [data-carousel-thumb][data-active="true"] {
    --tw-ring-color: var(--makita-teal);
    box-shadow: 0 0 0 2px var(--makita-teal);
}

/* PDP — mobile layout */
.makita-pdp {
    max-width: 100%;
}

.makita-pdp-spec-scroll {
    -webkit-overflow-scrolling: touch;
}

.makita-pdp-spec-table th,
.makita-pdp-spec-table td {
    word-break: break-word;
}

@media (max-width: 639px) {
    .makita-pdp-spec-table {
        min-width: 300px;
    }

    .makita-pdp-spec-table th,
    .makita-pdp-spec-table td {
        padding: 0.65rem 0.75rem;
        font-size: 0.8125rem;
    }

    .makita-pdp-spec-table th[scope="col"]:first-child,
    .makita-pdp-spec-table th[scope="row"] {
        width: 38%;
    }

    .makita-pdp .prose {
        font-size: 0.875rem;
    }

    .makita-pdp .prose img,
    .makita-pdp .prose table {
        max-width: 100%;
        height: auto;
    }

    [data-carousel-thumbs-wrap] {
        gap: 0.25rem;
    }

    [data-carousel-thumbs-wrap] [data-carousel-thumb] {
        width: 4.5rem;
        height: 3.5rem;
    }
}

/* Contact page — Leaflet fills map container; pin moves with pan/zoom */
.makita-contact-map #makita-contact-map,
.makita-contact-map #makita-contact-map.leaflet-container {
    height: 100%;
    width: 100%;
    min-height: 280px;
}

/* Header — My Makita account */
.makita-header-account-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.makita-header-account-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: #fff;
    color: #fff;
}

.makita-header-account-link--mobile {
    display: flex;
}

/* Membership auth forms */
.makita-auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.makita-auth-input {
    display: block;
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 0.65rem 0.85rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.makita-auth-input:focus {
    outline: none;
    border-color: var(--makita-teal);
    box-shadow: 0 0 0 3px rgba(0, 138, 151, 0.15);
}

.makita-auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: var(--makita-teal);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.makita-auth-submit:hover {
    background: #006d7a;
}

/* Ultimate Member — theme overrides when plugin is installed */
.makita-um-wrap .um-form {
    max-width: 28rem;
    margin: 0 auto;
}

.makita-um-wrap .um-button,
.makita-um-wrap .um input[type=submit].um-button {
    background: var(--makita-teal) !important;
    border-radius: 0.75rem !important;
}

.makita-um-wrap .um-button:hover,
.makita-um-wrap .um input[type=submit].um-button:hover {
    background: #006d7a !important;
}