:root {
    --ph-bg: #f4f5f2;
    --ph-surface: #ffffff;
    --ph-surface-soft: #fafaf8;

    --ph-text: #1c241f;
    --ph-muted: #69736d;
    --ph-soft-muted: #929a95;

    --ph-line: #e1e5e1;
    --ph-line-strong: #d4dad5;

    --ph-green: #123c2d;
    --ph-green-2: #1f5a43;
    --ph-green-soft: #eaf2ed;

    --ph-gold: #b98a32;
    --ph-gold-dark: #85601f;
    --ph-gold-soft: #f7f0df;

    --ph-orange-soft: #fbf1e7;
    --ph-orange: #a76023;

    --ph-red-soft: #f9eaea;
    --ph-red: #a54848;

    --ph-shadow:
        0 1px 2px rgba(20, 34, 27, .03),
        0 10px 32px rgba(20, 34, 27, .045);

    --ph-radius: 18px;
    --ph-max: 1540px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.piyasa-light-home {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 90% 0%,
            rgba(185, 138, 50, .055),
            transparent 26rem
        ),
        var(--ph-bg);
    color: var(--ph-text);
    font-family:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}


/* ==========================================================
   HEADER
   ========================================================== */

.ph-header {
    position: sticky;
    top: 0;
    z-index: 100;

    min-height: 82px;
    padding: 0 max(32px, calc((100vw - var(--ph-max)) / 2));

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;

    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--ph-line);
    backdrop-filter: blur(16px);
}

.ph-brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;

    text-decoration: none;
}

.ph-brand-mark,
.ph-account-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    background: linear-gradient(
        145deg,
        #d7b35d,
        #a87925
    );

    color: #17231c;
    font-weight: 900;
}

.ph-brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 13px;
    font-size: 19px;
}

.ph-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ph-brand-copy strong {
    font-size: 18px;
    letter-spacing: .16em;
}

.ph-brand-copy small {
    color: var(--ph-muted);
    font-size: 9px;
    letter-spacing: .13em;
}

.ph-header-right {
    display: flex;
    align-items: center;
    gap: 11px;
}

.ph-system-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 9px 12px;

    border: 1px solid #d8e5dc;
    border-radius: 999px;

    background: #f5faf7;
    color: var(--ph-green-2);

    font-size: 12px;
    font-weight: 700;
}

.ph-system-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;
    background: #35a06e;

    box-shadow:
        0 0 0 4px rgba(53,160,110,.10);
}

.ph-icon-button {
    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--ph-line);
    border-radius: 12px;

    background: var(--ph-surface);
    color: var(--ph-text);

    cursor: pointer;
}

.ph-account {
    min-height: 48px;

    display: inline-flex;
    align-items: center;
    gap: 9px;

    padding: 6px 12px 6px 7px;

    text-decoration: none;

    border: 1px solid var(--ph-line);
    border-radius: 14px;

    background: var(--ph-surface);
}

.ph-account-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 13px;
}

.ph-account > span:last-child {
    display: flex;
    flex-direction: column;
}

.ph-account strong {
    font-size: 12px;
}

.ph-account small {
    color: var(--ph-muted);
    font-size: 9px;
}


/* ==========================================================
   MAIN
   ========================================================== */

.ph-main {
    width: min(
        calc(100% - 64px),
        var(--ph-max)
    );

    margin: 0 auto;
    padding: 38px 0 64px;
}

.ph-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;

    margin-bottom: 22px;
}

.ph-eyebrow {
    display: block;

    margin-bottom: 8px;

    color: var(--ph-gold-dark);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
}

.ph-section-heading h1,
.ph-product-copy h2,
.ph-workspaces h2 {
    margin: 0;
    letter-spacing: -.035em;
}

.ph-section-heading h1 {
    font-size: clamp(26px, 2.2vw, 38px);
}

.ph-section-heading p,
.ph-product-copy p {
    max-width: 700px;

    margin: 9px 0 0;

    color: var(--ph-muted);
    line-height: 1.65;
    font-size: 14px;
}

.ph-live-global {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    gap: 9px;

    padding: 10px 13px;

    border: 1px solid var(--ph-line);
    border-radius: 999px;

    background: var(--ph-surface);
    color: var(--ph-muted);

    font-size: 11px;
    font-weight: 700;
}

.ph-live-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c59a49;
}

.ph-live-global.is-ready {
    color: var(--ph-green-2);
    border-color: #d6e4db;
    background: #f5faf7;
}

.ph-live-global.is-ready .ph-live-pulse {
    background: #35a06e;
}


/* ==========================================================
   ENGINE CARDS
   ========================================================== */

