/* Torimo — omat tyylit Bootstrap 5:n päälle (lib/bootstrap).
   Tässä vain brändiväri ja täydennykset — layout, lomakkeet, taulukot,
   napit ja badget tulevat Bootstrapista. */

:root {
    --bs-body-bg: #f6f7f9;
    --bs-body-color: #1f2933;
    /* Sekä -rgb (tavalliset <a>-linkit) että ilman (.nav-link, sivutus ym.
       Bootstrap-komponentit) — muuten komponentit jäävät oletussinisiksi. */
    --bs-link-color: #446084;
    --bs-link-hover-color: #35496a;
    --bs-link-color-rgb: 68, 96, 132;
    --bs-link-hover-color-rgb: 53, 73, 106;
    --c-primary:   #446084;
    --c-primary-d: #35496a;
    --shadow: 0 1px 3px rgba(31, 41, 51, .1);
}

.btn-primary {
    --bs-btn-bg: var(--c-primary);
    --bs-btn-border-color: var(--c-primary);
    --bs-btn-hover-bg: var(--c-primary-d);
    --bs-btn-hover-border-color: var(--c-primary-d);
    --bs-btn-active-bg: var(--c-primary-d);
    --bs-btn-active-border-color: var(--c-primary-d);
}
.nav-pills { --bs-nav-pills-link-active-bg: var(--c-primary); }

