:root {
    --corporate-color: #460809;
    --corporate-colore: #B11F19;
    --highlight-color: #FFDF20;
    --text-color-light: #FFFFFF;
    --border-color: #FFFFFF;
}

* { box-sizing: border-box; }
html {
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    background: linear-gradient(120deg, #fff7e2, #ffffff 50%, #ffe8cf);
    color: #231f20;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

img, iframe {
    max-width: 100%;
}

.topbar {
    background: var(--corporate-color);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    z-index: 60;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    width: 64px;
    height: 64px;
    border: 2px solid #ffffff;
    border-radius: 12px;
    object-fit: contain;
}

.topbar nav a {
    color: #fff;
    text-decoration: none;
    margin: 4px 8px;
    display: inline-block;
    font-size: 14px;
}

.topbar nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.topbar .site-nav {
    display: flex;
}

.nav-toggle {
    display: none;
    width: 46px;
    min-width: 46px;
    height: 42px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 600;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 61;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
}

.nav-toggle-box {
    position: relative;
    width: 22px;
    height: 16px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-toggle-line {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    transition: transform 0.25s ease, opacity 0.2s ease;
    transform-origin: center;
}

.nav-toggle.is-open .nav-toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open .nav-toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(18, 6, 6, 0.45);
    z-index: 40;
}

.nav-overlay.is-visible {
    display: block;
}

.lang-form {
    display: inline-flex;
    align-items: center;
    margin: 0 6px;
}

.lang-form select {
    width: auto;
    min-width: 120px;
    padding: 6px 8px;
    margin: 0;
    border-radius: 6px;
}

.container {
    width: min(1100px, 100%);
    margin: auto;
    padding: 18px;
}

.card {
    background: #fff;
    border: 1px solid #f3d6b3;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 10px 20px rgba(70, 8, 9, 0.08);
    margin-bottom: 14px;
}

.grid4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { border: 1px solid #eee; padding: 8px; font-size: 14px; }

input, textarea, select, button {
    width: 100%;
    padding: 10px;
    margin: 6px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.topbar .nav-toggle {
    width: 46px;
    min-width: 46px;
    height: 42px;
    margin: 0;
    padding: 0;
}
button {
    background: var(--corporate-colore);
    color: #fff;
    border: none;
    cursor: pointer;
}
button:hover { background: var(--corporate-color); }

textarea {
    min-height: 120px;
    resize: vertical;
}

a {
    overflow-wrap: anywhere;
}

.flash {
    background: #fff4cc;
    border: 1px solid #f4cf55;
    color: #5a4000;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.footer {
    background: #111;
    color: #fff;
    text-align: center;
    padding: 14px;
}
.totop {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--highlight-color);
    color: #231f20;
    border: none;
}
.wa {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #1fa753;
    color: #fff;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 20px;
}
.chatbox {
    max-height: 280px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    background: #fefefe;
    margin-bottom: 10px;
}
.catalog { list-style: none; padding: 0; }
.catalog li { background: #fff; margin-bottom: 6px; padding: 10px; border-radius: 8px; }

.catalog-section {
    margin-top: 18px;
}

.catalog-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.catalog-section-head h3 {
    margin: 0;
    color: var(--corporate-color);
}

.catalog-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--highlight-color);
    color: #231f20;
    font-weight: 700;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.catalog-card {
    background: linear-gradient(180deg, #fffdf7 0%, #fff3df 100%);
    border: 1px solid #f2d2ab;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(70, 8, 9, 0.08);
}

.catalog-card-type {
    display: inline-block;
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(177, 31, 25, 0.1);
    color: var(--corporate-colore);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.catalog-card h4 {
    margin: 0 0 10px;
    font-size: 18px;
}

.catalog-price {
    margin: 0 0 14px;
    font-size: 24px;
    font-weight: 700;
    color: var(--corporate-color);
}

.catalog-link {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--corporate-colore);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.catalog-link:hover {
    background: var(--corporate-color);
}

.quote-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: #f2f2f2;
    color: #222;
    border: 1px solid #ccc;
    cursor: pointer;
}

.password-toggle:hover {
    background: #e6e6e6;
}

.budget-frame {
    width: 100%;
    min-height: 900px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
}

.auth {
    max-width: 520px;
    margin: 24px auto;
}

@media (max-width: 960px) {
    .container {
        padding: 16px;
    }

    .topbar {
        justify-content: center;
    }

    .topbar nav {
        width: 100%;
        justify-content: center;
    }

    .budget-frame {
        min-height: 70vh;
    }
}

@media (max-width: 720px) {
    body {
        font-size: 15px;
    }

    .topbar {
        padding: 12px;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .topbar .site-nav {
        display: none;
        width: min(320px, 86vw);
        height: 100dvh;
        margin: 0;
        padding: 72px 14px 18px;
        border-top: 0;
        justify-content: flex-start;
        position: fixed;
        top: 0;
        right: 0;
        z-index: 70;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        background: rgba(54, 10, 10, 0.98);
        border-radius: 0;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
    }

    .topbar .site-nav.is-open {
        display: flex;
        animation: navDrop 0.18s ease-out;
    }

    .topbar nav a {
        margin: 0;
        padding: 8px 10px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.12);
        text-align: left;
        width: 100%;
    }

    .nav-overlay.is-visible {
        display: block;
        z-index: 65;
    }

    .lang-form {
        width: 100%;
        justify-content: center;
        margin: 4px 0;
    }

    .lang-form select {
        width: 100%;
        min-width: 0;
        max-width: 260px;
    }

    .grid4,
    .catalog-grid,
    .quote-filter-grid {
        grid-template-columns: 1fr;
    }

    .table,
    .table thead,
    .table tbody,
    .table th,
    .table td,
    .table tr {
        display: block;
        width: 100%;
    }

    .table {
        border: 0;
        background: transparent;
    }

    .table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .table tbody {
        display: grid;
        gap: 12px;
    }

    .table tr {
        background: #fff;
        border: 1px solid #f0d9bd;
        border-radius: 14px;
        padding: 10px;
        box-shadow: 0 8px 18px rgba(70, 8, 9, 0.06);
    }

    .table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border: 0;
        border-bottom: 1px solid #f4e7d6;
        padding: 10px 4px;
        text-align: right;
        white-space: normal;
        word-break: break-word;
    }

    .table td:last-child {
        border-bottom: 0;
    }

    .table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        text-align: left;
        font-weight: 700;
        color: var(--corporate-color);
    }

    .table td form {
        width: 100%;
    }

    .table td .ticket-status-form + .ticket-status-form {
        margin-top: 8px;
    }

    .catalog-card,
    .card {
        padding: 14px;
    }

    .budget-frame {
        min-height: 60vh;
    }
}

@keyframes navDrop {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 480px) {
    .logo {
        width: 54px;
        height: 54px;
    }

    .container {
        padding: 12px;
    }

    .site-nav {
        justify-content: stretch;
    }

    .catalog-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .catalog-price {
        font-size: 22px;
    }

    .totop {
        right: 14px;
        bottom: 72px;
    }

    .wa {
        right: 14px;
        bottom: 16px;
        padding: 10px 12px;
    }

    .budget-frame {
        min-height: 420px;
    }
}
