:root {
    --tsnse-bg: #f6f8fa;
    --tsnse-surface: #ffffff;
    --tsnse-text: #17202a;
    --tsnse-muted: #57606a;
    --tsnse-border: #d8dee4;
    --tsnse-primary: #0f6b4f;
    --tsnse-primary-dark: #0a4f3b;
    --tsnse-accent: #1f6feb;
    --tsnse-warning: #b76e00;
    --tsnse-radius: 8px;
    --tsnse-container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--tsnse-bg);
    color: var(--tsnse-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
}

a {
    color: var(--tsnse-primary);
}

a:hover,
a:focus {
    color: var(--tsnse-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

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

.skip-link:focus {
    top: 12px;
    left: 12px;
    z-index: 1000;
    width: auto;
    height: auto;
    margin: 0;
    padding: 10px 14px;
    clip: auto;
    background: var(--tsnse-surface);
    border: 1px solid var(--tsnse-border);
    border-radius: var(--tsnse-radius);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--tsnse-border);
    backdrop-filter: blur(10px);
}

.site-header__inner,
.site-footer__inner,
.content-wrap {
    width: min(100% - 32px, var(--tsnse-container));
    margin: 0 auto;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    gap: 24px;
}

.site-branding {
    min-width: 180px;
}

.site-title {
    color: var(--tsnse-text);
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
}

.site-description {
    margin: 2px 0 0;
    color: var(--tsnse-muted);
    font-size: 13px;
}

.custom-logo {
    display: block;
    max-height: 54px;
    width: auto;
}

.main-navigation {
    display: flex;
    align-items: center;
}

.primary-menu,
.footer-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-menu li {
    position: relative;
}

.primary-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--tsnse-text);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.primary-menu a:hover,
.primary-menu a:focus {
    background: #edf7f3;
    color: var(--tsnse-primary-dark);
}

.primary-menu .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    min-width: 220px;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: var(--tsnse-surface);
    border: 1px solid var(--tsnse-border);
    border-radius: var(--tsnse-radius);
    box-shadow: 0 16px 40px rgba(23, 32, 42, 0.12);
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
    display: block;
}

.primary-menu .sub-menu a {
    white-space: nowrap;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--tsnse-border);
    border-radius: 6px;
    background: var(--tsnse-surface);
    cursor: pointer;
}

.menu-toggle span:not(.screen-reader-text) {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: var(--tsnse-text);
}

.site-main {
    min-height: 70vh;
}

.content-wrap {
    padding: 32px 0 48px;
}

.content-wrap--narrow {
    max-width: 820px;
}

.content-wrap--full,
.content-wrap--page {
    width: min(100% - 24px, 1240px);
}

.entry-card,
.page-content,
.archive-header,
.woocommerce .site-main .content-wrap {
    background: var(--tsnse-surface);
    border: 1px solid var(--tsnse-border);
    border-radius: var(--tsnse-radius);
    padding: 24px;
}

.page-content {
    background: transparent;
    border: 0;
    padding: 0;
}

.entry-title,
.page-header h1,
.archive-header h1,
.entry-content h1 {
    margin-top: 0;
    color: var(--tsnse-text);
    line-height: 1.1;
}

.entry-title a {
    color: inherit;
    text-decoration: none;
}

.entry-meta {
    color: var(--tsnse-muted);
    font-size: 14px;
}

.entry-content {
    overflow-wrap: break-word;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.button-link,
.wp-block-button__link,
.search-submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.tsnse-estimator__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--tsnse-primary);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button-link:hover,
.wp-block-button__link:hover,
.search-submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.tsnse-estimator__button:hover {
    background: var(--tsnse-primary-dark);
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="number"],
input[type="password"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--tsnse-border);
    border-radius: 6px;
    background: #fff;
    color: var(--tsnse-text);
}