.ph-engine-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.ph-engine-card {
    min-height: 190px;

    display: flex;
    flex-direction: column;

    padding: 17px;

    text-decoration: none;

    border: 1px solid var(--ph-line);
    border-radius: 16px;

    background: var(--ph-surface);

    box-shadow: 0 1px 2px rgba(20,34,27,.025);

    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
}

.ph-engine-card:hover {
    transform: translateY(-2px);

    border-color: #cdd5cf;

    box-shadow: var(--ph-shadow);
}

.ph-engine-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    margin-bottom: 18px;
}

.ph-engine-icon {
    min-width: 32px;
    height: 32px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 8px;

    border-radius: 9px;

    background: var(--ph-gold-soft);
    color: var(--ph-gold-dark);

    font-size: 10px;
    font-weight: 900;
}

.ph-engine-state {
    max-width: 122px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    padding: 5px 8px;

    border-radius: 999px;

    background: #f2f3f1;
    color: var(--ph-muted);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: .02em;
}

.ph-engine-card.is-connected .ph-engine-state {
    background: var(--ph-green-soft);
    color: var(--ph-green-2);
}

.ph-engine-card.is-context .ph-engine-state {
    background: var(--ph-gold-soft);
    color: var(--ph-gold-dark);
}

.ph-engine-card.is-auth .ph-engine-state {
    background: var(--ph-orange-soft);
    color: var(--ph-orange);
}

.ph-engine-card.is-error .ph-engine-state {
    background: var(--ph-red-soft);
    color: var(--ph-red);
}

.ph-engine-card > strong {
    font-size: 17px;
    letter-spacing: -.025em;
}

