/*
 * Tyvek Configurator – frontend styles (v0.5.0 redesign)
 * File: assets/frontend.css
 * Atitinka tyvek.lt dizainą: tamsus grafito skydelis, žalias akcentas,
 * mėlynos antraštės, šviesios 14px kampų kortelės.
 */

.tyvek-cfg {
    --tyvek-blue: #004684;
    --tyvek-green: #069383;
    --tyvek-green-hover: #077568;
    --tyvek-green-soft: rgba(6,147,131,.16);
    --tyvek-ink: #252e35;
    --tyvek-ink-2: #2f3a42;
    --tyvek-dark: #1e1e1e;
    --tyvek-text: #383838;
    --tyvek-muted: #8f8f8f;
    --tyvek-line: #e2e2e2;
    --tyvek-soft: #f5f5f5;
    font-family: inherit;
    color: var(--tyvek-text);
    width: 100%;
}

.tyvek-cfg *,
.tyvek-cfg *::before,
.tyvek-cfg *::after { box-sizing: border-box; }

/* ---------- Įvadas ---------- */
.tyvek-cfg__intro { max-width: 780px; margin-bottom: 34px; }
.tyvek-cfg__eyebrow {
    display: block; color: var(--tyvek-dark);
    font-size: 22px; line-height: 1.2; font-weight: 600; margin-bottom: 2px;
}
.tyvek-cfg__intro h2,
.tyvek-cfg-results-head h2 {
    font-family: inherit; font-size: 52px; line-height: 1.02; font-weight: 600;
    letter-spacing: -.015em; color: var(--tyvek-blue); margin: 0 0 18px;
}
.tyvek-cfg__intro p,
.tyvek-cfg-results-head p {
    font-size: 17px; font-weight: 300; line-height: 1.6; margin: 0; color: var(--tyvek-text);
}
.tyvek-cfg-results-head strong { font-weight: 600; color: var(--tyvek-dark); }

/* ---------- Pagrindinis skydelis ---------- */
.tyvek-cfg__panel {
    position: relative;
    background: var(--tyvek-ink);
    color: #fff;
    border-radius: 24px;
    padding: 40px 48px 36px;
    overflow: hidden;
}
.tyvek-cfg__panel::after {
    content: ""; position: absolute; right: -140px; top: -140px;
    width: 380px; height: 380px; border-radius: 50%;
    background: radial-gradient(circle, var(--tyvek-green-soft) 0%, rgba(6,147,131,0) 70%);
    pointer-events: none;
}
.tyvek-cfg__panel > * { position: relative; z-index: 1; }

.tyvek-cfg__topbar {
    display: flex; align-items: center; min-height: 32px;
    border-bottom: 1px solid rgba(255,255,255,.14);
    padding-bottom: 18px; margin-bottom: 28px;
}
.tyvek-cfg__step { display: flex; align-items: baseline; gap: 10px; color: #fff; }
.tyvek-cfg__step-number {
    font-size: 44px; line-height: 1; font-weight: 600; letter-spacing: -.02em; color: #fff;
}
.tyvek-cfg__step-label { font-size: 16px; line-height: 1; font-weight: 400; color: rgba(255,255,255,.62); }

.tyvek-cfg .tyvek-cfg__restart {
    margin-left: auto; border: 0; background: transparent; padding: 6px 0;
    color: #fff; font: inherit; font-size: 15px; cursor: pointer; box-shadow: none;
    text-decoration: underline; text-decoration-color: rgba(255,255,255,.35);
    text-underline-offset: 5px; transition: text-decoration-color .25s ease;
}
.tyvek-cfg .tyvek-cfg__restart:hover,
.tyvek-cfg .tyvek-cfg__restart:focus-visible {
    color: #fff; background: none; text-decoration-color: var(--tyvek-green); opacity: 1;
}

/* ---------- Pasirinkimų kelias ---------- */
.tyvek-cfg__trail { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.tyvek-cfg__trail-item {
    display: inline-flex; align-items: center; gap: 9px;
    border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07);
    border-radius: 999px; padding: 6px 14px 6px 7px;
    font-size: 13px; line-height: 1.2; color: rgba(255,255,255,.9);
}
.tyvek-cfg__trail-item small {
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--tyvek-green); color: #fff; font-size: 11px; font-weight: 600;
}