/* Kaupan kategoriavalikko: neutraalit "chipit", korostus teemaväristä */
.shop-cat-nav .nav-link { color: var(--bs-body-color); background: #fff; border: 1px solid var(--bs-border-color-translucent); border-radius: 99px; padding: .4rem 1rem; font-weight: 500; }
.shop-cat-nav .nav-link:hover { color: var(--c-primary-d); border-color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 8%, #fff); }
.shop-cat-nav .nav-link.active { color: #fff; background: var(--c-primary); border-color: var(--c-primary); }

body { font-size: 15px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; margin-top: 1.5rem; }
.muted { color: var(--bs-secondary-color); }

/* ── Lomakkeet: label toimii kentän kääreenä ─────── */

label { display: block; margin: .6em 0; font-weight: 600; font-size: .9rem; }
/* Syötekentät valkoisiksi — muuten ne perivät sivun harmaan taustan
   (--bs-body-bg) eivätkä erotu esim. modalin taustasta. */
.form-control, .form-select { background-color: #fff; }
/* Sama juttu korteille: Bootstrap 5.3:ssa --bs-card-bg = var(--bs-body-bg). */
.card { --bs-card-bg: #fff; }
label > .form-control, label > .form-select { margin-top: .25rem; font-weight: 400; }
label.checkbox, label.radio, label.checkbox-inline { font-weight: 400; display: inline-block; margin-right: 1em; }
/* Kytkimet (form-switch) iOS-henkisinä: isompi koko, vihreä päällä-tilassa */
.form-switch .form-check-input { width: 2.8em; height: 1.5em; margin-top: .1em; cursor: pointer; }
.form-switch .form-check-input:checked { background-color: #34c759; border-color: #34c759; }
.form-switch .form-check-label { padding-left: .4em; font-weight: 400; cursor: pointer; }
input[type=number].form-control { max-width: 8em; }
.qty-input { max-width: 5.5em; }
.form-row { display: flex; gap: 1em; flex-wrap: wrap; }
.form-row label { flex: 1; min-width: 180px; }

/* ── Taulukot korttimaisina ──────────────────────── */

.table { --bs-table-bg: var(--bs-white, #fff); box-shadow: var(--shadow); border-radius: .5rem; overflow: hidden; }
.table thead th { background: #eef1f4; font-size: .85rem; }
.row-inactive { opacity: .55; }

/* ── Tila- ja maksubadget (pastelli) ─────────────── */

.badge { background: #eef1f4; color: var(--bs-body-color); border-radius: 99px; font-weight: 600; }
.badge-new { background: #e3ecf7; color: var(--c-primary-d); }
.badge-completed, .badge-pay-paid { background: #e5f3e8; color: #2e7d32; }
.badge-cancelled, .badge-pay-failed { background: #fbe9e7; color: #b3362b; }

/* ── Navigaatio (admin + kauppa) ─────────────────── */

.admin-header { background: var(--c-primary-d); }
.navbar .nav-link i, .navbar .navbar-nav a i { margin-right: .35em; }
.cart-badge { background: var(--c-primary); color: #fff; border-radius: 99px; padding: 0 .5em; font-size: .8rem; }

/* Päähallinnan yläpalkki pysyy näkyvissä vieritettäessä.
   Kaupan adminin layout (sivupalkki + yläpalkki): ks. "Kaupan admin" tiedoston lopussa. */
.admin-header { position: sticky; top: 0; z-index: 1020; }

.lang-switch { display: inline-flex; gap: .45em; align-items: center; }
.lang-switch a { line-height: 0; opacity: .5; }
.lang-switch a:hover { opacity: .85; }
.lang-switch a.active { opacity: 1; }
.lang-switch img { width: 21px; border-radius: 2px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.lang-switch a.active img { box-shadow: 0 0 0 2px var(--c-primary); }
.admin-header .lang-switch a.active img { box-shadow: 0 0 0 2px #fff; }

.lang-flag { width: 21px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.2); margin-right: .5em; vertical-align: -3px; }
.lang-dropdown { min-width: 0; }
.lang-dropdown .dropdown-item { display: flex; align-items: center; padding-right: 1.5rem; }
.lang-dropdown .dropdown-item.active { background: var(--c-primary); }

/* ── Kaupan header-tyylit (valikon ulkoasu) ──────── */

.shop-logo { max-height: 40px; width: auto; }
.shop-header-dark { background: #232a31; }
.shop-header-primary { background: var(--c-primary); }
.shop-header-dark .cart-badge, .shop-header-primary .cart-badge { background: #fff; color: var(--c-primary-d); }
.shop-header-dark .lang-switch a.active img, .shop-header-primary .lang-switch a.active img { box-shadow: 0 0 0 2px #fff; }

/* Yläpalkki: [valikko] logo [haku] tili kori — mobiilissa haku omalla rivillään */
.shop-header-wrap { position: relative; z-index: 1020; }
/* Puhelin ja tabletti: yläpalkki (valikko, kori, haku) kulkee mukana vieritettäessä.
   Kampanjan ilmoituspalkki on headerin yläpuolella eikä seuraa. Ankkurilinkit
   (toimipistekortit, sisällysluettelo) jättävät tilaa palkille. */
@media (max-width: 991.98px) {
    .shop-header-wrap { position: sticky; top: 0; z-index: 1030; box-shadow: 0 2px 10px rgba(16, 24, 40, .12); }
    html { scroll-padding-top: 125px; }
}
.shop-header-light .shop-header { border-bottom: 1px solid var(--bs-border-color-translucent); }
.shop-header { padding: .6rem 0; flex-direction: column; align-items: stretch; }
.shop-header-row { display: flex; align-items: center; gap: .75rem; flex-wrap: nowrap; }
.shop-header .navbar-brand { min-width: 0; flex: 0 1 auto; font-size: 1.2rem; padding: 0; }
.shop-search { flex: 1 1 auto; max-width: 560px; margin: 0 auto; }
.shop-search .form-control { min-width: 0; border-radius: 99px 0 0 99px; padding-left: 1.1rem; border-right: 0; }
.shop-search .shop-search-btn { border-radius: 0 99px 99px 0; background: var(--c-primary); color: #fff; border: 1px solid var(--c-primary); padding: 0 1.1rem; }
.shop-search .shop-search-btn:hover { background: var(--c-primary-d); color: #fff; }
.shop-header-primary .shop-search .shop-search-btn { background: var(--c-primary-d); border-color: var(--c-primary-d); }
.shop-header-dark .shop-search .form-control, .shop-header-primary .shop-search .form-control { border-color: transparent; }
/* Kenttä pysyy valkoisena myös tummassa headerissa (data-bs-theme=dark) — teksti ja placeholder tummina */
.shop-search .form-control { background: #fff; color: #1f2933; }
.shop-search .form-control::placeholder { color: #6b7480; }
.shop-header-actions { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0 0 0 auto; padding: 0; flex: none; }
.shop-action { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: .6rem; color: var(--bs-body-color); text-decoration: none; font-weight: 600; font-size: .92rem; }
.shop-action > i, .shop-action > .position-relative > i { font-size: 1.15rem; }
.shop-action:hover { background: rgba(0, 0, 0, .05); color: var(--bs-body-color); }
.shop-action .lang-flag { margin-right: 0; }
.shop-action-label { max-width: 11rem; }
[data-bs-theme=dark] .shop-action { color: #fff; }
[data-bs-theme=dark] .shop-action:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.shop-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: .6rem; background: transparent; color: inherit; font-size: 1.25rem; }
.shop-icon-btn:hover { background: rgba(0, 0, 0, .05); }
[data-bs-theme=dark] .shop-icon-btn { color: #fff; }
[data-bs-theme=dark] .shop-icon-btn:hover { background: rgba(255, 255, 255, .12); }
.cart-badge-float { position: absolute; top: -.55rem; right: -.75rem; font-size: .68rem; line-height: 1.35; min-width: 1.35em; text-align: center; font-weight: 700; }
@media (max-width: 991.98px) {
    .shop-header .navbar-brand { margin-right: auto !important; }
    .shop-header-actions { margin-left: 0; }
    .shop-search-mobile { max-width: none; margin-top: .25rem; }
}

/* Kategoriapalkki (työpöytä) — sävy seuraa headerin tyyliä */
.shop-catbar { background: #fff; border-bottom: 1px solid var(--bs-border-color-translucent); font-size: .92rem; }
.shop-header-dark .shop-catbar { background: #2c343c; border-bottom-color: transparent; }
.shop-header-primary .shop-catbar { background: var(--c-primary-d); border-bottom-color: transparent; }
.shop-catbar-list { display: flex; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.shop-catbar-list::-webkit-scrollbar { display: none; }
.shop-catbar-list a { display: flex; align-items: center; gap: .4rem; padding: .6rem .85rem; white-space: nowrap; color: var(--bs-body-color); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; }
.shop-catbar-list li:first-child a { padding-left: 0; }
.shop-catbar-extra li:first-child a { padding-left: .85rem; }
.shop-catbar-list a:hover { color: var(--c-primary-d); }
.shop-catbar-list a.active { border-bottom-color: var(--c-primary); color: var(--c-primary-d); font-weight: 600; }
.shop-header-dark .shop-catbar-list a, .shop-header-primary .shop-catbar-list a { color: rgba(255, 255, 255, .85); }
.shop-header-dark .shop-catbar-list a:hover, .shop-header-primary .shop-catbar-list a:hover,
.shop-header-dark .shop-catbar-list a.active, .shop-header-primary .shop-catbar-list a.active { color: #fff; }
.shop-header-dark .shop-catbar-list a.active, .shop-header-primary .shop-catbar-list a.active { border-bottom-color: #fff; }
.shop-catbar-extra { flex: none; }

/* Mobiilivalikko (offcanvas) */
.shop-menu { --bs-offcanvas-width: min(340px, 88vw); }
.shop-menu .offcanvas-header { border-bottom: 1px solid var(--bs-border-color-translucent); }
.shop-menu .offcanvas-body { padding: .5rem .75rem 1.5rem; }
.shop-menu-heading { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); padding: 1rem .75rem .35rem; }
.shop-menu-list { list-style: none; margin: 0; padding: 0; }
.shop-menu-list a { display: flex; align-items: center; gap: .75rem; padding: .7rem .75rem; border-radius: .6rem; color: var(--bs-body-color); text-decoration: none; font-weight: 500; }
.shop-menu-list a i { color: var(--c-primary); width: 1.25em; }
.shop-menu-list a:hover, .shop-menu-list a.active { background: color-mix(in srgb, var(--c-primary) 9%, #fff); color: var(--c-primary-d); }
.shop-menu-count { margin-left: auto; font-size: .78rem; color: var(--bs-secondary-color); background: #f1f3f5; border-radius: 99px; padding: 0 .55em; }
.shop-menu-langs { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 .75rem; }
.shop-menu-langs a { display: inline-flex; align-items: center; padding: .4rem .7rem; border: 1px solid var(--bs-border-color); border-radius: 99px; color: var(--bs-body-color); text-decoration: none; font-size: .88rem; }
.shop-menu-langs a.active { border-color: var(--c-primary); color: var(--c-primary-d); font-weight: 600; }

#product-list { transition: opacity .15s; }
#shop-listing.loading #product-list { opacity: .5; pointer-events: none; }

/* ── Kaupan footer ───────────────────────────────── */

.footer-hours { white-space: pre-line; }

/* Evästebanneri: kelluva kortti alareunan keskellä, korostus kaupan teemaväristä */
.cookie-banner {
    position: fixed; left: 0; right: 0; bottom: 1.25rem; z-index: 1050; margin: 0 auto;
    width: calc(100% - 2.5rem); max-width: 440px; padding: 1.25rem 1.25rem 1.1rem;
    background: #fff; border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem;
    border-top: 4px solid var(--c-primary);
    box-shadow: 0 4px 12px rgba(31, 41, 51, .08), 0 20px 48px rgba(31, 41, 51, .18);
    animation: cookie-in .45s cubic-bezier(.2, .9, .3, 1.15) .3s both;
}
.cookie-banner.is-hiding { animation: cookie-out .25s ease-in forwards; }
@keyframes cookie-in  { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes cookie-out { to { opacity: 0; transform: translateY(16px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .cookie-banner, .cookie-banner.is-hiding { animation-duration: .01s; animation-delay: 0s; } }
.cookie-banner-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.cookie-banner-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
    border-radius: 12px; font-size: 1.35rem; color: var(--c-primary);
    background: color-mix(in srgb, var(--c-primary) 12%, #fff);
}
.cookie-banner-icon i { animation: cookie-wobble 2.4s ease-in-out .9s 1; }
@keyframes cookie-wobble { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg); } 30% { transform: rotate(10deg); } 45% { transform: rotate(-6deg); } 60% { transform: rotate(0); } }
.cookie-banner-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.cookie-banner-text { font-size: .875rem; color: var(--bs-secondary-color); margin-bottom: .9rem; }
.cookie-banner-text a { font-weight: 600; }
.cookie-banner-options { list-style: none; margin: 0 0 1rem; padding: 0; border-radius: .75rem; background: #f6f7f9; }
.cookie-banner-options li { padding: .6rem .85rem; }
.cookie-banner-options li + li { border-top: 1px solid var(--bs-border-color-translucent); }
.cookie-banner-options .form-check-label { margin: 0; font-weight: 600; font-size: .9rem; }
.cookie-banner-options .form-check-input:disabled { opacity: .6; }
.cookie-banner-options .form-check-input:disabled ~ .form-check-label { opacity: 1; }
.cookie-banner-options small { display: block; padding-left: 2.7rem; color: var(--bs-secondary-color); font-size: .78rem; line-height: 1.35; }
.cookie-banner-actions { display: flex; gap: .5rem; }
.cookie-banner-actions .btn { flex: 1; font-weight: 600; border-radius: .6rem; }
@media (max-width: 575.98px) {
    .cookie-banner { bottom: .75rem; width: calc(100% - 1.5rem); max-width: none; }
    .cookie-banner-actions { flex-direction: column-reverse; }
}
.shop-footer-social a { color: var(--bs-secondary-color); }
.shop-footer-social a:hover { color: var(--c-primary); }
.shop-footer-paylogos { gap: 1rem 1.5rem; }
.shop-footer-paylogos img { height: 21px; width: auto; max-width: 95px; object-fit: contain; }

/* Maksutapalogojen valinta (admin/ulkoasu) */
.paylogo-pick { display: flex; flex-wrap: wrap; gap: .5rem .75rem; margin-bottom: 1rem; }
.paylogo-pick .checkbox { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--bs-border-color); border-radius: .375rem; padding: .4rem .6rem; margin: 0; background: #fff; }
.paylogo-pick img { height: 22px; width: auto; max-width: 90px; object-fit: contain; }

/* ── Kauppa (julkinen) ───────────────────────────── */

.product-card { transition: transform .1s ease, box-shadow .1s ease; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(31,41,51,.15) !important; }
.product-card-img { position: relative; aspect-ratio: 4 / 3; background: #eef1f4; display: flex; align-items: center; justify-content: center; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.no-image { color: var(--bs-border-color); font-size: 2rem; }
/* Kuvattoman tuotteen paikkamerkki: kategorian ikoni kaupan värisävyllä */
.product-placeholder, .product-main-img.product-placeholder {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--c-primary) 14%, #fff), color-mix(in srgb, var(--c-primary) 6%, #f1f3f5) 70%);
    color: color-mix(in srgb, var(--c-primary) 55%, #fff); font-size: 2.6rem;
}
.product-main-img.product-placeholder { font-size: 5rem; height: auto; }
.cart-item-img .product-placeholder { font-size: 1.1rem; border-radius: inherit; }
.product-card-price { font-weight: 700; color: var(--c-primary-d); font-size: 1.05rem; }
.product-card-name { line-height: 1.3; }
.product-card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-badge, .product-card-rank { position: absolute; top: .6rem; left: .6rem; padding: .15rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.product-card-badge { background: var(--c-primary); color: #fff; }
.product-card-rank { background: #fff; color: var(--c-primary-d); box-shadow: 0 1px 3px rgba(31, 41, 51, .2); }
@media (max-width: 575.98px) {
    .product-card .card-body { padding: .75rem !important; font-size: .9rem; }
    .product-card-desc { display: none; }
}

/* ── Etusivun osiot (pages/shop/_home_sections.php) ── */
.home-sections { display: flex; flex-direction: column; gap: 2.5rem; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.home-section-head h2 { font-size: 1.35rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.home-section-icon { color: var(--c-primary); margin-right: .5rem; font-size: .9em; }
.home-section-more { font-weight: 600; text-decoration: none; white-space: nowrap; font-size: .92rem; }
.home-section-more i { font-size: .8em; margin-left: .25rem; transition: transform .15s; }
.home-section-more:hover i { transform: translateX(3px); }

.home-hero {
    position: relative; overflow: hidden; border-radius: 1.1rem; color: #fff; min-height: 260px;
    display: flex; align-items: center; padding: 2.5rem 2rem;
    background: linear-gradient(120deg, var(--c-primary-d), var(--c-primary) 60%, color-mix(in srgb, var(--c-primary) 70%, #fff));
}
.home-hero.has-image { background: linear-gradient(90deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, .15) 75%), var(--hero-img) center / cover no-repeat; min-height: 340px; }
.home-hero-inner { max-width: 560px; position: relative; }
.home-hero h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-bottom: .75rem; }
.home-hero-text { font-size: 1.08rem; opacity: .92; margin-bottom: 1.4rem; }
.home-hero-btn { background: #fff; color: var(--c-primary-d); font-weight: 700; border-radius: 99px; padding: .6rem 1.4rem; border: 0; }
.home-hero-btn:hover { background: #f1f3f5; color: var(--c-primary-d); }
@media (max-width: 575.98px) {
    .home-hero { padding: 1.75rem 1.25rem; min-height: 220px; border-radius: .9rem; }
    /* Kapealla teksti peittää koko kuvan — tasainen tummennus ja kuvan oikea reuna näkyviin */
    .home-hero.has-image { min-height: 260px; background: linear-gradient(rgba(0, 0, 0, .58), rgba(0, 0, 0, .58)), var(--hero-img) right center / cover no-repeat; }
}

.home-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
@media (max-width: 575.98px) { .home-cat-grid { grid-template-columns: repeat(2, 1fr); } }
.home-cat {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; padding: 1.1rem .75rem;
    background: #fff; border: 1px solid var(--bs-border-color-translucent); border-radius: .9rem; text-decoration: none; color: var(--bs-body-color);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.home-cat:hover { border-color: var(--c-primary); box-shadow: 0 6px 18px rgba(31, 41, 51, .08); transform: translateY(-2px); color: var(--bs-body-color); }
.home-cat-icon { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 16px; font-size: 1.4rem; color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 11%, #fff); margin-bottom: .2rem; }
.home-cat-name { font-weight: 700; line-height: 1.25; }
.home-cat-count { font-size: .78rem; color: var(--bs-secondary-color); }

/* Vaakasuunnassa vieritettävä tuoterivi: mobiilissa pyyhkäisy, työpöydällä nuolinapit */
.product-rail {
    display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 1rem) / 2.15); gap: 1rem;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: .25rem .1rem 1rem; margin: -.25rem -.1rem -.5rem;
    scrollbar-width: thin;
}
.product-rail-item { scroll-snap-align: start; min-width: 0; }
@media (min-width: 768px)  { .product-rail { grid-auto-columns: calc((100% - 2rem) / 3); } }
@media (min-width: 992px)  { .product-rail { grid-auto-columns: calc((100% - 3rem) / 4); gap: 1rem; } }
@media (min-width: 1200px) { .product-rail { grid-auto-columns: calc((100% - 4rem) / 5); } }
/* Tabletista ylöspäin selataan nuolinapeilla — vierityspalkki piiloon */
@media (min-width: 768px) { .product-rail { scrollbar-width: none; } .product-rail::-webkit-scrollbar { display: none; } }
.rail-nav { display: none; gap: .4rem; }
@media (min-width: 768px) { .rail-nav { display: flex; } }
.rail-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--bs-border-color); background: #fff; color: var(--bs-body-color); display: inline-flex; align-items: center; justify-content: center; }
.rail-btn:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary); }
.rail-btn:disabled { opacity: .35; }
.rail-nav.is-static { visibility: hidden; }

/* Uutiskortit ja -artikkeli */
.news-card { border: 1px solid var(--bs-border-color-translucent); border-radius: .9rem; transition: box-shadow .15s, transform .15s; color: var(--bs-body-color); }
.news-card:hover { box-shadow: 0 8px 24px rgba(31, 41, 51, .1); transform: translateY(-2px); color: var(--bs-body-color); }
.news-card-img { aspect-ratio: 16 / 9; background: color-mix(in srgb, var(--c-primary) 10%, #f1f3f5); display: flex; align-items: center; justify-content: center; }
.news-card-img img { width: 100%; height: 100%; object-fit: cover; }
.news-card-placeholder { font-size: 2rem; color: color-mix(in srgb, var(--c-primary) 45%, #fff); }
@media (max-width: 767.98px) { .news-card-img.is-empty { aspect-ratio: 4 / 1; } .news-card-img.is-empty .news-card-placeholder { font-size: 1.4rem; } }
.news-card-date { display: block; font-size: .78rem; font-weight: 600; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35rem; }
.news-card-title { font-size: 1.08rem; font-weight: 700; line-height: 1.3; margin: 0 0 .5rem; }
.news-card-excerpt { font-size: .9rem; color: var(--bs-secondary-color); margin-bottom: .75rem; }
.news-card-more { font-size: .88rem; font-weight: 600; color: var(--c-primary); }
.news-article { max-width: 800px; overflow: hidden; }
.news-article-img { width: 100%; max-height: 440px; object-fit: cover; }
.news-article-title { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 .75rem; }
.news-article-lead { font-size: 1.12rem; color: var(--bs-secondary-color); margin-bottom: 1.5rem; }

/* Toimipisteet */
.content-wrap-wide { max-width: none; }
.loc-section-title { font-size: 1.2rem; font-weight: 700; margin: 2rem 0 1rem; }
.loc-card-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.loc-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex: none; border-radius: 13px; font-size: 1.15rem; color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 11%, #fff); }
.loc-card-service { border-top: 4px solid var(--c-primary); }
.loc-card-service .loc-card-icon { color: #fff; background: var(--c-primary); }
.loc-card-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); }
.loc-card-name { font-size: 1.15rem; font-weight: 700; margin: 0; }
.loc-card-list li { display: flex; gap: .65rem; margin-bottom: .55rem; }
.loc-card-list li > i { color: var(--c-primary); margin-top: .25rem; }
.loc-card-notes { font-size: .9rem; color: var(--bs-secondary-color); margin: .75rem 0 0; padding-top: .75rem; border-top: 1px solid var(--bs-border-color-translucent); }
.home-loc { border: 1px solid var(--bs-border-color-translucent); border-radius: .9rem; transition: border-color .15s; }
.home-loc:hover { border-color: var(--c-primary); }
.home-loc-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c-primary); margin-bottom: .25rem; }

.product-back-link { color: var(--bs-secondary-color); text-decoration: none; }
.product-back-link:hover { color: var(--c-primary-d); }

.product-main-img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    border-radius: .5rem; background: #eef1f4;
    display: flex; align-items: center; justify-content: center;
}
.product-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid var(--bs-border-color); }
.product-price { font-size: 1.4rem; font-weight: 700; color: var(--c-primary-d); }
.vat-note { font-size: .8rem; font-weight: 400; color: var(--bs-secondary-color); margin-left: .5em; }
.product-description { margin-top: 1.5em; white-space: pre-line; }

.checkout-summary ul { list-style: none; padding: 0; }
.checkout-summary li { display: flex; justify-content: space-between; gap: 1em; padding: .3em 0; border-bottom: 1px solid var(--bs-border-color); }

.order-box { max-width: 560px; }
.order-items { width: 100%; border-collapse: collapse; margin: 1em 0; }
.order-items td { padding: .35em 0; border-bottom: 1px solid var(--bs-border-color); }
.order-items td:last-child { text-align: right; }
.order-total td { font-weight: 700; }

/* Sisältösivut (/{slug}, esim. tietosuojaseloste) — Markdown-sisältö kortissa */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.content-wrap { max-width: 1100px; margin: 0 auto; padding-bottom: 1.5rem; }
.content-hero { max-width: 640px; margin: 1rem auto 2rem; text-align: center; }
.content-hero h1 { font-size: 2rem; font-weight: 700; margin: 0 0 .5rem; }
.content-hero-lead { font-size: 1.05rem; color: var(--bs-secondary-color); margin: 0; }
.content-hero-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 1rem;
    border-radius: 18px; font-size: 1.6rem; color: var(--c-primary);
    background: color-mix(in srgb, var(--c-primary) 12%, #fff);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--c-primary) 5%, transparent);
}
.content-page > .card-body { padding: 2.25rem 2.5rem; line-height: 1.7; }
@media (max-width: 575.98px) { .content-page > .card-body { padding: 1.5rem 1.25rem; } }
.content-page .card-body > :first-child { margin-top: 0; }
.content-page .card-body > :last-child { margin-bottom: 0; }
.content-page h2, .content-page h3 { scroll-margin-top: 1.5rem; }
.content-page h2 {
    display: flex; align-items: center; gap: .6rem;
    font-size: 1.2rem; font-weight: 700; margin: 2rem 0 .75rem; padding-top: 1.75rem;
    border-top: 1px solid var(--bs-border-color-translucent);
}
.content-page h2::before { content: ""; flex: none; width: 4px; height: 1.1em; border-radius: 2px; background: var(--c-primary); }
.content-page .card-body > h2:first-child { padding-top: 0; border-top: 0; }
.content-page h3 { font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
.content-page p { margin-bottom: .9rem; }
.content-page ul, .content-page ol { padding-left: 1.35rem; margin-bottom: 1rem; }
.content-page li { margin-bottom: .3rem; padding-left: .2rem; }
.content-page li::marker { color: var(--c-primary); font-weight: 700; }
.content-page a { color: var(--c-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.content-page a:hover { color: var(--c-primary-d); }
.content-page hr { margin: 2rem 0; opacity: .12; }
.content-page code { color: var(--c-primary-d); background: #eef1f4; padding: .1em .35em; border-radius: 4px; }
.content-page blockquote {
    margin: 1.5rem 0; padding: .9rem 1.1rem; border-left: 4px solid var(--c-primary); border-radius: .5rem;
    background: color-mix(in srgb, var(--c-primary) 7%, #fff); color: var(--bs-body-color);
}
.content-page blockquote p { margin: 0; }

/* Sisällysluettelo: desktopilla sisällön vieressä sticky, mobiilissa sen yläpuolella */
.content-toc { padding: 1.1rem 1.25rem; background: #fff; border: 1px solid var(--bs-border-color-translucent); border-radius: .9rem; }
@media (min-width: 992px) { .content-toc { position: sticky; top: 1.5rem; } }
.content-toc-title { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bs-secondary-color); margin-bottom: .5rem; }
.content-toc .nav-link {
    padding: .35rem .75rem; margin-left: -.75rem; border-left: 2px solid transparent; border-radius: 0 .375rem .375rem 0;
    font-size: .9rem; line-height: 1.35; color: var(--bs-secondary-color);
}
.content-toc .nav-link:hover { color: var(--c-primary-d); background: color-mix(in srgb, var(--c-primary) 6%, #fff); }
.content-toc .nav-link.active { color: var(--c-primary); font-weight: 600; border-left-color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 8%, #fff); }

.auth-form { max-width: 380px; }
.centered-message { text-align: center; padding-top: 15vh; }

/* ── Kauppa: kortit, tili ja ostoskori ───────────── */
/* Korostukset kaupan teemaväristä (--c-primary, theme.php). */

.shop-card { border: 1px solid var(--bs-border-color-translucent); border-radius: .9rem; box-shadow: 0 1px 2px rgba(31, 41, 51, .05), 0 8px 24px rgba(31, 41, 51, .06); }
.shop-card > .card-body { padding: 1.5rem; }
.shop-card-icon { color: var(--c-primary); margin-right: .35rem; }

/* Tyhjä tila (tyhjä kori, ei tilauksia) */
.shop-empty { max-width: 460px; margin: 3rem auto; text-align: center; }
.shop-empty-sm { margin: 1rem auto; }
.shop-empty-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 88px; height: 88px; margin-bottom: 1.25rem;
    border-radius: 50%; font-size: 2.2rem; color: var(--c-primary);
    background: color-mix(in srgb, var(--c-primary) 12%, #fff);
}

/* Kirjautuminen / rekisteröityminen */
.auth-wrap { display: flex; justify-content: center; padding: 1.5rem 0 2.5rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card > .card-body { padding: 2rem; }
.auth-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: .75rem;
    border-radius: 16px; font-size: 1.4rem; color: var(--c-primary);
    background: color-mix(in srgb, var(--c-primary) 12%, #fff);
}
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 1.25rem 0; border-radius: 12px; background: #eef1f4; }
.auth-tabs a { padding: .5rem; border-radius: 9px; text-align: center; font-weight: 600; color: var(--bs-secondary-color); text-decoration: none; }
.auth-tabs a:hover { color: var(--bs-body-color); }
.auth-tabs a.active { background: #fff; color: var(--c-primary); box-shadow: 0 2px 8px rgba(31, 41, 51, .1); }
.auth-card label { margin-top: 0; }

/* Oma tili (kirjautunut) */
.account-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.account-head-user { display: flex; align-items: center; gap: 1rem; }
.account-avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; flex: none;
    border-radius: 50%; background: var(--c-primary); color: #fff; font-size: 1.4rem; font-weight: 700;
}
.shop-orders.table { box-shadow: none; border-radius: 0; }

/* Ostoskori */
.cart-items { list-style: none; margin: 0; padding: 0; }
.cart-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) 90px 110px 40px; align-items: center; gap: 1rem; padding: 1rem 1.25rem; }
.cart-item + .cart-item { border-top: 1px solid var(--bs-border-color-translucent); }
.cart-item-img {
    display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; overflow: hidden;
    border-radius: 12px; background: #eef1f4; color: var(--bs-border-color); font-size: 1.4rem;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { display: flex; flex-direction: column; min-width: 0; }
.cart-item-name { font-weight: 600; color: var(--bs-body-color); text-decoration: none; }
.cart-item-name:hover { color: var(--c-primary); }
.cart-item-qty .qty-input { max-width: none; text-align: center; }
.cart-item-total { text-align: right; white-space: nowrap; }
.cart-item-remove { color: var(--bs-secondary-color); padding: .35rem; border: 0; }
.cart-item-remove:hover { color: #b3362b; background: #fbe9e7; }
@media (max-width: 575.98px) {
    /* Puhelimessa: kuva + nimi ylärivillä, määrä + summa + poisto alarivillä */
    .cart-item { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img info remove" "img qty total"; row-gap: .5rem; padding: 1rem; }
    .cart-item-img { grid-area: img; width: 64px; height: 64px; }
    .cart-item-info { grid-area: info; }
    .cart-item-qty { grid-area: qty; width: 90px; }
    .cart-item-total { grid-area: total; }
    .cart-item-remove { grid-area: remove; justify-self: end; }
}
.cart-summary { position: sticky; top: 1rem; }
.cart-summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .25rem 0; }
.cart-summary-total { font-size: 1.25rem; padding-bottom: .5rem; }
.cart-summary-total strong { font-size: 1.5rem; }

/* Tilausvahvistus */
.order-wrap { max-width: 980px; margin-left: auto; margin-right: auto; }
.order-hero { max-width: 620px; margin: 1.5rem auto 2rem; text-align: center; }
.order-hero h1 { margin: 0 0 .4rem; }
.order-hero-meta { font-size: 1.05rem; margin-bottom: .35rem; }
.order-hero-meta span { margin: 0 .4rem; color: var(--bs-secondary-color); }
.order-hero-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 76px; height: 76px; margin-bottom: 1rem;
    border-radius: 50%; font-size: 2rem; animation: order-pop .5s cubic-bezier(.3, 1.4, .5, 1) both;
}
.order-hero-icon.is-ok { background: #e5f3e8; color: #2e7d32; box-shadow: 0 0 0 8px rgba(46, 125, 50, .08); }
.order-hero-icon.is-warn { background: #fff4e0; color: #9a5b00; box-shadow: 0 0 0 8px rgba(154, 91, 0, .08); }
@keyframes order-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .order-hero-icon { animation: none; } }
.order-retry { border-color: #f3d19c; background: #fffaf0; }
.order-lines { list-style: none; margin: 0; padding: 0; }
.order-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--bs-border-color-translucent); }
.order-lines li span:last-child { white-space: nowrap; }
.order-line-sub { color: var(--bs-secondary-color); }
.order-qty { color: var(--bs-secondary-color); margin-right: .25rem; }
.order-total-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-top: .9rem; font-weight: 600; }
.order-total-row strong { font-size: 1.5rem; }
.order-facts { display: grid; grid-template-columns: auto 1fr; gap: .6rem 1rem; margin: 0; }
.order-facts dt { font-weight: 600; color: var(--bs-secondary-color); font-size: .9rem; }
.order-facts dd { margin: 0; }

/* ── Hallinta (kaupan admin + päähallinta) ───────── */

/* Päähallinta käyttää Montserrat-fonttia (lib/fonts/montserrat/) */
body.hallinta { font-family: 'Montserrat', var(--bs-font-sans-serif); }

.admin-form { background: #fff; border-radius: .5rem; box-shadow: var(--shadow); padding: 1.25rem 1.5rem; margin: 1.25rem 0; max-width: 760px; }
.admin-form h2:first-of-type { margin-top: 0; }
.admin-form.wide { max-width: none; }

/* select2 sovitettu Bootstrapin form-selectin mittoihin */
.select2-container .select2-selection--single { height: calc(1.5em + .75rem + 2px); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: calc(1.5em + .75rem); padding-left: .75rem; color: var(--bs-body-color); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: calc(1.5em + .75rem); }
.select2-dropdown { border-color: var(--bs-border-color); }
.select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-sm); }
.lang-fieldset { border: 1px solid var(--bs-border-color); border-radius: .5rem; margin: 1em 0; padding: .8em 1em; }
.lang-fieldset legend { font-weight: 700; padding: 0 .4em; font-size: 1rem; float: none; width: auto; margin-bottom: 0; }
.lang-table { max-width: 420px; }

.stat-card { display: block; font-size: .9rem; }
.stat-num { display: block; font-size: 1.7rem; font-weight: 700; color: var(--c-primary-d); }

.logo-preview img { max-height: 60px; max-width: 260px; border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .4em .6em; background: #fff; }
.page-form { max-width: none; }
.page-md { font-family: var(--bs-font-monospace); font-size: .85rem; }
.form-control-color { width: 5em; }
.font-preview { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: 1rem 1.25rem; background: #f6f7f9; }
.font-preview-heading { font-size: 1.6rem; font-weight: 700; margin-bottom: .35rem; }


.category-row { max-width: none; }
.category-row .form-row { align-items: center; }
.category-row .form-row label { min-width: 140px; }
.category-row button, .category-row .muted { margin-bottom: .3em; align-self: flex-end; }

/* ── Notify-ilmoitukset (js/app.js: notify()) ────── */

#notify-container { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: 440px; }
.notify { display: flex; align-items: flex-start; gap: .75rem; padding: 1.1rem 1.3rem; font-size: 1.05rem; border-radius: 3px; color: #fff; box-shadow: 0 4px 16px rgba(31, 41, 51, .3); animation: notify-in .25s ease; }
.notify-success { background: rgba(46, 125, 50, .85); }
.notify-error { background: rgba(179, 54, 43, .85); }
@supports (backdrop-filter: blur(4px)) {
    .notify { backdrop-filter: blur(4px); }
}
.notify.hide { opacity: 0; transition: opacity .3s; }
.notify-close { background: none; border: 0; color: inherit; font-size: 1.3rem; line-height: 1; padding: 0; margin-left: auto; cursor: pointer; opacity: .8; }
.notify-close:hover { opacity: 1; }
@keyframes notify-in { from { opacity: 0; transform: translateY(-8px); } }
@media (max-width: 575.98px) {
    #notify-container { top: 0; left: 0; right: 0; max-width: none; gap: 0; }
    .notify { border-radius: 0; }
}

/* ── Kirjautumissivu ─────────────────────────────── */

.login-page { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; min-height: 100vh; background: var(--bs-body-bg); }
.login-box { background: #fff; border-radius: .5rem; box-shadow: var(--shadow); padding: 2em 2.2em; width: 100%; max-width: 380px; text-align: center; }
.login-box h1 { margin: 0; }
.login-logo img { display: block; height: 52px; width: auto; max-width: 100%; margin: 0 auto .4rem; }
.hallinta-brand { display: inline-flex; align-items: center; gap: .5rem; }
.hallinta-brand img { height: 26px; width: auto; }
.login-box form { text-align: left; margin-top: 1.2em; }
.login-box .btn { width: 100%; margin-top: .8em; }

/* ── Made by Bytedev ─────────────────────────────── */

.made-by { display: inline-flex; flex-direction: column; align-items: center; gap: .3rem; opacity: .45; transition: opacity .15s; text-decoration: none; }
.made-by:hover { opacity: .8; }
.made-by-text { font-size: .7rem; letter-spacing: .04em; color: var(--bs-body-color); }
/* Logo on valkoinen — vaalealla taustalla käännetään mustaksi. */
.made-by-logo { width: 90px; height: auto; filter: brightness(0); }
/* Torimon logo on Bytedevin logoa leveämpi — sama korkeus kuin Bytedevillä */
.powered-by .made-by-logo { width: auto; height: 24px; filter: grayscale(1) contrast(1.2); }

/* ══ Kaupan admin (body.admin-shop) ══════════════════════════════
   Oma layout: tumma sivupalkki koko korkeudelta, valkoinen yläpalkki,
   kortit ja taulukot hiusviivareunoilla. Brändiväri Torimon sininen. */

body.admin-shop {
    --adm-bg: #f5f7fb;
    --adm-surface: #fff;
    --adm-border: #e6e9f0;
    --adm-border-soft: #f0f2f6;
    --adm-text: #101828;
    --adm-muted: #667085;
    --adm-side-bg: #0c1631;
    --adm-grad: linear-gradient(135deg, #00b7f5 0%, #2462e9 55%, #a400df 100%);
    --adm-topbar-h: 60px;
    --c-primary: #2462e9;
    --c-primary-d: #1b4fc4;
    --bs-body-bg: var(--adm-bg);
    --bs-body-color: var(--adm-text);
    --bs-secondary-color: var(--adm-muted);
    --bs-border-color: #dfe3ea;
    --bs-link-color: #2462e9;
    --bs-link-hover-color: #1b4fc4;
    --bs-link-color-rgb: 36, 98, 233;
    --bs-link-hover-color-rgb: 27, 79, 196;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-family: var(--bs-body-font-family);
    font-size: 14.5px;
    background: var(--adm-bg);
    -webkit-font-smoothing: antialiased;
}
.admin-shop h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.admin-shop h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.admin-shop .muted { color: var(--adm-muted); }

/* ── Layout ── */
.admin-shop .admin-layout { display: flex; align-items: stretch; min-height: 100vh; }
.admin-shop .admin-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.admin-content { flex: 1 1 auto; width: 100%; max-width: 1440px; margin: 0 auto; padding: 1.75rem 1.75rem 2rem; }
@media (max-width: 575.98px) { .admin-content { padding: 1.25rem 1rem 1.5rem; } }

/* ── Sivupalkki ── */
.admin-shop .admin-sidebar { --bs-offcanvas-width: 280px; --bs-offcanvas-bg: var(--adm-side-bg); --bs-offcanvas-color: #fff; }
.admin-sidebar-inner { display: flex; flex-direction: column; height: 100%; width: 100%; padding: 1rem .75rem; overflow-y: auto; }
@media (min-width: 992px) {
    /* !important kumoaa Bootstrapin offcanvas-lg:n transparent-säännön desktopilla */
    .admin-shop .admin-sidebar { flex: 0 0 248px; width: 248px; position: sticky; top: 0; height: 100vh; background-color: var(--adm-side-bg) !important; }
}
.admin-brand { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .25rem .5rem 1rem; margin-bottom: .25rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.admin-brand-link { display: flex; align-items: center; gap: .7rem; min-width: 0; color: #fff; text-decoration: none; }
.admin-brand-link:hover { color: #fff; }
.admin-brand-mark {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 38px; height: 38px; overflow: hidden;
    border-radius: 10px; background: var(--brand, #2462e9); color: #fff; font-weight: 700; font-size: 1.05rem;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset;
}
.admin-brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.admin-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.admin-brand-name { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-brand-sub { font-size: .72rem; color: rgba(255, 255, 255, .5); }

.admin-sidenav { display: flex; flex-direction: column; gap: 2px; padding-top: .5rem; }
.admin-sidenav-heading { margin: 1.1rem .75rem .35rem; font-size: .66rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .42); }
.admin-sidenav .nav-link {
    position: relative; display: flex; align-items: center; gap: .7rem; padding: .5rem .75rem; border-radius: .55rem;
    color: rgba(255, 255, 255, .7); font-size: .9rem; font-weight: 500; transition: background-color .12s, color .12s;
}
.admin-sidenav .nav-link i { width: 1.1rem; text-align: center; font-size: .9rem; opacity: .85; }
.admin-sidenav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.admin-sidenav .nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(36, 98, 233, .42), rgba(36, 98, 233, .14)); }
.admin-sidenav .nav-link.active i { color: #8cb8ff; opacity: 1; }
.admin-sidenav .nav-link.active::before { content: ''; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--adm-grad); }
.admin-sidenav-badge { margin-left: auto; min-width: 1.4rem; padding: .05rem .45rem; border-radius: 99px; background: #f97316; color: #fff; font-size: .7rem; font-weight: 700; text-align: center; }
.admin-sidebar-foot { margin-top: auto; padding-top: 1.25rem; display: flex; flex-direction: column; gap: .9rem; }
.admin-shop-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: .55rem; border: 1px solid rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .8); font-size: .88rem; font-weight: 500; text-decoration: none; }
.admin-shop-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.admin-powered { align-self: center; opacity: .4; transition: opacity .15s; }
.admin-powered:hover { opacity: .75; }
.admin-powered img { height: 18px; width: auto; display: block; }

/* ── Yläpalkki ── */
.admin-topbar {
    position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem;
    min-height: var(--adm-topbar-h); padding: .5rem 1.75rem; background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid var(--adm-border);
}
@supports (backdrop-filter: blur(8px)) { .admin-topbar { backdrop-filter: saturate(1.4) blur(8px); } }
@media (max-width: 575.98px) { .admin-topbar { padding: .5rem 1rem; } }
.admin-topbar-title { flex: 1 1 auto; min-width: 0; font-size: .9rem; }
.admin-topbar-actions { display: flex; align-items: center; gap: .4rem; }
.admin-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border-radius: .55rem; color: var(--adm-text); }
.admin-icon-btn:hover, .admin-icon-btn[aria-expanded="true"] { background: #f2f4f7; }
.admin-user-btn { display: inline-flex; align-items: center; gap: .55rem; max-width: 240px; padding: .25rem .6rem .25rem .25rem; border-radius: 99px !important; color: var(--adm-text); font-weight: 500; font-size: .875rem; }
.admin-user-btn:hover, .admin-user-btn[aria-expanded="true"] { background: #f2f4f7; }
.admin-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--adm-grad); color: #fff; font-size: .75rem; font-weight: 700; }
.admin-user-menu { min-width: 240px; }

/* ── Komponentit ── */
.admin-shop .btn { border-radius: .55rem; font-weight: 500; }
.admin-shop .btn-outline-secondary { --bs-btn-color: #344054; --bs-btn-border-color: #d0d5dd; --bs-btn-hover-bg: #f9fafb; --bs-btn-hover-color: #101828; --bs-btn-hover-border-color: #c4cad4; --bs-btn-active-bg: #f2f4f7; --bs-btn-active-color: #101828; --bs-btn-active-border-color: #c4cad4; --bs-btn-bg: #fff; }
.admin-shop .form-control, .admin-shop .form-select { border-radius: .5rem; border-color: #d0d5dd; }
.admin-shop .form-control:focus, .admin-shop .form-select:focus { border-color: #8cb0f5; box-shadow: 0 0 0 4px rgba(36, 98, 233, .12); }
.admin-shop .dropdown-menu { border: 1px solid var(--adm-border); border-radius: 12px; padding: .35rem; box-shadow: 0 12px 32px rgba(16, 24, 40, .12); }
.admin-shop .dropdown-item { border-radius: 8px; padding: .45rem .7rem; font-size: .9rem; }
.admin-shop .alert { border-radius: 12px; }

.admin-shop .card { border: 1px solid var(--adm-border); border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.admin-shop .admin-form { border-radius: 14px; box-shadow: 0 0 0 1px var(--adm-border), 0 1px 2px rgba(16, 24, 40, .04); }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding: 1rem 1.25rem 0; }
.card-head h2 { margin: 0; font-size: .95rem; font-weight: 600; }
.card-head-sub { font-size: .8rem; color: var(--adm-muted); }
.card-link { font-size: .82rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.card-link:hover { text-decoration: underline; }

.admin-shop .table { box-shadow: 0 0 0 1px var(--adm-border), 0 1px 2px rgba(16, 24, 40, .04); border-radius: 12px; --bs-table-hover-bg: #f7f9fd; --bs-table-border-color: var(--adm-border-soft); }
.admin-shop .table thead th { background: #f9fafb; color: var(--adm-muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: .7rem .9rem; border-bottom: 1px solid var(--adm-border); white-space: nowrap; }
.admin-shop .table td { padding: .75rem .9rem; }
.admin-shop .table > tbody > tr:last-child > td { border-bottom: 0; }
.admin-shop .card .table { box-shadow: none; border-radius: 0; margin: 0; }
.admin-shop .card .table thead th { background: transparent; }
.admin-shop .card .table td:first-child, .admin-shop .card .table th:first-child { padding-left: 1.25rem; }
.admin-shop .card .table td:last-child, .admin-shop .card .table th:last-child { padding-right: 1.25rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-link { cursor: pointer; }

/* Tila- ja maksubadget: jokaiselle tilalle oma sävy + väripiste (teksti kertoo tilan, väri tukee) */
.admin-shop .badge { font-weight: 600; font-size: .72rem; padding: .3em .65em; }
.badge-processing, .badge-pay-pending { background: #fff4e0; color: #9a5b00; }
.badge-shipped { background: #efeafd; color: #5b3fc4; }
.badge-pay-refunded { background: #eef1f4; color: #475467; }
.admin-shop .badge[class*="badge-"]::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: .4em; border-radius: 50%; background: currentColor; vertical-align: 1px; opacity: .8; }

/* Sivun otsikkorivi */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1rem; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.page-sub { margin: .25rem 0 0; color: var(--adm-muted); font-size: .9rem; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* KPI-kortit */
.kpi { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1.1rem 1.25rem; color: inherit; text-decoration: none; }
a.kpi { transition: box-shadow .15s, border-color .15s; }
a.kpi:hover { color: inherit; border-color: #c9d6f2; box-shadow: 0 4px 14px rgba(16, 24, 40, .07); }
.kpi-label { display: flex; align-items: center; gap: .55rem; color: var(--adm-muted); font-size: .82rem; font-weight: 500; }
.kpi-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: #eaf1fe; color: #2462e9; font-size: .8rem; }
.kpi-icon.is-orange { background: #fff1e6; color: #c2410c; }
.kpi-icon.is-green { background: #e7f6ec; color: #067647; }
.kpi-icon.is-violet { background: #f0ecfd; color: #5b3fc4; }
.kpi-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: .2rem; }
.kpi-foot { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .45rem; font-size: .78rem; color: var(--adm-muted); }
@media (max-width: 575.98px) {
    .kpi { padding: .9rem 1rem; }
    .kpi-value { font-size: 1.3rem; }
    .kpi-label { font-size: .78rem; }
    .admin-shop .card .table td, .admin-shop .card .table th { padding-left: .6rem; padding-right: .6rem; }
    .page-head-actions .btn { font-size: .85rem; }
}
.delta { display: inline-flex; align-items: center; gap: .25rem; padding: .08rem .45rem; border-radius: 99px; font-size: .74rem; font-weight: 600; }
.delta-up { background: #e7f6ec; color: #067647; }
.delta-down { background: #fdecec; color: #b42318; }
.delta-flat { background: #f2f4f7; color: #475467; }

/* Kaaviot (js/admin-charts.js) */
.chart-box { position: relative; height: 300px; padding: .75rem 1rem 1rem; }
.chart-box.is-sm { height: 230px; }
@media (max-width: 575.98px) { .chart-box { height: 240px; padding: .5rem .5rem .75rem; } }
.chart-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .8rem; color: var(--adm-muted); }
.legend-key { display: inline-block; width: 16px; border-top: 2px solid var(--key, #2462e9); vertical-align: middle; margin-right: .4rem; }
.legend-key.is-dashed { border-top-style: dashed; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: #f2f4f7; }
.seg button { margin: 0; padding: .28rem .7rem; border: 0; border-radius: 7px; background: transparent; color: var(--adm-muted); font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--adm-text); }
.seg button.active { background: #fff; color: var(--adm-text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.chart-table { max-height: 320px; overflow-y: auto; border-top: 1px solid var(--adm-border-soft); }
.admin-shop .chart-table .table thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.chart-toggle { padding: .6rem 1.25rem; border-top: 1px solid var(--adm-border-soft); font-size: .82rem; }
.chart-toggle button { padding: 0; border: 0; background: none; color: var(--bs-link-color); font-weight: 500; }

/* Jakaumat: ohut mittari rivin alla (sama sävy, vaaleampi raita) */
.meter-list { list-style: none; margin: 0; padding: .25rem 1.25rem 1rem; }
.meter-row { padding: .6rem 0; }
.meter-row + .meter-row { border-top: 1px solid var(--adm-border-soft); }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: .875rem; }
.meter-name { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-val { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--adm-muted); }
.meter-val strong { color: var(--adm-text); font-weight: 600; }
.meter { height: 8px; margin-top: .4rem; border-radius: 99px; background: #e6eefc; overflow: hidden; }
.meter > span { display: block; height: 100%; min-width: 4px; border-radius: 99px; background: #2462e9; }
.meter.is-sm { height: 6px; margin-top: .3rem; min-width: 60px; }
.meter-sub { display: flex; justify-content: space-between; gap: 1rem; margin-top: .3rem; font-size: .78rem; color: var(--adm-muted); font-variant-numeric: tabular-nums; }
.meter-name .rank { flex: none; }

/* KPI-ruudukko: 2 → 3 → 6 saraketta tilan mukaan (6 vasta kun otsikot mahtuvat yhdelle riville) */
.kpi-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1680px) { .kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.rank { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; background: #f2f4f7; color: var(--adm-muted); font-size: .72rem; font-weight: 700; }
.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--adm-muted); }
.empty-state-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: .75rem; border-radius: 16px; background: #eaf1fe; color: #2462e9; font-size: 1.3rem; }
.empty-state p { margin: 0 auto; max-width: 420px; }

/* Tuotteen muokkaus: kuvat ja vaaravyöhyke oikeassa palstassa (pysyy näkyvissä vieritettäessä) */
@media (min-width: 1200px) { .product-side { position: sticky; top: calc(var(--adm-topbar-h) + 1rem); } }
.pimg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.pimg { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #f2f4f7; box-shadow: 0 0 0 1px var(--adm-border); }
.pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pimg.is-main { grid-column: span 2; grid-row: span 2; }
.pimg-badge { position: absolute; left: .45rem; bottom: .45rem; padding: .15rem .5rem; border-radius: 99px; background: rgba(16, 24, 40, .72); color: #fff; font-size: .7rem; font-weight: 600; }
.pimg-action {
    position: absolute; top: .4rem; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .92);
    font-size: .8rem; box-shadow: 0 1px 3px rgba(16, 24, 40, .2); opacity: 0; transition: opacity .15s, background-color .15s;
}
.pimg:hover .pimg-action, .pimg-action:focus-visible { opacity: 1; }
@media (hover: none) { .pimg-action { opacity: 1; } }
.pimg-delete { right: .4rem; color: #b42318; }
.pimg-delete:hover { background: #fdecec; }
.pimg-set-main { left: .4rem; color: #9a5b00; }
.pimg-set-main:hover { background: #fff4e0; }
.pimg-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.75rem 1rem; margin-bottom: 1rem; border: 2px dashed var(--adm-border); border-radius: 12px; color: var(--adm-muted); font-size: .875rem; text-align: center; }
.pimg-empty i { font-size: 1.75rem; color: #98a2b3; }
.pimg-upload label { font-size: .85rem; }
.pimg-upload label:first-of-type { margin-top: 0; }
.danger-card .card-head h2 { color: #b42318; }

/* Tilastosivun suodatinrivi: pysyy yläpalkin alla vieritettäessä */
.stats-filters {
    position: sticky; top: var(--adm-topbar-h); z-index: 1010; display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem .75rem;
    margin: -.75rem -1.75rem 1rem; padding: .75rem 1.75rem; background: rgba(245, 247, 251, .92);
}
@supports (backdrop-filter: blur(8px)) { .stats-filters { backdrop-filter: blur(8px); } }
@media (max-width: 575.98px) { .stats-filters { position: static; margin: 0 0 1rem; padding: 0; background: none; } }
.stats-filters .filter { display: flex; flex-direction: column; gap: .25rem; margin: 0; font-weight: 400; }
.stats-filters .filter-label { font-size: .68rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--adm-muted); }
.stats-filters .form-select, .stats-filters .form-control { margin: 0; font-size: .875rem; padding-top: .35rem; padding-bottom: .35rem; min-height: 36px; }
.stats-filters input[type=date] { width: 150px; }
.stats-filters .filter-actions { margin-left: auto; display: flex; gap: .5rem; }
.stats-range-note { font-size: .82rem; color: var(--adm-muted); margin: 0 0 1.25rem; }
#stats-results { transition: opacity .15s; }
#stats-results.is-loading { opacity: .5; pointer-events: none; }

/* Tilauslistauksen haku */
.list-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--adm-border-soft); }
.list-filters label { margin: 0; font-weight: 400; }
.list-filters .search { position: relative; flex: 1 1 240px; max-width: 360px; }
.list-filters .search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--adm-muted); font-size: .85rem; pointer-events: none; }
.list-filters .search .form-control { padding-left: 2.1rem; }
.list-filters .form-select, .list-filters .form-control { font-size: .875rem; width: auto; margin: 0; }
.list-summary { padding: .75rem 1.25rem; font-size: .82rem; color: var(--adm-muted); border-top: 1px solid var(--adm-border-soft); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }

.admin-footer { display: flex; justify-content: center; align-items: center; gap: 1.5rem; padding: 1.25rem 0 1.5rem; }

/* ── Kaupan admin: etusivu, uutiset, toimipisteet ─────────── */
.home-sec-list { list-style: none; margin: .75rem 0 1rem; padding: 0; }
.home-sec-item { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.25rem; border-top: 1px solid var(--adm-border-soft, #eef0f3); transition: background .15s, opacity .15s; }
.home-sec-item:last-child { border-bottom: 1px solid var(--adm-border-soft, #eef0f3); }
.home-sec-item.is-off { background: #fafbfc; }
.home-sec-item.is-off .home-sec-icon, .home-sec-item.is-off .home-sec-text { opacity: .5; }
.home-sec-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: #eaf1fe; color: #2462e9; }
.home-sec-text { flex: 1 1 auto; min-width: 0; }
.home-sec-controls { display: flex; align-items: center; gap: .75rem; flex: none; }
.link-reset { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 575.98px) { .home-sec-item { flex-wrap: wrap; padding: .75rem 1rem; } .home-sec-controls { width: 100%; justify-content: space-between; } }

.home-cat-pick { display: flex; flex-direction: column; gap: .4rem; }
.home-cat-pick-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .45rem .6rem; border: 1px solid var(--adm-border, #e4e7ec); border-radius: .6rem; }
.home-cat-pick-row label { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.cat-icon-select { max-width: 11rem; }
.cat-icon-preview { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: #f2f4f7; color: #344054; font-size: .85rem; }

.hero-preview img { width: 100%; max-height: 180px; object-fit: cover; border-radius: .6rem; border: 1px solid var(--adm-border, #e4e7ec); }

.loc-admin-head { display: flex; align-items: center; gap: .85rem; width: 100%; padding: .9rem 1.1rem; background: none; border: 0; text-align: left; color: inherit; }
.loc-admin-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: #f2f4f7; color: #344054; }
.loc-admin-icon.is-service { background: #eaf1fe; color: #2462e9; }
.loc-admin-head[aria-expanded=true] .fa-chevron-down { transform: rotate(180deg); }

.featured-toggle { color: #c4cad4; font-size: 1rem; }
.featured-toggle.is-on, .featured-toggle:hover { color: #f5a524; }

/* ── Kampanjat: ilmoituspalkki ja alennetut hinnat ── */
.promo-bar { background: #111827; color: #fff; font-size: .9rem; }
.promo-bar-inner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .35rem 1rem; padding: .5rem 0; text-align: center; }
.promo-bar-pct { background: #e11d48; color: #fff; font-weight: 800; border-radius: 99px; padding: .05rem .6rem; letter-spacing: .02em; }
.promo-bar-text strong { letter-spacing: .02em; }
.promo-bar-countdown { color: #fbbf24; font-weight: 600; white-space: nowrap; }
.promo-bar-link { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.promo-bar-link:hover { color: #fbbf24; }
@media (max-width: 575.98px) { .promo-bar { font-size: .82rem; } .promo-bar-inner { gap: .25rem .6rem; padding: .45rem 0; } }

.product-card-sale { position: absolute; top: .6rem; right: .6rem; background: #e11d48; color: #fff; font-weight: 800; font-size: .78rem; border-radius: 99px; padding: .15rem .55rem; }
.product-card-price.is-sale, .product-price.is-sale { color: #e11d48; }
.price-list { color: var(--bs-secondary-color); font-weight: 400; font-size: .85em; margin-left: .35rem; }
.price-sale-badge { display: inline-block; background: #e11d48; color: #fff; font-weight: 800; font-size: .72rem; border-radius: 99px; padding: .1rem .5rem; vertical-align: .15em; }
.product-price .price-sale-badge { font-size: .8rem; margin-left: .35rem; }
.price-campaign-note { color: #be123c; font-size: .88rem; font-weight: 600; margin: -.25rem 0 .75rem; }

/* Kampanjat (admin) */
.campaign-status-running { background: #e7f6ec; color: #067647; }
.campaign-status-upcoming { background: #fff4e0; color: #9a5b00; }
.campaign-status-ended, .campaign-status-inactive { background: #eef1f4; color: #475467; }

/* Favicon ja jakokuva (admin/ulkoasu) */
.share-favicon-preview { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; border: 1px solid var(--adm-border, #e4e7ec); padding: 4px; background: #fff; }
.share-og-preview { display: block; width: 100%; max-width: 360px; aspect-ratio: 1.91 / 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--adm-border, #e4e7ec); }

/* Suomen kartta toimipisteille (pages/shop/locations.php, admin-valitsin) — pohja bytedev.fi:n konesalikartasta */
@keyframes fi-map-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
.loc-map-card { position: sticky; top: 1rem; }
.loc-map-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 1rem; }
.fi-map { max-width: 340px; margin: 0 auto; }
.fi-map-img { position: relative; }
.fi-map-img img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; filter: saturate(.6); }
.fi-map-pin { position: absolute; width: 0; height: 0; text-decoration: none; z-index: 1; }
.fi-map-pin:hover, .fi-map-pin:focus { z-index: 2; }
.fi-map-pin i, .fi-map-pin i::after { position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); }
.fi-map-pin i { background: var(--c-primary); box-shadow: 0 0 0 3px #fff, 0 4px 12px rgba(14, 23, 38, .3); }
.fi-map-pin i::after { content: ""; width: 100%; height: 100%; transform: none; background: var(--c-primary); animation: fi-map-pulse 2.4s ease-out infinite backwards; animation-delay: calc(var(--n, 0) * .6s); }
@media (prefers-reduced-motion: reduce) { .fi-map-pin i::after { animation: none; } }
.fi-map-pin b { position: absolute; top: 0; transform: translateY(-50%); white-space: nowrap; padding: 3px 9px; border-radius: 6px; background: #111827; color: #fff; font-size: .78rem; font-weight: 700; box-shadow: 0 4px 12px rgba(14, 23, 38, .2); }
.fi-map-pin.is-right b { left: 14px; }
.fi-map-pin.is-left b { right: 14px; }
.fi-map-pin:hover b, .fi-map-pin:focus b { background: var(--c-primary-d); }
.loc-card:target { box-shadow: 0 0 0 3px var(--c-primary), 0 8px 24px rgba(31, 41, 51, .1); }

/* Hallinnan karttavalitsin */
.loc-map-pick { display: flex; gap: 1rem; align-items: flex-start; }
.loc-map-pick .fi-map-img { width: 150px; flex: none; cursor: crosshair; border: 1px solid var(--adm-border, #e4e7ec); border-radius: 10px; background: #fff; overflow: hidden; }
.loc-map-pick .fi-map-pin { pointer-events: none; }
.loc-map-pick .fi-map-pin i::after { animation: none; }

/* Loppuunmyyty: tumma merkki kuvan päällä samaan tyyliin kuin kampanjan -% -merkki */
.product-card-soldout { position: absolute; left: .6rem; bottom: .6rem; background: #111827; color: #fff; font-weight: 800; font-size: .74rem; border-radius: 99px; padding: .2rem .6rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.product-card.is-soldout .product-card-img img, .product-card.is-soldout .product-placeholder { filter: grayscale(.85); opacity: .55; }
.product-card.is-soldout .product-card-price { color: var(--bs-secondary-color); }
.product-card-restock { color: #9a5b00; font-size: .8rem; font-weight: 600; margin-top: .25rem; }
.stock-badge { display: inline-flex; align-items: center; gap: .4rem; border-radius: 99px; padding: .3rem .8rem; font-weight: 700; font-size: .9rem; }
.stock-badge.is-in { background: #e7f6ec; color: #067647; }
.stock-badge.is-out { background: #111827; color: #fff; }
@media (max-width: 575.98px) { .product-card-soldout { font-size: .68rem; left: .45rem; bottom: .45rem; } }

/* Tilauksen muokkaus (admin/order_view.php) */
.order-edit-row > td { background: #f9fafb; }
.order-edit { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; padding: .5rem 0; }
@media (max-width: 767.98px) { .order-edit { grid-template-columns: 1fr; } }
.order-edit-box { background: #fff; border: 1px solid var(--adm-border, #e4e7ec); border-radius: 10px; padding: .9rem 1rem; }
.order-changes > li { padding: .85rem 1.1rem; border-top: 1px solid var(--adm-border-soft, #f0f2f6); }
.order-changes > li:first-child { border-top: 0; }
.order-change-pending { background: #fff4e0; color: #9a5b00; }
.order-change-accepted, .order-change-applied { background: #e7f6ec; color: #067647; }
.order-change-declined { background: #fbe9e7; color: #b3362b; }
.order-change-cancelled { background: #eef1f4; color: #475467; }
/* Asiakkaan vastaussivu */
.order-change-row { display: grid; grid-template-columns: 6rem 1fr auto; gap: .75rem; align-items: baseline; padding: .4rem 0; }
.order-change-row + .order-change-row { border-top: 1px solid var(--bs-border-color-translucent); }
.order-change-message { background: #f6f7f9; border-radius: .5rem; padding: .7rem .9rem; font-size: .92rem; }
