#zatochka-calculator {
    --tc-accent: var(--z52-accent, #b11257);
    --tc-accent-hover: var(--z52-accent-hover, #cf1a64);
    --tc-accent-quiet: #9f174d;
    --tc-dark: var(--z52-dark, #080a0d);
    --tc-dark-soft: var(--z52-dark-soft, #141820);
    --tc-panel: var(--z52-dark-panel, #1d232c);
    --tc-light: var(--z52-light, #fff);
    --tc-light-soft: var(--z52-light-soft, #f5f6f8);
    --tc-border: var(--z52-border, #dfe3e8);
    --tc-border-dark: var(--z52-border-dark, rgba(255, 255, 255, 0.14));
    --tc-muted: var(--z52-muted, #667085);
    --tc-muted-light: var(--z52-muted-light, #b8c0cc);
    --tc-text: var(--z52-text, #171b22);
    --tc-radius: var(--z52-radius, 8px);
    --tc-radius-sm: var(--z52-radius-sm, 4px);
    --tc-shadow: var(--z52-shadow, 0 20px 60px rgba(5, 8, 12, 0.16));
    width: 100%;
    margin: 0 auto;
    color: var(--tc-text);
    font-family: var(--z52-font, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.z52-site:has(#zatochka-calculator),
.z52-default-page:has(#zatochka-calculator) {
    overflow: visible;
}

.z52-default-page__content:has(#zatochka-calculator) {
    max-width: var(--z52-container, 1180px);
    overflow: visible;
}

#zatochka-calculator *,
#zatochka-calculator *::before,
#zatochka-calculator *::after {
    box-sizing: border-box;
}

#zatochka-calculator button,
#zatochka-calculator input,
#zatochka-calculator select,
#zatochka-calculator textarea {
    font: inherit;
}

#zatochka-calculator h3,
#zatochka-calculator h4,
#zatochka-calculator p {
    margin-top: 0;
}

.tc-loading {
    display: grid;
    min-height: 320px;
    place-items: center;
    gap: 16px;
    padding: 52px 24px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    background: var(--tc-light);
    box-shadow: 0 14px 42px rgba(5, 8, 12, 0.06);
    text-align: center;
}

.tc-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid rgba(177, 18, 87, 0.14);
    border-top-color: var(--tc-accent);
    border-radius: 50%;
    animation: tc-spin 0.9s linear infinite;
}

.tc-loading-text {
    color: var(--tc-muted);
    font-size: 0.88rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@keyframes tc-spin {
    to {
        transform: rotate(360deg);
    }
}

.tc-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: flex-start;
    gap: 22px;
}

.tc-price-note {
    grid-column: 1 / -1;
    margin-top: -34px;
    padding: 18px 22px 16px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    background: var(--tc-light);
    box-shadow: 0 18px 46px rgba(5, 8, 12, 0.06);
    color: var(--tc-text);
}

.tc-price-note p {
    margin: 0 0 8px !important;
    color: var(--tc-text) !important;
    font-size: 0.9rem;
    line-height: 1.46;
}

.tc-price-note p:last-child {
    margin-bottom: 0 !important;
}

.tc-price-note p:nth-of-type(3) {
    color: var(--tc-text) !important;
    font-weight: 800;
}

.tc-price-note ul {
    margin: -2px 0 8px !important;
    padding-left: 20px !important;
    color: var(--tc-muted);
}

.tc-price-note li {
    margin-bottom: 4px;
    font-size: 0.9rem;
    line-height: 1.38;
}

.tc-price-note li::marker {
    color: var(--tc-accent);
}

.tc-services-panel,
.tc-cart-panel,
#tc-order-form {
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    background: var(--tc-light);
    box-shadow: 0 18px 46px rgba(5, 8, 12, 0.06);
}

.tc-services-panel {
    flex: 1 1 auto;
    min-width: 0;
    padding: 28px;
}

.tc-services-panel h3,
.tc-cart-panel h3,
#tc-order-form h4 {
    margin: 0 0 18px;
    color: var(--tc-text);
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: 850;
    line-height: 1.1;
}

.tc-search-wrapper {
    position: relative;
    margin-bottom: 18px;
}

#tc-search-input,
#tc-order-form input {
    width: 100%;
    min-height: 44px;
    padding: 11px 42px 11px 14px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    background: #fff;
    color: var(--tc-text);
    font-size: 0.95rem;
    outline: 0;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#tc-search-input:focus,
#tc-order-form input:focus {
    border-color: var(--tc-accent);
    box-shadow: 0 0 0 3px rgba(177, 18, 87, 0.14);
}

.tc-search-clear {
    position: absolute;
    top: 50%;
    right: 10px;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--tc-muted);
    cursor: pointer;
    line-height: 1;
}

.tc-search-clear:hover,
.tc-search-clear:focus {
    background: rgba(177, 18, 87, 0.08);
    color: var(--tc-accent);
}

#tc-search-title {
    margin: 10px 0 14px !important;
    color: var(--tc-muted) !important;
    font-size: 0.9rem;
    font-weight: 800;
}

.tc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tc-tab-btn {
    min-height: 40px;
    padding: 9px 13px !important;
    border: 1px solid var(--tc-border) !important;
    border-radius: var(--tc-radius-sm) !important;
    background: var(--tc-light-soft) !important;
    color: var(--tc-muted) !important;
    cursor: pointer;
    font-size: 0.86rem !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    text-align: left;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.tc-tab-btn:hover,
.tc-tab-btn:focus {
    border-color: rgba(177, 18, 87, 0.3) !important;
    background: rgba(177, 18, 87, 0.06) !important;
    color: var(--tc-accent) !important;
}

.tc-tab-btn.active {
    border-color: var(--tc-accent) !important;
    background: var(--tc-accent) !important;
    color: var(--tc-light) !important;
}

.tc-services-list {
    display: grid;
    gap: 10px;
}

.tc-service-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tc-service-item:hover {
    border-color: rgba(177, 18, 87, 0.28);
    box-shadow: 0 12px 28px rgba(5, 8, 12, 0.06);
    transform: translateY(-1px);
}

.tc-service-name {
    margin-bottom: 5px;
    color: var(--tc-text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
}

.tc-service-params {
    margin-bottom: 7px;
    color: var(--tc-muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.tc-service-category {
    color: var(--tc-accent);
    font-weight: 750;
}

.tc-service-price {
    color: var(--tc-accent-quiet);
    font-size: 1.05rem;
    font-weight: 850;
}

.tc-highlight {
    border-radius: 3px;
    background: rgba(177, 18, 87, 0.12);
    color: var(--tc-accent);
    font-weight: 800;
}

.tc-service-actions,
.tc-cart-controls {
    display: inline-flex !important;
    align-items: center;
    flex-shrink: 0;
    gap: 4px !important;
}

.tc-qty-btn,
.tc-cart-btn {
    display: grid !important;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    place-items: center;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--tc-border) !important;
    border-radius: var(--tc-radius-sm) !important;
    background: #fff !important;
    box-shadow: none !important;
    color: var(--tc-text) !important;
    cursor: pointer;
    font-size: 1.15rem !important;
    font-weight: 850 !important;
    line-height: 1 !important;
}

.tc-qty-btn:hover,
.tc-qty-btn:focus,
.tc-cart-btn:hover,
.tc-cart-btn:focus {
    border-color: var(--tc-accent) !important;
    color: var(--tc-accent) !important;
}

.tc-qty-input {
    width: 52px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--tc-border) !important;
    border-radius: var(--tc-radius-sm) !important;
    background: #fff !important;
    color: var(--tc-text) !important;
    font-weight: 850 !important;
    text-align: center !important;
    -moz-appearance: textfield;
}

.tc-qty-input:focus {
    border-color: var(--tc-accent) !important;
    box-shadow: 0 0 0 2px rgba(177, 18, 87, 0.14);
    outline: none;
}

.tc-qty-input::-webkit-outer-spin-button,
.tc-qty-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.tc-cart-panel {
    position: sticky !important;
    top: 150px !important;
    align-self: flex-start;
    z-index: 10;
    width: 380px;
    flex-shrink: 0;
    padding: 0;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.tc-cart-box,
#tc-order-form {
    padding: 24px;
}

.tc-cart-box {
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    background: var(--tc-light);
    box-shadow: 0 18px 46px rgba(5, 8, 12, 0.08);
    color: var(--tc-text);
}

.tc-cart-panel h3 {
    color: var(--tc-text);
}

.tc-cart-items {
    max-height: 300px;
    margin-bottom: 14px;
    padding-right: 8px;
    overflow-y: scroll;
    scrollbar-color: rgba(102, 112, 133, 0.48) rgba(102, 112, 133, 0.14);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 20px), rgba(0, 0, 0, 0.2) 100%);
    mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 20px), rgba(0, 0, 0, 0.2) 100%);
}

.tc-cart-items::-webkit-scrollbar {
    width: 7px;
}

.tc-cart-items::-webkit-scrollbar-track {
    background: rgba(102, 112, 133, 0.14);
    border-radius: 999px;
}

.tc-cart-items::-webkit-scrollbar-thumb {
    background: rgba(102, 112, 133, 0.48);
    border-radius: 999px;
}

.tc-empty-cart {
    margin: 0 0 14px !important;
    color: var(--tc-muted) !important;
    font-size: 0.92rem;
}

.tc-cart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--tc-border);
}