/* ---------- Klausimas ---------- */
.tyvek-cfg__question h3 {
    font-family: inherit; font-size: 36px; line-height: 1.15; font-weight: 600;
    letter-spacing: -.01em; color: #fff; margin: 0 0 28px; max-width: 880px;
}
.tyvek-cfg__options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }

.tyvek-cfg .tyvek-cfg__option {
    appearance: none; width: 100%; min-height: 84px;
    border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06);
    border-radius: 14px; padding: 18px 20px 18px 24px;
    display: flex; align-items: center; gap: 18px; text-align: left;
    font: inherit; font-size: 18px; font-weight: 500; line-height: 1.25;
    cursor: pointer; box-shadow: none;
    transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.tyvek-cfg .tyvek-cfg__option i {
    margin-left: auto; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.28);
    font-style: normal; font-size: 17px; line-height: 1; padding-bottom: 2px; color: #fff;
    transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.tyvek-cfg .tyvek-cfg__option:hover,
.tyvek-cfg .tyvek-cfg__option:focus-visible {
    background: rgba(255,255,255,.11); border-color: var(--tyvek-green); outline: none;
}
.tyvek-cfg .tyvek-cfg__option:hover i,
.tyvek-cfg .tyvek-cfg__option:focus-visible i {
    background: var(--tyvek-green); border-color: var(--tyvek-green); transform: translateX(3px);
}
.tyvek-cfg .tyvek-cfg__option:focus-visible { box-shadow: 0 0 0 3px rgba(6,147,131,.45); }