textarea {
    min-height: 110px;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form label {
    flex: 1;
}

.site-footer {
    background: #111827;
    color: #f9fafb;
}

.site-footer__inner {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 0;
}

.site-footer p {
    margin: 6px 0 0;
    color: #c9d1d9;
}

.footer-menu {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.footer-menu a {
    color: #f9fafb;
    text-decoration: none;
}

.footer-menu a:hover,
.footer-menu a:focus {
    color: #b7f7dc;
}

.tsnse-v1,
.tsnse-material-estimator,
.tsnse-estimator,
.woocommerce {
    color: var(--tsnse-text);
}

.tsnse-v1 .tsnse-v1-card,
.tsnse-estimator__panel,
.tsnse-estimator__form {
    box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    background: var(--tsnse-surface);
    border: 1px solid var(--tsnse-border);
    border-radius: var(--tsnse-radius);
    padding: 14px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    border-radius: 6px 6px 0 0;
}

.woocommerce table.shop_table {
    border-radius: var(--tsnse-radius);
    overflow: hidden;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    border-top-color: var(--tsnse-primary);
}

.market-hero {
    background-color: #12362d;
    background-image: url("../images/hero-marketplace.png");
    background-position: center;
    background-size: cover;
    color: #fff;
}

.market-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    width: min(100% - 32px, var(--tsnse-container));
    margin: 0 auto;
    padding: 72px 0;
}

.market-eyebrow {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.market-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(42px, 7vw, 74px);
    line-height: 0.98;
}

.market-hero p:not(.market-eyebrow) {
    max-width: 650px;
    color: #e8fff6;
    font-size: 18px;
}

.market-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.button-link--secondary {
    background: var(--tsnse-accent);
}

.button-link--secondary:hover,
.button-link--secondary:focus {
    background: #185abc;
}

.button-link--light {
    background: #fff;
    color: var(--tsnse-primary-dark) !important;
}

.button-link--light:hover,
.button-link--light:focus {
    background: #e8fff6;
}

.market-search {
    align-self: start;
    padding: 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: var(--tsnse-radius);
    color: var(--tsnse-text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

.market-search h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

.market-search label {
    display: block;
    margin-bottom: 12px;
    color: var(--tsnse-muted);
    font-size: 14px;
    font-weight: 700;
}

.market-search input,
.market-search select {
    margin-top: 6px;
}

.market-search .search-submit {
    width: 100%;
    margin-top: 6px;
}

.market-section {
    padding: 52px 0;
}

.market-section--surface {
    background: #eef4f1;
}

.market-section__inner {
    padding: 0;
}

.market-section__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.market-section h2,
.estimator-cta h2 {
    margin: 0;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.06;
}

.category-grid,
.supplier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.category-card {
    min-height: 116px;
    display: flex;
    align-items: end;
    padding: 18px;
    background: var(--tsnse-surface);
    border: 1px solid var(--tsnse-border);
    border-radius: var(--tsnse-radius);
    color: var(--tsnse-text);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
}

.category-card span {
    font-size: 20px;
    font-weight: 800;
}

.category-card:hover,
.category-card:focus {
    border-color: var(--tsnse-primary);
    color: var(--tsnse-primary-dark);
    transform: translateY(-1px);
}

.supplier-card {
    padding: 20px;
    background: var(--tsnse-surface);
    border: 1px solid var(--tsnse-border);
    border-radius: var(--tsnse-radius);
    box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
}

.supplier-card h3 {
    margin: 0 0 14px;
    font-size: 22px;
}

.supplier-card dl {
    margin: 0 0 18px;
}

.supplier-card dt {
    color: var(--tsnse-muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.supplier-card dd {
    margin: 3px 0 12px;
}

.estimator-cta {
    padding: 46px 0;
    background: #101828;
    color: #fff;
}

.estimator-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0;
}

.estimator-cta .market-eyebrow {
    color: #b7f7dc;
}

@media (max-width: 860px) {
    .site-header__inner {
        min-height: 66px;
    }

    .menu-toggle {
        display: block;
    }

    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        padding: 8px 16px 16px;
        background: var(--tsnse-surface);
        border-bottom: 1px solid var(--tsnse-border);
    }

    .main-navigation.is-open {
        display: block;
    }

    .primary-menu {
        display: block;
    }

    .primary-menu a {
        padding: 12px;
    }

    .primary-menu .sub-menu {
        position: static;
        display: block;
        min-width: 0;
        padding: 0 0 0 14px;
        border: 0;
        box-shadow: none;
    }

    .site-footer__inner {
        display: block;
    }

    .footer-menu {
        justify-content: flex-start;
        margin-top: 18px;
    }

    .search-form {
        display: block;
    }

    .search-submit {
        margin-top: 8px;
        width: 100%;
    }

    .market-hero__inner {
        grid-template-columns: 1fr;
        padding: 48px 0;
    }

    .market-hero h1 {
        font-size: 44px;
    }

    .estimator-cta__inner {
        display: block;
    }

    .estimator-cta .button-link {
        margin-top: 18px;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 15px;
    }

    .site-header__inner,
    .site-footer__inner,
    .content-wrap,
    .content-wrap--full,
    .content-wrap--page {
        width: min(100% - 20px, var(--tsnse-container));
    }

    .entry-card,
    .archive-header {
        padding: 18px;
    }
}

/* Construction marketplace visual system */
:root {
    --tsnse-bg: #F8FAFC;
    --tsnse-surface: #FFFFFF;
    --tsnse-text: #0F2A43;
    --tsnse-muted: #64748B;
    --tsnse-border: #E2E8F0;
    --tsnse-primary: #0F2A43;
    --tsnse-primary-dark: #071A2B;
    --tsnse-accent: #F97316;
    --tsnse-warning: #F97316;
    --tsnse-radius: 14px;
    --tsnse-container: 1240px;
}

body {
    background:
        linear-gradient(180deg, #FFFFFF 0, #F8FAFC 320px),
        #F8FAFC;
    color: #0F2A43;
}

.site-header {
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    box-shadow: 0 10px 30px rgba(15, 42, 67, 0.08);
}

.site-header__inner {
    min-height: 82px;
}

.site-title {
    color: #0F2A43;
    font-size: 24px;
    letter-spacing: 0;
}

.primary-menu {
    gap: 8px;
}

.primary-menu a {
    color: #0F2A43;
    font-weight: 800;
}

.primary-menu a:hover,
.primary-menu a:focus {
    background: #FFF4EC;
    color: #C2410C;
}

.primary-menu .sub-menu {
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 42, 67, 0.18);
}

.button-link,
.wp-block-button__link,
.search-submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.tsnse-estimator__button {
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 10px;
    background: #F97316;
    box-shadow: 0 10px 24px rgba(249, 115, 22, 0.26);
}

.button-link:hover,
.wp-block-button__link:hover,
.search-submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.tsnse-estimator__button:hover {
    background: #EA580C;
}

.button-link--secondary {
    background: #0F2A43;
    box-shadow: 0 10px 24px rgba(15, 42, 67, 0.22);
}

.button-link--secondary:hover,
.button-link--secondary:focus {
    background: #071A2B;
}

.button-link--light {
    color: #0F2A43 !important;
    box-shadow: none;
}

.entry-card,
.archive-header,
.tsnse-v1 .tsnse-v1-card,
.tsnse-estimator__panel,
.tsnse-estimator__form,
.supplier-card,
.category-card,
.market-search {
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 42, 67, 0.10);
}

.market-hero {
    background-color: #0F2A43;
}

.market-hero__inner {
    min-height: 620px;
    align-items: center;
    padding: 92px 0;
}

.market-eyebrow {
    color: #FDBA74;
    font-weight: 900;
}

.market-hero h1 {
    max-width: 800px;
    font-size: clamp(46px, 7vw, 82px);
    letter-spacing: 0;
}

.market-hero p:not(.market-eyebrow) {
    color: #E2E8F0;
    font-size: 20px;
}

.market-search {
    padding: 26px;
    border-top: 5px solid #F97316;
}

.market-search h2 {
    color: #0F2A43;
    font-size: 24px;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="number"],
input[type="password"],
input[type="tel"],
input[type="url"],
select,
textarea {
    min-height: 46px;
    border-radius: 10px;
    border-color: #CBD5E1;
}

.market-section {
    padding: 72px 0;
}

.market-section--surface {
    background: #F1F5F9;
}

.market-section h2,
.estimator-cta h2 {
    color: #0F2A43;
    font-weight: 900;
}

.category-grid,
.supplier-grid {
    gap: 22px;
}

.category-card {
    min-height: 150px;
    display: grid;
    align-content: space-between;
    gap: 22px;
    padding: 22px;
    background: #FFFFFF;
}

.category-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #0F2A43;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 900;
}

.category-card:hover,
.category-card:focus {
    border-color: #F97316;
    color: #C2410C;
    transform: translateY(-3px);
}

.category-card:hover .category-card__icon,
.category-card:focus .category-card__icon {
    background: #F97316;
}

.supplier-card {
    padding: 24px;
    border-top: 5px solid #F97316;
}

.supplier-card h3 {
    color: #0F2A43;
    font-weight: 900;
}

.supplier-card dt {
    color: #F97316;
}

.estimator-cta {
    padding: 64px 0;
    background: #0F2A43;
}

.estimator-cta h2 {
    color: #FFFFFF;
}

.site-footer {
    background: #0F2A43;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 42, 67, 0.10);
}