.ph-engine-role {
    margin-top: 3px;

    color: var(--ph-soft-muted);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.ph-engine-summary {
    margin: 12px 0 18px;

    color: var(--ph-muted);

    font-size: 11px;
    line-height: 1.55;
}

.ph-engine-bottom {
    margin-top: auto;

    padding-top: 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    border-top: 1px solid #edf0ed;

    color: var(--ph-muted);

    font-size: 10px;
}

.ph-engine-detail {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ==========================================================
   NAV
   ========================================================== */

.ph-engine-nav {
    position: sticky;
    top: 82px;
    z-index: 80;

    margin: 20px 0 30px;
    padding: 7px;

    display: flex;
    align-items: center;
    gap: 4px;

    overflow-x: auto;

    border: 1px solid var(--ph-line);
    border-radius: 15px;

    background: rgba(255,255,255,.95);
    backdrop-filter: blur(15px);

    box-shadow: 0 5px 20px rgba(20,34,27,.025);
}

.ph-engine-nav a {
    flex: 0 0 auto;

    padding: 9px 12px;

    border-radius: 9px;

    text-decoration: none;

    color: var(--ph-muted);

    font-size: 10px;
    font-weight: 800;
}

.ph-engine-nav a:hover {
    background: #f2f4f1;
    color: var(--ph-text);
}

.ph-engine-nav a.is-primary {
    background: var(--ph-green);
    color: white;
}


/* ==========================================================
   PRODUCT CENTER
   ========================================================== */

.ph-product-center {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 52px;
    align-items: center;

    padding: 40px;

    border: 1px solid var(--ph-line);
    border-radius: var(--ph-radius);

    background: var(--ph-surface);

    box-shadow: var(--ph-shadow);
}

.ph-product-copy h2 {
    max-width: 590px;
    font-size: clamp(26px, 2.5vw, 40px);
    line-height: 1.1;
}

.ph-search-shell {
    padding: 20px;

    border: 1px solid var(--ph-line);
    border-radius: 16px;

    background: var(--ph-surface-soft);
}

.ph-search-box {
    min-height: 58px;

    display: flex;
    align-items: center;

    padding: 6px 7px 6px 16px;

    border: 1px solid var(--ph-line-strong);
    border-radius: 13px;

    background: white;

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.ph-search-box:focus-within {
    border-color: #bda66d;

    box-shadow:
        0 0 0 4px rgba(185,138,50,.08);
}

.ph-search-icon {
    margin-right: 10px;
    color: var(--ph-gold-dark);
}

.ph-search-box input {
    min-width: 0;
    flex: 1;

    border: 0;
    outline: 0;

    background: transparent;
    color: var(--ph-text);

    font-size: 13px;
}

.ph-search-box input::placeholder {
    color: #9aa19c;
}

.ph-search-box button {
    min-height: 44px;

    padding: 0 22px;

    border: 0;
    border-radius: 10px;

    background: var(--ph-green);
    color: white;

    font-size: 11px;
    font-weight: 800;

    cursor: pointer;
}

.ph-search-note {
    margin-top: 10px;

    color: var(--ph-muted);

    font-size: 10px;
    line-height: 1.5;
}


/* ==========================================================
   WORKSPACES
   ========================================================== */

.ph-workspaces {
    margin-top: 20px;
    padding: 30px;

    border: 1px solid var(--ph-line);
    border-radius: var(--ph-radius);

    background: var(--ph-surface);
}

.ph-workspaces-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 20px;
}

.ph-workspaces h2 {
    font-size: 22px;
}

.ph-workspaces-head button {
    padding: 9px 13px;

    border: 1px solid var(--ph-line);
    border-radius: 9px;

    background: #f6f7f5;
    color: #a1a7a3;

    font-size: 10px;
}

.ph-empty-workspace {
    min-height: 110px;

    display: flex;
    align-items: center;
    gap: 16px;

    padding: 22px;

    border: 1px dashed #d6dbd7;
    border-radius: 14px;

    background: var(--ph-surface-soft);
}

.ph-empty-icon {
    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    border-radius: 12px;

    background: var(--ph-gold-soft);
    color: var(--ph-gold-dark);

    font-size: 22px;
}

.ph-empty-workspace strong {
    font-size: 12px;
}

.ph-empty-workspace p {
    margin: 4px 0 0;

    color: var(--ph-muted);

    font-size: 11px;
    line-height: 1.5;
}


/* ==========================================================
   FOOTER
   ========================================================== */

.ph-footer {
    width: min(calc(100% - 64px), var(--ph-max));

    margin: 0 auto;
    padding: 22px 0 35px;

    display: flex;
    align-items: center;
    gap: 12px;

    color: var(--ph-muted);

    border-top: 1px solid var(--ph-line);

    font-size: 10px;
}

.ph-footer strong {
    color: var(--ph-text);
    letter-spacing: .12em;
}

.ph-footer-domain {
    margin-left: auto;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 1250px) {
    .ph-engine-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .ph-main {
        width: min(calc(100% - 32px), var(--ph-max));
    }

    .ph-header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .ph-system-state {
        display: none;
    }

    .ph-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .ph-engine-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ph-product-center {
        grid-template-columns: 1fr;
        gap: 26px;
        padding: 28px;
    }

    .ph-footer {
        width: calc(100% - 32px);
    }
}

@media (max-width: 620px) {
    .ph-brand-copy small,
    .ph-account > span:last-child {
        display: none;
    }

    .ph-engine-grid {
        grid-template-columns: 1fr;
    }

    .ph-engine-card {
        min-height: 170px;
    }

    .ph-main {
        padding-top: 24px;
    }

    .ph-product-center,
    .ph-workspaces {
        padding: 20px;
    }
}


/* =========================================================
   FİYATOMATİK
   UI-A5.4C-D
   E-COMMERCE GLOBAL HEADER
   ========================================================= */

:root {
    --ft-shell-max: 1560px;
    --ft-header-border: #e5e5df;
    --ft-topbar-bg: #f6f5f0;
    --ft-header-bg: #ffffff;
    --ft-nav-bg: #ffffff;
    --ft-text: #15231d;
    --ft-muted: #69736e;
    --ft-green: #0f513c;
    --ft-green-dark: #0b402f;
    --ft-gold: #c69a34;
    --ft-soft-gold: #f7f0df;
}

.ft-shell-width {
    width: min(
        calc(100% - 64px),
        var(--ft-shell-max)
    );
    margin-inline: auto;
}

/* ---------- TOPBAR ---------- */

.ft-commerce-shell {
    position: relative;
    z-index: 100;
    background: var(--ft-header-bg);
    border-bottom: 1px solid var(--ft-header-border);
}

.ft-topbar {
    min-height: 34px;
    background: var(--ft-topbar-bg);
    border-bottom: 1px solid var(--ft-header-border);
}

.ft-topbar-inner {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    font-size: 12px;
}

.ft-topbar-message {
    color: var(--ft-muted);
    font-weight: 600;
    letter-spacing: .02em;
}

.ft-topbar-tools {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ft-system-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ft-green);
    font-weight: 700;
}

.ft-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #29a978;
    box-shadow: 0 0 0 4px rgba(41,169,120,.10);
}

.ft-topbar-link {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--ft-muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ft-topbar-link:hover {
    color: var(--ft-green);
}


/* ---------- MAIN HEADER ---------- */

.ft-main-header {
    background: var(--ft-header-bg);
}

.ft-main-header-inner {
    min-height: 92px;
    display: grid;
    grid-template-columns:
        minmax(245px, 300px)
        minmax(380px, 1fr)
        auto;
    align-items: center;
    gap: 36px;
}

.ft-brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    color: var(--ft-text);
    text-decoration: none;
}