.tc-cart-title {
    display: block;
    margin-bottom: 4px;
    color: var(--tc-text);
    font-size: 0.86rem;
    font-weight: 750;
    line-height: 1.25;
}

.tc-cart-price {
    color: var(--tc-accent-quiet);
    font-size: 0.84rem;
    font-weight: 800;
}

.tc-cart-controls {
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    background: var(--tc-light-soft);
}

.tc-cart-btn {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--tc-text) !important;
}

.tc-cart-qty {
    min-width: 24px;
    color: var(--tc-text);
    font-size: 0.84rem;
    font-weight: 850;
    line-height: 28px;
    text-align: center;
}

.tc-totals {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--tc-border);
}

.tc-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--tc-muted);
    font-size: 0.92rem;
}

.tc-row.total {
    color: var(--tc-text);
    font-size: 1.08rem;
    font-weight: 850;
}

.tc-action-group {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

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

.tc-btn {
    display: inline-flex !important;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0 !important;
    padding: 12px 16px !important;
    border: 1px solid transparent !important;
    border-radius: var(--tc-radius-sm) !important;
    box-shadow: none !important;
    cursor: pointer;
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    letter-spacing: 0;
    line-height: 1.1 !important;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tc-btn.primary {
    background: var(--tc-accent) !important;
    color: var(--tc-light) !important;
}

.tc-btn.primary:hover,
.tc-btn.primary:focus {
    background: var(--tc-accent-hover) !important;
    color: var(--tc-light) !important;
    transform: translateY(-1px);
}

.tc-btn.secondary {
    width: auto;
    background: var(--tc-light-soft) !important;
    border-color: var(--tc-border) !important;
    color: var(--tc-text) !important;
}

.tc-btn.secondary:hover,
.tc-btn.secondary:focus {
    border-color: rgba(177, 18, 87, 0.32) !important;
    background: rgba(177, 18, 87, 0.06) !important;
    color: var(--tc-accent) !important;
}

.tc-btn.secondary.outline {
    background: transparent !important;
    border-color: var(--tc-border) !important;
    color: var(--tc-muted) !important;
    font-size: 0.82rem !important;
}

.tc-btn.secondary.outline:hover:not(:disabled),
.tc-btn.secondary.outline:focus:not(:disabled) {
    border-color: var(--tc-accent-hover) !important;
    color: var(--tc-accent) !important;
    background: rgba(177, 18, 87, 0.06) !important;
}

.tc-btn:disabled {
    cursor: not-allowed !important;
    opacity: 0.62;
    transform: none !important;
}

.tc-hidden {
    display: none;
}

#tc-order-form {
    margin-top: 16px;
    background: var(--tc-light);
}

#tc-order-form h4 {
    color: var(--tc-text);
}

