:root {
    --bg: #f3f7fb;
    --paper: #ffffff;
    --text: #182132;
    --muted: #64748b;
    --primary: #0b4f8a;
    --primary-strong: #083a66;
    --line: #d7e2ee;
    --radius: 16px;
    --shadow-soft: 0 10px 30px rgba(11, 36, 71, 0.08);
    --shadow-hover: 0 18px 38px rgba(11, 36, 71, 0.15);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background:
            radial-gradient(900px 240px at 10% -120px, rgba(15, 106, 184, 0.18), transparent 70%),
            radial-gradient(900px 260px at 90% -120px, rgba(11, 79, 138, 0.18), transparent 70%),
            var(--bg);
    color: var(--text);
    transition: opacity 0.25s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.mobile-menu-open {
    overflow: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.22s ease;
}

a:hover {
    color: var(--primary-strong);
}

.container {
    width: min(1160px, 92%);
    margin: 0 auto;
}

.brand-title {
    font-size: 20px;
    letter-spacing: 0.2px;
    color: #0f172a;
    font-weight: 700;
}

.phone {
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
}

.nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.nav-row {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 11px 0;
}

.minimal-nav {
    border-radius: 0 0 16px 16px;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid #cfdbe8;
    border-radius: 10px;
    background: #fff;
    padding: 9px 8px;
    cursor: pointer;
}

.mobile-toggle-line {
    display: block;
    height: 2px;
    background: #1f2937;
    border-radius: 2px;
    margin: 5px 0;
}

.logo-mark {
    width: 56px;
    height: 56px;
    padding: 6px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #c6d3e1;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
    object-fit: contain;
    filter: saturate(1.35) contrast(1.12) brightness(1.12);
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.nav-links a {
    padding: 8px 12px;
    border-radius: 999px;
    color: #334155;
}

.nav-links a:hover {
    background: #eef5fb;
    color: #0b4f8a;
}

.head-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d0deec;
    border-radius: 999px;
    padding: 8px 12px;
    background: #f8fbff;
    color: #24364b;
    transition: all 0.2s ease;
}

.chip:hover {
    background: #ebf3fb;
}

.chip.active {
    border-color: #0b4f8a;
    background: #0b4f8a;
    color: #fff;
}

main.container {
    padding-top: 22px;
    flex: 1 0 auto;
}

section {
    margin-bottom: 20px;
}

.hero {
    margin: 8px 0 20px;
    padding: 34px;
    border-radius: calc(var(--radius) + 2px);
    color: #fff;
    background:
            linear-gradient(130deg, #0a3662 0%, #0c4f8b 56%, #1887d8 100%);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -40px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.11);
}

.hero-home {
    min-height: 520px;
    display: flex;
    align-items: flex-end;
    background-image:
            linear-gradient(105deg, rgba(6, 28, 51, 0.64) 0%, rgba(8, 52, 91, 0.24) 44%, rgba(9, 78, 137, 0.02) 80%);
    background-size: cover;
    background-position: center;
}

.hero-home::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: image-set(
            url("/images/hero-main.png") 1x,
            url("/images/hero-main-2x.png") 2x,
            url("/images/hero-main-3x.png") 3x
    );
    background-size: cover;
    background-position: 72% center;
    background-repeat: no-repeat;
    image-rendering: -webkit-optimize-contrast;
    filter: contrast(1.08) saturate(1.06);
    z-index: 0;
}

.hero-panel {
    max-width: 640px;
    padding: 24px;
    border-radius: 14px;
    background: rgba(8, 24, 41, 0.62);
    backdrop-filter: blur(2px);
    z-index: 2;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 44px);
}

.hero p {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.9);
}

.cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

h1, h2 {
    letter-spacing: -0.2px;
}

.cards-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin: 14px 0 26px;
}

