/*
 * GoGo Sourcing refined design system.
 * Loaded after the legacy theme styles so shared templates can migrate safely.
 */

:root {
    --wp-admin-bar-height: 0px;
    --canvas: #f4efe7;
    --surface: #fffdf9;
    --surface-2: #f7f0e8;
    --surface-3: #eadfd2;
    --ink: #2d2824;
    --ink-2: #625951;
    --ink-3: #756b63;
    --ink-4: #a59a91;
    --line: #e4dad0;
    --line-strong: #d2c4b7;
    --brand: #b04d36;
    --brand-hover: #9d432f;
    --brand-deep: #6f2e23;
    --brand-soft: #f3ddd3;
    --accent: #d69a56;
    --accent-600: #b6533c;
    --accent-700: #9d432f;
    --accent-tint: #fbede5;
    --accent-tint-2: #f3ddd3;
    --accent-bright: #e7b873;
    --night: #2c2420;
    --night-2: #3a302b;
    --night-line: rgba(255, 255, 255, 0.14);
    --white: #fffdf9;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow-sm: 0 1px 2px rgba(45, 40, 36, 0.05);
    --shadow: 0 14px 36px rgba(45, 40, 36, 0.09);
    --shadow-lg: 0 22px 54px rgba(45, 40, 36, 0.13);
    --radius: 6px;
    --radius-lg: 8px;
    --ease-standard: cubic-bezier(0.2, 0.75, 0.25, 1);
    --transition: 180ms var(--ease-standard);
}

html {
    font-size: 16px;
    scroll-padding-top: calc(84px + var(--wp-admin-bar-height));
}

body.admin-bar {
    --wp-admin-bar-height: 32px;
}

body {
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    letter-spacing: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--ink);
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.1;
}

h1 { font-size: 3.75rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.45rem; }
h4 { font-size: 1.05rem; }

p {
    color: var(--ink-2);
}

a {
    color: var(--brand);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--brand-hover);
}

::selection {
    background: var(--brand-soft);
    color: var(--brand-deep);
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.screen-reader-text {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.container {
    max-width: 1280px;
    padding-inline: 32px;
}

.section-padding {
    padding-block: 108px;
}

.section-padding-sm {
    padding-block: 48px;
}

.bg-light {
    background: var(--canvas);
}

.section-header {
    margin-bottom: 48px;
}

.section-label {
    color: var(--brand);
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0;
    margin-bottom: 14px;
    text-transform: none;
}

.section-title {
    margin-bottom: 16px;
}

.section-desc {
    color: var(--ink-2);
    font-size: 1.02rem;
    line-height: 1.65;
    max-width: 650px;
}

.text-center .section-desc,
.section-header.text-center .section-desc {
    margin-inline: auto;
}

/* Controls */
.btn {
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    gap: 9px;
    letter-spacing: 0;
    min-height: 46px;
    padding: 11px 20px;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
    transform: none;
}

.btn-primary,
.btn-gold,
.btn-dark {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--white);
}

.btn-primary:hover,
.btn-gold:hover,
.btn-dark:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    box-shadow: none;
    color: var(--white);
}

.btn-outline-dark {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-outline-dark:hover {
    background: var(--surface-2);
    border-color: var(--ink-3);
    color: var(--ink);
}

.btn-outline,
.btn-outline-light {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.52);
    color: var(--white);
}

.btn-outline:hover,
.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--white);
    color: var(--white);
}

.btn-lg {
    border-radius: 6px;
    font-size: 0.98rem;
    min-height: 52px;
    padding: 13px 24px;
}

.btn-sm {
    border-radius: 5px;
    min-height: 38px;
    padding: 8px 14px;
}

/* Header */
.top-bar {
    display: none;
}

.site-header {
    background: rgba(255, 253, 249, 0.96);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    position: sticky;
    top: var(--wp-admin-bar-height);
}

.site-header.scrolled {
    box-shadow: 0 8px 26px rgba(45, 40, 36, 0.07);
}

.header-inner {
    min-height: 78px;
}

.site-branding {
    padding: 0;
}

.site-logo {
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.14rem;
    font-weight: 600;
    gap: 10px;
    letter-spacing: 0;
}