#tc-order-form input {
    margin-bottom: 12px;
    padding-right: 14px;
}

#tc-phone-input {
    border-radius: var(--tc-radius-sm) !important;
    border-color: var(--tc-border) !important;
    background: #fff !important;
    color: var(--tc-text) !important;
    font-family: inherit !important;
    letter-spacing: 0;
}

#tc-phone-input:focus {
    border-color: var(--tc-accent) !important;
    box-shadow: 0 0 0 3px rgba(177, 18, 87, 0.14);
}

#tc-order-form label {
    display: block;
    margin: 4px 0 8px !important;
    color: var(--tc-muted);
    font-size: 0.84rem !important;
    font-weight: 750 !important;
    line-height: 1.35;
}

.tc-agreement {
    margin: 8px 0 18px;
    color: var(--tc-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.tc-agreement label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    margin: 0 !important;
    cursor: pointer;
}

.tc-agreement input[type="checkbox"] {
    width: 16px !important;
    min-width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    accent-color: var(--tc-accent);
}

.tc-agreement a {
    color: var(--tc-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.tc-form-actions {
    display: grid;
    grid-template-columns: 0.7fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.tc-form-actions .tc-btn {
    height: auto;
}

.tc-error {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid rgba(220, 53, 69, 0.24);
    border-radius: var(--tc-radius-sm);
    background: rgba(220, 53, 69, 0.1);
    color: #b42318;
    font-size: 0.86rem;
    text-align: center;
}

#tc-message {
    margin-top: 12px;
}

.tc-no-results {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 54px 20px;
    border: 1px dashed var(--tc-border);
    border-radius: var(--tc-radius);
    background: var(--tc-light-soft);
    color: var(--tc-muted);
    text-align: center;
}

.tc-no-results-icon {
    font-size: 2.25rem;
    filter: grayscale(1);
    opacity: 0.38;
}

.tc-no-results-title {
    color: var(--tc-text);
    font-size: 1.08rem;
    font-weight: 850;
}

.tc-no-results-desc {
    font-size: 0.92rem;
}

.tc-no-results-btn {
    min-height: 38px;
    padding: 9px 18px;
    border: 1px solid var(--tc-accent);
    border-radius: var(--tc-radius-sm);
    background: transparent;
    color: var(--tc-accent);
    cursor: pointer;
    font-weight: 850;
}

.tc-no-results-btn:hover,
.tc-no-results-btn:focus {
    background: var(--tc-accent);
    color: var(--tc-light);
}

.tc-success {
    text-align: center;
    padding: 42px 28px !important;
    border: 1px solid rgba(55, 132, 91, 0.24);
    border-radius: var(--tc-radius) !important;
    background: rgba(55, 132, 91, 0.08) !important;
    color: #276749 !important;
}

.tc-success h3 {
    margin-top: 0;
}

.tc-success-note {
    color: var(--tc-muted);
    font-size: 0.92rem;
}

@media screen and (max-width: 1080px) {
    .tc-container {
        display: grid;
        grid-template-columns: 1fr;
    }

    .tc-cart-panel {
        position: static;
        width: 100%;
        transform: none !important;
    }
}

@media screen and (max-width: 720px) {
    .tc-price-note {
        margin-top: -18px;
        padding: 16px 18px;
    }

    .tc-services-panel {
        padding: 20px;
    }

    .tc-tabs {
        flex-wrap: nowrap;
        margin-right: -14px;
        padding-bottom: 6px;
        overflow-x: auto;
    }

    .tc-tab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .tc-service-item {
        grid-template-columns: 1fr;
    }

    .tc-service-actions {
        justify-content: flex-end;
        width: 100%;
    }

    .tc-cart-box,
    #tc-order-form {
        padding: 20px;
    }

    .tc-alt-actions,
    .tc-form-actions {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    #zatochka-calculator {
        width: 100%;
    }

    .tc-service-actions {
        justify-content: stretch;
    }

    .tc-qty-input {
        flex: 1 1 auto;
        width: auto !important;
    }
}