/* Apsauga nuo Astra/globalių mygtukų spalvų */
.tyvek-cfg .tyvek-cfg__option,
.tyvek-cfg .tyvek-cfg__option:hover,
.tyvek-cfg .tyvek-cfg__option:focus,
.tyvek-cfg .tyvek-cfg__option:focus-visible,
.tyvek-cfg .tyvek-cfg__option:active,
.tyvek-cfg .tyvek-cfg__option span,
.tyvek-cfg .tyvek-cfg__option:hover span,
.tyvek-cfg .tyvek-cfg__option:focus span,
.tyvek-cfg .tyvek-cfg__option:active span { color: #fff !important; }

/* ---------- Atgal ---------- */
.tyvek-cfg__nav { display: flex; margin-top: 26px; }
.tyvek-cfg .tyvek-cfg__back {
    border: 0; background: transparent; box-shadow: none;
    color: rgba(255,255,255,.8); font: inherit; font-size: 15px; font-weight: 500;
    padding: 8px 0; cursor: pointer; transition: color .2s ease;
}
.tyvek-cfg .tyvek-cfg__back:before { content: "←"; margin-right: 8px; }
.tyvek-cfg .tyvek-cfg__back:hover,
.tyvek-cfg .tyvek-cfg__back:focus-visible { color: #fff; background: none; opacity: 1; }
.tyvek-cfg .tyvek-cfg__back:focus-visible,
.tyvek-cfg .tyvek-cfg__restart:focus-visible { outline: 2px solid var(--tyvek-green); outline-offset: 4px; border-radius: 4px; }

/* ---------- Ploto įvedimas ---------- */
.tyvek-cfg__area > p { font-size: 16px; font-weight: 300; color: rgba(255,255,255,.7); margin: -12px 0 24px; max-width: 560px; line-height: 1.55; }
.tyvek-cfg__area-form { display: flex; align-items: center; gap: 14px; }
.tyvek-cfg__area-input {
    display: flex; align-items: center; background: #fff;
    border: 2px solid transparent; border-radius: 999px;
    height: 58px; min-width: 260px; padding: 0 22px 0 26px; transition: border-color .2s ease;
}
.tyvek-cfg__area-input:focus-within { border-color: var(--tyvek-green); }
.tyvek-cfg__area-input input {
    width: 100%; height: 52px; border: 0 !important; outline: 0 !important;
    background: transparent !important; box-shadow: none !important; padding: 0 !important;
    font: inherit; font-size: 22px; font-weight: 600; color: var(--tyvek-dark);
}
.tyvek-cfg__area-input span { color: var(--tyvek-muted); font-size: 17px; font-weight: 600; }

.tyvek-cfg-button {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 54px; border: 0; border-radius: 100px;
    background: var(--tyvek-green); color: #fff !important;
    font: inherit; font-size: 16px; font-weight: 500;
    text-decoration: none !important; padding: 0 32px; cursor: pointer;
    transition: background .3s ease, transform .2s ease; box-shadow: none;
}
.tyvek-cfg-button:hover,
.tyvek-cfg-button:focus { background: var(--tyvek-green-hover); color: #fff !important; }
.tyvek-cfg-button:focus-visible { outline: 3px solid rgba(6,147,131,.45); outline-offset: 3px; }
.tyvek-cfg-button[disabled] { opacity: .55; cursor: wait; }

.tyvek-cfg__form-error { color: #ff9d94; font-size: 14px; margin-top: 12px; min-height: 1em; }

/* ---------- Rezultatai ---------- */
.tyvek-cfg__results { scroll-margin-top: 120px; margin-top: 64px; }
.tyvek-cfg__results:empty { margin-top: 0; }
.tyvek-cfg__loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0; font-size: 16px; }
.tyvek-cfg__loading span {
    width: 18px; height: 18px; border: 2px solid #c8c8c8; border-top-color: var(--tyvek-green);
    border-radius: 50%; animation: tyvekSpin .8s linear infinite;
}
@keyframes tyvekSpin { to { transform: rotate(360deg); } }

.tyvek-cfg-results-head {
    max-width: none; margin-bottom: 30px; padding-bottom: 22px;
    border-bottom: 1px solid #c9d6e2;
}
.tyvek-cfg-results-head h2 { font-size: 48px; margin-bottom: 12px; }

.tyvek-cfg-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }

.tyvek-cfg-product {
    display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 24px;
    background: var(--tyvek-soft); border-radius: 14px; padding: 20px;
    transition: background .3s ease;
}
.tyvek-cfg-product:hover { background: #eeeeee; }
.tyvek-cfg-product__image {
    display: flex; align-items: center; justify-content: center;
    background: #fff; border-radius: 10px; overflow: hidden; min-height: 190px;
}
.tyvek-cfg-product__image img {
    display: block; width: 100%; height: 100%; min-height: 190px;
    object-fit: contain; margin: 0 !important; border-radius: 10px; padding: 8px;
}
.tyvek-cfg-product__body { min-width: 0; display: flex; flex-direction: column; }
.tyvek-cfg-product h3 {
    font-family: inherit; font-size: 24px; line-height: 1.15; font-weight: 600;
    margin: 2px 0 12px; letter-spacing: -.005em;
}
.tyvek-cfg-product h3 a { color: var(--tyvek-dark) !important; text-decoration: none !important; }
.tyvek-cfg-product h3 a:hover { color: var(--tyvek-green) !important; }
.tyvek-cfg-product__excerpt,
.tyvek-cfg-product__excerpt p { font-size: 15px; font-weight: 300; line-height: 1.5; color: #555; margin: 0 0 14px; }

.tyvek-cfg-product__calc {
    display: grid; gap: 0; margin: auto 0 16px;
    background: #fff; border-radius: 10px; padding: 4px 16px;
    font-size: 14px; color: #666;
}
.tyvek-cfg-product__calc span {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0;
}
.tyvek-cfg-product__calc span + span { border-top: 1px solid #ececec; }
.tyvek-cfg-product__calc strong { color: var(--tyvek-dark); font-weight: 600; font-size: 15px; }
.tyvek-cfg-product__calc span:last-child strong { color: var(--tyvek-green); font-size: 22px; letter-spacing: -.01em; }
.tyvek-cfg-product__actions { margin-top: 0; }

.tyvek-cfg-product__retailers { margin-top: 18px; font-size: 14px; }
.tyvek-cfg-product__retailers > strong { display: block; margin-bottom: 8px; color: var(--tyvek-dark); }
.tyvek-cfg-retailer-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tyvek-cfg-retailer-list a {
    display: inline-flex; border: 1px solid #cfcfcf; background: #fff; border-radius: 999px;
    color: var(--tyvek-blue) !important; text-decoration: none !important;
    padding: 6px 10px; font-size: 13px; font-weight: 500;
}
.tyvek-cfg-retailer-list a:hover { border-color: var(--tyvek-blue); }

/* ---------- Kur įsigyti ---------- */
.tyvek-cfg-retailers { margin-top: 64px; }
.tyvek-cfg-retailers__head { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid #c9d6e2; }
.tyvek-cfg-retailers__head h2 {
    font-family: inherit; font-size: 40px; line-height: 1.05; font-weight: 600;
    letter-spacing: -.01em; color: var(--tyvek-blue); margin: 0;
}
.tyvek-cfg-retailer-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.tyvek-cfg-retailer {
    display: grid; grid-template-columns: 1fr; gap: 24px;
    background: var(--tyvek-soft); border-radius: 14px; padding: 22px;
}
.tyvek-cfg-retailer.has-logo { grid-template-columns: 160px minmax(0,1fr); }
.tyvek-cfg-retailer__logo {
    display: flex; align-items: center; justify-content: center;
    min-height: 140px; padding: 20px; background: #fff; border-radius: 10px;
}
.tyvek-cfg-retailer__logo img {
    display: block; max-width: 100%; max-height: 100px; width: auto; height: auto;
    object-fit: contain; margin: 0 !important;
}
.tyvek-cfg-retailer__body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.tyvek-cfg-retailer h3 {
    font-family: inherit; font-size: 24px; line-height: 1.15; font-weight: 600;
    color: var(--tyvek-dark); margin: 2px 0 14px;
}
.tyvek-cfg-retailer__details { display: grid; gap: 6px; margin-bottom: 18px; font-size: 15px; font-weight: 300; line-height: 1.45; color: #555; }
.tyvek-cfg-retailer__details span,
.tyvek-cfg-retailer__details a { color: #555 !important; text-decoration: none !important; }
.tyvek-cfg-retailer__details a:hover { color: var(--tyvek-green) !important; }
.tyvek-cfg-retailer__details strong { color: var(--tyvek-dark); font-weight: 600; }
.tyvek-cfg-retailer__actions { margin-top: auto; }

/* ---------- Tuščias rezultatas ---------- */
.tyvek-cfg-result-empty { background: var(--tyvek-soft); border-radius: 14px; padding: 36px 40px; }
.tyvek-cfg-result-empty h3 { font-family: inherit; font-size: 26px; line-height: 1.2; font-weight: 600; margin: 0 0 10px; color: var(--tyvek-blue); }
.tyvek-cfg-result-empty p { margin: 0; line-height: 1.6; font-weight: 300; }

/* ---------- Judesys ---------- */
@media (prefers-reduced-motion: no-preference) {
    .tyvek-cfg__question { animation: tyvekIn .35s ease both; }
    @keyframes tyvekIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
    .tyvek-cfg * { transition: none !important; animation: none !important; }
}

/* ---------- Adaptyvumas ---------- */
@media (max-width: 900px) {
    .tyvek-cfg { margin: 50px auto; }
    .tyvek-cfg__panel { padding: 32px 26px 28px; border-radius: 20px; }
    .tyvek-cfg__intro h2,
    .tyvek-cfg-results-head h2 { font-size: 40px; }
    .tyvek-cfg__question h3 { font-size: 30px; }
    .tyvek-cfg-result-grid,
    .tyvek-cfg-retailer-grid { grid-template-columns: 1fr; }
    .tyvek-cfg-product { grid-template-columns: 160px minmax(0,1fr); }
}

@media (max-width: 640px) {
    .tyvek-cfg { margin: 35px auto; }
    .tyvek-cfg__intro h2,
    .tyvek-cfg-results-head h2 { font-size: 32px; }
    .tyvek-cfg__intro p { font-size: 16px; }
    .tyvek-cfg__panel { padding: 24px 18px 22px; border-radius: 16px; }
    .tyvek-cfg__step-number { font-size: 36px; }
    .tyvek-cfg__question h3 { font-size: 25px; margin-bottom: 20px; }
    .tyvek-cfg__options { grid-template-columns: 1fr; }
    .tyvek-cfg .tyvek-cfg__option { min-height: 72px; padding: 14px 14px 14px 18px; font-size: 16px; }
    .tyvek-cfg__option i { width: 34px; height: 34px; }
    .tyvek-cfg__trail { overflow: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .tyvek-cfg__trail-item { white-space: nowrap; }
    .tyvek-cfg__area-form { align-items: stretch; flex-direction: column; }
    .tyvek-cfg__area-input { width: 100%; min-width: 0; }
    .tyvek-cfg-button { width: 100%; }
    .tyvek-cfg-product { grid-template-columns: 1fr; padding: 16px; }
    .tyvek-cfg-product__image,
    .tyvek-cfg-product__image img { min-height: 220px; }
    .tyvek-cfg-retailer.has-logo { grid-template-columns: 1fr; }
    .tyvek-cfg-retailer__logo { min-height: 130px; }
    .tyvek-cfg-retailers__head h2 { font-size: 32px; }
    .tyvek-cfg__topbar { align-items: center; gap: 12px; }
    .tyvek-cfg__restart { text-align: right; }
}