.site-logo:hover {
    color: var(--ink);
}

.logo-icon {
    color: var(--brand);
    transition: color var(--transition), transform var(--transition);
}

.logo-highlight {
    color: var(--brand);
}

.site-logo:hover .logo-icon {
    color: var(--brand-hover);
    transform: translateY(-1px) rotate(-2deg);
}

.main-navigation .nav-menu {
    gap: 4px;
}

.nav-menu li a {
    border-radius: 4px;
    color: var(--ink-2);
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0;
    padding: 12px 10px;
}

.nav-menu li a:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.nav-menu li.current-menu-item > a,
.nav-menu li.current_page_item > a {
    color: var(--brand);
    font-weight: 600;
}

.header-actions {
    gap: 18px;
}

.header-quote {
    min-height: 44px;
    padding-inline: 18px;
}

.lang-switcher {
    align-items: center;
    border: 0;
    border-radius: 0;
    display: flex;
    gap: 12px;
    overflow: visible;
}

.lang-btn {
    background: transparent;
    border: 0;
    border-bottom: 1px solid transparent;
    color: var(--ink-3);
    font-size: 0.72rem;
    font-weight: 600;
    min-height: 30px;
    padding: 4px 0;
}

.lang-btn:hover {
    color: var(--ink);
}

.lang-btn.active {
    background: transparent;
    border-bottom-color: var(--ink);
    color: var(--ink);
}

.nav-menu .sub-menu {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: var(--shadow);
    min-width: 260px;
    padding: 8px;
}

.sub-menu li a {
    border-radius: 4px;
    padding: 10px 12px;
}

.mobile-menu-toggle {
    border: 0;
    border-radius: 4px;
    height: 44px;
    width: 44px;
}

.mobile-menu-toggle:hover {
    background: var(--surface-2);
}

.mobile-menu-toggle span {
    height: 1.5px;
    width: 23px;
}