.ft-brand-mark {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(
        145deg,
        #e0bd62,
        #b8871d
    );
    color: #102019;
    font-size: 22px;
    font-weight: 900;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        0 7px 18px rgba(99,76,21,.12);
}

.ft-brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ft-brand-copy strong {
    color: var(--ft-text);
    font-size: 20px;
    line-height: 1;
    letter-spacing: .12em;
    white-space: nowrap;
}

.ft-brand-copy small {
    color: var(--ft-muted);
    font-size: 10px;
    letter-spacing: .11em;
    text-transform: uppercase;
    white-space: nowrap;
}


/* ---------- GLOBAL SEARCH ---------- */

.ft-global-search {
    height: 52px;
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    padding: 5px 5px 5px 14px;
    border: 1px solid #dcded9;
    border-radius: 12px;
    background: #fafaf8;
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.ft-global-search:focus-within {
    background: #fff;
    border-color: rgba(15,81,60,.45);
    box-shadow: 0 0 0 4px rgba(15,81,60,.06);
}

.ft-search-icon {
    color: #8b7a4b;
    font-size: 20px;
    line-height: 1;
}

.ft-global-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ft-text);
    font: inherit;
    font-size: 14px;
}

.ft-global-search input::placeholder {
    color: #929993;
}

.ft-global-search button {
    height: 40px;
    min-width: 82px;
    border: 0;
    border-radius: 9px;
    background: var(--ft-green);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.ft-global-search button:hover {
    background: var(--ft-green-dark);
}


/* ---------- HEADER ACTIONS ---------- */

.ft-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.ft-header-action {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 11px;
    border: 1px solid #e2e3df;
    border-radius: 11px;
    background: #fff;
    color: var(--ft-text);
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.ft-header-action:hover {
    border-color: #c9d3cd;
    background: #fafbf9;
}

.ft-header-action > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.ft-header-action small {
    color: var(--ft-muted);
    font-size: 9px;
    line-height: 1.2;
}

.ft-header-action strong {
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

.ft-action-icon,
.ft-account-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
}

.ft-action-icon {
    background: #f4f5f2;
    color: var(--ft-green);
}

.ft-account-avatar {
    background: var(--ft-soft-gold);
    color: #7a5a11;
    font-weight: 900;
}


/* ---------- ENGINE MENU ---------- */

.ft-engine-nav {
    background: var(--ft-nav-bg);
    border-top: 1px solid var(--ft-header-border);
}

.ft-engine-nav-inner {
    min-height: 50px;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    scrollbar-width: thin;
}

.ft-engine-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 50px;
    padding: 0 18px;
    color: #515c56;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .015em;
    white-space: nowrap;
    transition:
        color .15s ease,
        background .15s ease;
}

.ft-engine-nav a:hover {
    color: var(--ft-green);
    background: #fafbf9;
}

.ft-engine-nav a::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
}

.ft-engine-nav a.is-active {
    color: var(--ft-green);
}

.ft-engine-nav a.is-active::after {
    background: var(--ft-green);
}


/* ---------- HOME SPACING AFTER NEW HEADER ---------- */

.ft-commerce-shell + main,
#fiyatomatik-main {
    scroll-margin-top: 60px;
}

#product-center,
#workspaces {
    scroll-margin-top: 70px;
}


/* Hide legacy navigation if any old navigation survives
   outside the newly replaced header. */
.ph-nav,
.ph-primary-nav {
    display: none !important;
}


/* ---------- RESPONSIVE SAFETY ---------- */

@media (max-width: 1180px) {

    .ft-main-header-inner {
        grid-template-columns: 240px 1fr;
        gap: 22px;
        padding-block: 15px;
    }

    .ft-header-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        margin-top: -8px;
    }

}

@media (max-width: 760px) {

    .ft-shell-width {
        width: min(
            calc(100% - 28px),
            var(--ft-shell-max)
        );
    }

    .ft-topbar-message {
        display: none;
    }

    .ft-topbar-inner {
        justify-content: flex-end;
    }

    .ft-main-header-inner {
        display: flex;
        flex-wrap: wrap;
        gap: 14px;
    }

    .ft-brand {
        flex: 1 1 auto;
    }

    .ft-global-search {
        order: 3;
        flex: 1 0 100%;
    }

    .ft-header-actions {
        margin: 0;
    }

    .ft-header-action > span:last-child {
        display: none;
    }

}