.info-card,
.product-card,
.admin-grid section,
.login-box {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.glass {
    background: linear-gradient(165deg, #ffffff 0%, #f8fbff 100%);
}

.info-card {
    padding: 18px;
}

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

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-card img {
    width: 100%;
    height: 196px;
    object-fit: cover;
    background: #e5e7eb;
}

.product-content {
    padding: 14px 15px 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-content h3 {
    min-height: 2.6em;
    margin: 10px 0 8px;
}

.product-content p {
    min-height: 4.8em;
    margin: 0;
}

.badge {
    display: inline-block;
    font-size: 12px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #e0effc;
    color: #0a4a80;
    font-weight: 600;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

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

.btn.primary {
    background: linear-gradient(130deg, #0f67b7, #0b4f8a);
    color: #fff;
    box-shadow: 0 8px 20px rgba(10, 92, 168, 0.3);
}

.btn.primary:hover {
    box-shadow: 0 12px 24px rgba(10, 92, 168, 0.34);
}

.btn.secondary {
    border-color: #d0deec;
    background: #f8fbff;
    color: #24364b;
}

.btn.secondary:hover {
    background: #ecf4fc;
}

.btn.danger {
    background: #dc2626;
    color: #fff;
}

.btn.tg {
    background: #229ed9;
    color: #fff;
}

.filters {
    display: grid;
    grid-template-columns: 2fr auto auto;
    gap: 10px;
    margin: 18px 0;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow-soft);
}

.filter-panel {
    padding: 14px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.why-us-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

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

.filters input,
.filters select,
.admin-form input,
.admin-form textarea,
.login-box input,
.inline-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cad8e6;
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #88bce9;
    box-shadow: 0 0 0 3px rgba(70, 136, 193, 0.15);
}

.warning {
    background: #fff8e6;
    border: 1px solid #f2cf6e;
    border-radius: 12px;
    padding: 11px 14px;
}

footer {
    margin-top: auto;
    background: #0d1d30;
    color: #d7e5f3;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
    padding: 6px 0;
}

footer a,
footer .muted {
    color: #bdd0e3;
}

.muted {
    color: var(--muted);
    margin: 4px 0 0;
}

.messengers {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.map-wrap iframe {
    width: 100%;
    height: 380px;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.admin-header {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.admin-top-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-link {
    white-space: nowrap;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 22px 0 28px;
}

.admin-grid section {
    padding: 18px;
}

.admin-grid .btn {
    white-space: nowrap;
}

.full-width {
    grid-column: 1 / -1;
}

.admin-form {
    display: grid;
    gap: 10px;
}

.admin-form label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 14px;
}

.inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border-bottom: 1px solid #dce6f1;
    padding: 10px 8px;
    text-align: left;
}

th {
    color: #3d5169;
    font-weight: 600;
    background: #f7fbff;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-box {
    width: min(430px, 92%);
    padding: 24px;
}

.login-box form {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.error {
    color: #b91c1c;
}

.text-page {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.text-page ul {
    padding-left: 18px;
    line-height: 1.65;
}

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-lift {
    animation: liftIn 0.6s ease both;
}

.page-loader {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: transparent;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    animation: loaderAutoHide 0.45s ease 2.4s forwards;
}

.page-loader.is-hidden {
    animation: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-shell {
    --orbit-size: 134px;
    --orbit-radius: 67px;
    width: 134px;
    height: 134px;
    position: relative;
}

.loader-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
}

.loader-orbit {
    position: relative;
    width: var(--orbit-size);
    height: var(--orbit-size);
    border-radius: 50%;
    border: 2px dashed rgba(126, 159, 194, 0.8);
}

.loader-orbit::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px solid rgba(189, 211, 234, 0.75);
}

.loader-fura {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    animation: orbitTruck 2s linear infinite;
}

.loader-fura img {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36px;
    height: auto;
    display: block;
    transform: translate(-50%, calc(-1 * var(--orbit-radius) - 4px)) rotate(0deg);
    transform-origin: center center;
    animation: truckCounter 2s linear infinite;
    filter: drop-shadow(0 3px 4px rgba(15, 23, 42, 0.28));
}

.page-fade-out {
    opacity: 0.86;
}

@keyframes liftIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes orbitTruck {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes truckCounter {
    from { transform: translate(-50%, calc(-1 * var(--orbit-radius) - 4px)) rotate(0deg); }
    to { transform: translate(-50%, calc(-1 * var(--orbit-radius) - 4px)) rotate(-360deg); }
}

@keyframes loaderAutoHide {
    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

@media (max-width: 980px) {
    .filters {
        grid-template-columns: 1fr;
    }

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

    .head-actions {
        width: 100%;
        justify-content: space-between;
    }

    .hero-home {
        min-height: 440px;
    }

    .hero-panel {
        padding: 18px;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        width: min(100%, 94%);
    }

    .mobile-toggle {
        display: block;
    }

    .nav-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo toggle"
            "links links"
            "actions actions";
        align-items: center;
        row-gap: 10px;
    }

    .logo-link {
        grid-area: logo;
    }

    .mobile-toggle {
        grid-area: toggle;
        justify-self: end;
    }

    .nav-links,
    .head-actions {
        display: none;
    }

    .nav-row.open .nav-links,
    .nav-row.open .head-actions {
        display: flex;
    }

    .nav-links {
        grid-area: links;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 6px;
    }

    .nav-links a {
        border-radius: 10px;
        background: #f6f9fd;
    }

    .head-actions {
        grid-area: actions;
        width: 100%;
        justify-content: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .head-actions .chip,
    .head-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .brand-title {
        font-size: 18px;
    }

    .logo-mark {
        width: 48px;
        height: 48px;
        padding: 4px;
    }

    .hero {
        padding: 20px;
    }

    .hero-home {
        min-height: 360px;
        background-position: right center;
    }

    .hero-home::after {
        background-position: 66% center;
    }

    .hero h1 {
        font-size: clamp(24px, 7vw, 32px);
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .favorites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .catalog-grid .product-content {
        padding: 10px;
    }

    .favorites-grid .product-content {
        padding: 10px;
    }

    .catalog-grid .product-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .favorites-grid .product-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .catalog-grid .product-actions strong {
        font-size: 14px;
        line-height: 1.2;
    }

    .favorites-grid .product-actions strong {
        font-size: 14px;
        line-height: 1.2;
    }

    .catalog-grid .like-btn {
        width: 100%;
        font-size: 12px;
        padding: 8px 10px;
        white-space: normal;
    }

    .favorites-grid .like-btn {
        width: 100%;
        font-size: 12px;
        padding: 8px 10px;
        white-space: normal;
    }

    .product-card img {
        height: 180px;
    }

    .product-content h3,
    .product-content p {
        min-height: 0;
    }

    .filters {
        padding: 10px;
    }

    .filters .btn.primary {
        width: 100%;
    }

    .filters .btn.secondary {
        width: auto;
        justify-self: start;
        padding: 8px 12px;
        font-size: 13px;
    }

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

    .admin-header .nav-row {
        display: flex;
    }

    .admin-top-actions {
        width: 100%;
    }

    .admin-top-actions > * {
        width: 100%;
    }

    .inline-form {
        width: 100%;
    }

    .inline-form input,
    .inline-form button {
        width: 100%;
    }
}

@media (max-width: 576px) {
    main.container {
        padding-top: 14px;
    }

    .hero-home {
        min-height: 320px;
    }

    .hero-home::after {
        background-position: 62% center;
    }

    .hero-panel {
        padding: 14px;
    }

    .cta-row {
        flex-direction: column;
    }

    .cta-row .btn {
        width: 100%;
    }

    .product-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .like-btn {
        width: 100%;
        white-space: normal;
        font-size: 12px;
        padding: 8px 10px;
    }

    .warning {
        font-size: 14px;
    }

    th, td {
        padding: 8px 6px;
        font-size: 13px;
    }

    .loader-shell {
        --orbit-size: 110px;
        --orbit-radius: 55px;
        width: 110px;
        height: 110px;
    }

    .loader-orbit {
        width: 110px;
        height: 110px;
    }

    .loader-logo {
        width: 52px;
        height: 52px;
    }

}

@media (max-width: 420px) {
    .brand-title {
        font-size: 16px;
    }

    .logo-mark {
        width: 42px;
        height: 42px;
    }

    .hero {
        padding: 14px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .product-card img {
        height: 160px;
    }

    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .favorites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .catalog-grid .product-content {
        padding: 8px;
    }

    .favorites-grid .product-content {
        padding: 8px;
    }

    .catalog-grid .badge {
        font-size: 10px;
        padding: 4px 8px;
    }

    .favorites-grid .badge {
        font-size: 10px;
        padding: 4px 8px;
    }

    .catalog-grid .product-content h3 {
        font-size: 16px;
        margin: 8px 0 6px;
    }

    .favorites-grid .product-content h3 {
        font-size: 16px;
        margin: 8px 0 6px;
    }

    .catalog-grid .product-content p {
        font-size: 13px;
    }

    .favorites-grid .product-content p {
        font-size: 13px;
    }

    .btn {
        padding: 9px 12px;
        font-size: 14px;
    }
}