/* Shared page surfaces */
.breadcrumbs {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

.breadcrumbs ol {
    font-size: 0.78rem;
}

.page-hero {
    background-color: var(--night);
    height: 320px;
}

.page-hero-lg {
    height: 390px;
}

.page-hero-overlay {
    background: rgba(44, 36, 32, 0.7);
}

.page-hero-content {
    align-items: flex-start;
    text-align: left;
}

.page-hero-content h1 {
    font-size: 3.25rem;
    max-width: 780px;
}

.page-hero-content p {
    font-size: 1rem;
    line-height: 1.65;
    max-width: 620px;
}

/* Flatten legacy component families while templates migrate. */
.service-card,
.why-card,
.tip-card,
.help-card,
.guarantee-card,
.yiwu-stat-card,
.catp-subcat-card,
.catp-why-card,
.catp-step,
.blog-card,
.case-card,
.video-card,
.post-cta,
.contact-form-wrapper,
.contact-info-card {
    border-radius: 6px;
    box-shadow: none;
}

.service-card:hover,
.why-card:hover,
.tip-card:hover,
.help-card:hover,
.guarantee-card:hover,
.yiwu-stat-card:hover,
.catp-subcat-card:hover,
.catp-why-card:hover,
.catp-step:hover,
.blog-card:hover,
.case-card:hover {
    box-shadow: none;
    transform: translateY(-2px);
}

.product-category-card,
.product-cat-card-large,
.product-item,
.catp-intro-img,
.catp-oem-img,
.post-featured-image,
.yiwu-overview-image,
.contact-map {
    border-radius: 5px;
}

.contact-form-wrapper {
    background: var(--surface);
    padding: 42px;
}

.contact-info-card {
    background: var(--brand-deep);
}

.form-group input,
.form-group select,
.form-group textarea,
.search-box input,
.filter-selects select {
    background: var(--surface);
    border-color: var(--line-strong);
    border-radius: 5px;
    color: var(--ink);
    min-height: 48px;
}

.form-group textarea {
    min-height: 150px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.search-box input:focus,
.filter-selects select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
    outline: 0;
}

.faq-grid {
    gap: 0;
    max-width: 900px;
}

.faq-item {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
}

.faq-item:first-child {
    border-top: 1px solid var(--line);
}

.faq-item:hover,
.faq-item.active {
    border-color: var(--line-strong);
}

.faq-question {
    color: var(--ink);
    font-size: 1rem;
    padding: 22px 4px;
}

.faq-question:hover {
    color: var(--brand);
}

.faq-answer p {
    max-width: 760px;
    padding: 0 40px 24px 4px;
}

.faq-icon {
    color: var(--ink-3);
    font-size: 1.2rem;
}

/* Footer */
.site-footer {
    background: var(--night);
    color: var(--white);
    padding: 82px 0 0;
}

.footer-lead {
    align-items: flex-end;
    border-bottom: 1px solid var(--night-line);
    display: grid;
    gap: 56px;
    grid-template-columns: 1fr 2fr;
    padding-bottom: 58px;
}

.footer-brand {
    align-items: center;
    color: var(--white);
    display: inline-flex;
    font-size: 1rem;
    font-weight: 600;
    gap: 10px;
}

.footer-brand:hover {
    color: var(--white);
}

.footer-brand-mark {
    color: var(--accent-bright);
    display: inline-flex;
}

.footer-lead-copy h2 {
    color: var(--white);
    font-size: 2.4rem;
    margin-bottom: 22px;
    max-width: 620px;
}

.footer-contact-link {
    align-items: center;
    color: rgba(255, 255, 255, 0.82);
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 600;
    gap: 10px;
}

.footer-contact-link:hover {
    color: var(--white);
}

.footer-contact-link svg {
    transition: transform var(--transition);
}

.footer-contact-link:hover svg {
    transform: translateX(3px);
}

.footer-grid {
    border-bottom: 1px solid var(--night-line);
    gap: 54px;
    grid-template-columns: 1.5fr 1fr 1.2fr 1.2fr;
    padding: 56px 0;
}

.footer-col h4 {
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.footer-about p,
.footer-col li,
.footer-col li a {
    color: rgba(255, 255, 255, 0.57);
    font-size: 0.84rem;
    line-height: 1.7;
}

.footer-col li a:hover {
    color: var(--white);
}

.footer-location {
    color: rgba(255, 255, 255, 0.82) !important;
    margin-top: 20px;
}

.footer-bottom {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 24px 0;
}

.footer-bottom p,
.footer-legal a {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.76rem;
}

.footer-legal {
    display: flex;
    gap: 20px;
}

.footer-legal a:hover {
    color: var(--white);
}

/* Consent and utility actions */
.cookie-consent {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    bottom: 20px;
    box-shadow: var(--shadow-lg);
    color: var(--ink);
    left: 20px;
    max-width: 560px;
    padding: 18px;
    right: auto;
}

.cookie-consent .container {
    padding: 0;
}

.cookie-inner {
    align-items: flex-end;
    gap: 18px;
}

.cookie-inner p {
    color: var(--ink-2);
    flex: 1;
    font-size: 0.82rem;
    line-height: 1.55;
}

.cookie-inner a {
    color: var(--brand);
}

.cookie-consent .btn-outline-light {
    border-color: var(--line-strong);
    color: var(--ink);
}

.cookie-consent .btn-outline-light:hover {
    background: var(--surface-2);
    border-color: var(--ink-3);
    color: var(--ink);
}

.whatsapp-float {
    bottom: 24px;
    right: 24px;
}

.whatsapp-float-link {
    background: #17864c;
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(20, 71, 47, 0.2);
    height: 52px;
    justify-content: center;
    padding: 0;
    width: 52px;
}

.whatsapp-float-link:hover {
    background: #116f3e;
    transform: translateY(-1px);
}

.whatsapp-icon {
    align-items: center;
    display: inline-flex;
}

.back-to-top {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 50%;
    bottom: 86px;
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    height: 44px;
    right: 28px;
    width: 44px;
}

/* Motion: content remains readable before and without JavaScript. */
html.js .fade-up,
html.js .fade-up.visible,
.fade-up {
    animation: none;
    opacity: 1;
    transform: none;
}

@media (max-width: 1180px) {
    .nav-menu li a {
        font-size: 0.8rem;
        padding-inline: 8px;
    }

    .header-actions {
        gap: 14px;
    }
}

@media (max-width: 1080px) {
    .header-inner {
        min-height: 72px;
    }

    .header-quote {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-navigation {
        background: var(--surface);
        border-top: 1px solid var(--line);
        box-shadow: 0 24px 46px rgba(45, 40, 36, 0.12);
        left: 0;
        max-height: calc(100svh - 72px - var(--wp-admin-bar-height));
        opacity: 0;
        overflow-y: auto;
        padding: 18px 24px 28px;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: calc(72px + var(--wp-admin-bar-height));
        transform: translateY(-12px);
        transition: opacity var(--transition), transform var(--transition);
        visibility: hidden;
    }

    .main-navigation.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        visibility: visible;
    }

    .main-navigation .nav-menu {
        align-items: stretch;
        flex-direction: column;
        gap: 0;
    }

    .main-navigation .nav-menu > li {
        border-bottom: 1px solid var(--line);
        position: relative;
    }

    .main-navigation .nav-menu li a {
        border-radius: 0;
        color: var(--ink);
        font-size: 1rem;
        padding: 15px 44px 15px 0;
    }

    .main-navigation .nav-menu li.menu-item-has-children > a::after {
        display: none;
    }

    .submenu-toggle {
        align-items: center;
        background: transparent;
        border: 0;
        color: var(--ink);
        display: flex;
        height: 48px;
        justify-content: center;
        position: absolute;
        right: 0;
        top: 0;
        width: 44px;
    }

    .submenu-toggle span {
        transition: transform var(--transition);
    }

    .menu-item-has-children.active > .submenu-toggle span {
        transform: rotate(180deg);
    }

    .nav-menu .sub-menu {
        border: 0;
        border-left: 1px solid var(--line);
        border-radius: 0;
        box-shadow: none;
        display: none;
        margin: 0 0 14px 2px;
        min-width: 0;
        opacity: 1;
        padding: 0 0 0 18px;
        position: static;
        transform: none;
        visibility: visible;
    }

    .nav-menu li.menu-item-has-children.active > .sub-menu {
        display: block;
    }

    .sub-menu li a {
        color: var(--ink-2) !important;
        font-size: 0.9rem !important;
        padding: 9px 0 !important;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.3rem; }

    .container {
        padding-inline: 20px;
    }

    .section-padding {
        padding-block: 76px;
    }

    .section-header {
        margin-bottom: 36px;
    }

    .header-inner {
        min-height: 68px;
    }

    .site-logo {
        font-size: 1rem;
    }

    .logo-icon svg {
        height: 23px;
        width: 23px;
    }

    .header-actions {
        gap: 12px;
    }

    .lang-switcher {
        gap: 9px;
    }

    .lang-btn {
        font-size: 0.68rem;
    }

    .main-navigation {
        max-height: calc(100svh - 68px - var(--wp-admin-bar-height));
        top: calc(68px + var(--wp-admin-bar-height));
    }

    .page-hero,
    .page-hero-lg {
        height: 300px;
    }

    .page-hero-content h1 {
        font-size: 2.35rem;
    }

    .contact-form-wrapper {
        padding: 26px 20px;
    }

    .footer-lead {
        align-items: start;
        gap: 30px;
        grid-template-columns: 1fr;
        padding-bottom: 44px;
    }

    .footer-lead-copy h2 {
        font-size: 2rem;
    }

    .footer-grid {
        gap: 36px 24px;
        grid-template-columns: 1fr 1fr;
        padding: 44px 0;
    }

    .footer-about {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .cookie-consent {
        bottom: 12px;
        left: 12px;
        max-width: calc(100% - 24px);
        padding: 16px;
        right: 12px;
    }

    .cookie-inner {
        align-items: stretch;
        padding: 0;
    }

    .cookie-btns {
        justify-content: flex-start;
    }

    .whatsapp-float {
        bottom: 18px;
        right: 18px;
    }

    .back-to-top {
        bottom: 82px;
        right: 22px;
    }
}

@media (max-width: 782px) {
    body.admin-bar {
        --wp-admin-bar-height: 46px;
    }
}

@media (max-width: 520px) {
    .site-logo {
        gap: 7px;
    }

    .header-actions {
        gap: 8px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-about {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
