.hffc-cart,
.hffc-cart * {
    box-sizing: border-box;
}

.hffc-cart {
    --hffc-button-x: 22px;
    --hffc-button-y: 22px;
    --hffc-drawer-width: 390px;
    --hffc-z: 99999;
    --hffc-button-bg: #111;
    --hffc-button-color: #fff;
    --hffc-accent: #111;
    --hffc-drawer-bg: #fff;
    --hffc-drawer-color: #111;
    --hffc-muted: #777;
    --hffc-radius: 18px;
    font-family: inherit;
}

.hffc-toggle {
    position: fixed;
    z-index: var(--hffc-z);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 12px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--hffc-button-bg);
    color: var(--hffc-button-color);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    line-height: 1;
    transition: transform .18s ease, opacity .18s ease;
    -webkit-tap-highlight-color: transparent;
}

.hffc-toggle:hover {
    transform: translateY(-1px);
    opacity: .94;
}

.hffc-toggle:active {
    transform: translateY(0);
}

.hffc-pos-bottom-right .hffc-toggle { right: var(--hffc-button-x); bottom: var(--hffc-button-y); }
.hffc-pos-bottom-left .hffc-toggle { left: var(--hffc-button-x); bottom: var(--hffc-button-y); }
.hffc-pos-top-right .hffc-toggle { right: var(--hffc-button-x); top: var(--hffc-button-y); }
.hffc-pos-top-left .hffc-toggle { left: var(--hffc-button-x); top: var(--hffc-button-y); }

.hffc-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hffc-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    color: currentColor;
    font-size: 13px;
    font-weight: 800;
}

.hffc-total {
    white-space: nowrap;
}

.hffc-overlay {
    position: fixed;
    inset: 0;
    z-index: calc(var(--hffc-z) + 1);
    background: rgba(0,0,0,.38);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.hffc-no-overlay .hffc-overlay {
    display: none;
}

.hffc-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: calc(var(--hffc-z) + 2);
    width: min(var(--hffc-drawer-width), 100vw);
    max-width: 100vw;
    background: var(--hffc-drawer-bg);
    color: var(--hffc-drawer-color);
    display: flex;
    flex-direction: column;
    transform: translateX(110%);
    transition: transform .24s ease;
    visibility: hidden;
}

.hffc-side-right .hffc-drawer {
    right: 0;
    border-radius: var(--hffc-radius) 0 0 var(--hffc-radius);
    transform: translateX(110%);
}

.hffc-side-left .hffc-drawer {
    left: 0;
    border-radius: 0 var(--hffc-radius) var(--hffc-radius) 0;
    transform: translateX(-110%);
}

.hffc-has-shadow .hffc-drawer,
.hffc-has-shadow .hffc-toggle {
    box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

.hffc-cart.is-open .hffc-overlay {
    opacity: 1;
    visibility: visible;
}

.hffc-cart.is-open .hffc-drawer {
    transform: translateX(0);
    visibility: visible;
}

.hffc-drawer-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 14px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.hffc-title {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.15;
}

.hffc-subtitle {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--hffc-muted);
    font-size: 14px;
}

.hffc-subtitle .hffc-count {
    min-width: auto;
    height: auto;
    padding: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
}

.hffc-close,
.hffc-remove {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.hffc-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0,0,0,.06);
    font-size: 28px;
}

.hffc-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px 16px;
    -webkit-overflow-scrolling: touch;
}

.hffc-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hffc-empty {
    padding: 28px 12px;
    text-align: center;
    color: var(--hffc-muted);
    font-size: 16px;
}

.hffc-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    background: rgba(0,0,0,.018);
}

.hffc-thumb {
    width: 72px;
    height: 72px;
    border-radius: 13px;
    overflow: hidden;
    background: rgba(0,0,0,.05);
}

.hffc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hffc-item-main {
    min-width: 0;
}

.hffc-item-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    justify-content: space-between;
}

.hffc-item-name {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.hffc-item-name a {
    color: inherit;
    text-decoration: none;
}

.hffc-remove {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(0,0,0,.06);
    color: var(--hffc-muted);
    font-size: 18px;
}

.hffc-variation {
    margin-top: 5px;
    color: var(--hffc-muted);
    font-size: 12px;
    line-height: 1.3;
}

.hffc-variation dl,
.hffc-variation dt,
.hffc-variation dd,
.hffc-variation p {
    margin: 0;
    display: inline;
}

.hffc-item-bottom {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hffc-qty {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 999px;
    background: #fff;
}

.hffc-qty button {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.hffc-qty-input {
    width: 34px;
    height: 30px;
    padding: 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    text-align: center;
    font: inherit;
    font-size: 14px;
    background: transparent;
    color: inherit;
    -moz-appearance: textfield;
}

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

.hffc-price {
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.hffc-footer {
    flex: 0 0 auto;
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(0,0,0,.08);
    background: var(--hffc-drawer-bg);
}

.hffc-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 16px;
}

.hffc-footer-row strong {
    font-size: 19px;
}

.hffc-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    border-radius: 999px;
    background: var(--hffc-accent);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 800;
    transition: opacity .18s ease, transform .18s ease;
}

.hffc-checkout:hover {
    opacity: .92;
    transform: translateY(-1px);
}

.hffc-loading {
    pointer-events: none;
    opacity: .6;
}

.hffc-added-flash {
    animation: hffcPulse .45s ease;
}

@keyframes hffcPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.025); }
    100% { transform: scale(1); }
}



.hffc-loading-cart .hffc-items {
    position: relative;
    min-height: 76px;
}

.hffc-loading-cart .hffc-items::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 28px;
    width: 28px;
    height: 28px;
    margin-left: -14px;
    border-radius: 50%;
    border: 3px solid rgba(0,0,0,.12);
    border-top-color: var(--hffc-accent);
    animation: hffcSpin .7s linear infinite;
}

.hffc-count-bump .hffc-toggle,
.hffc-count-bump .hffc-count {
    animation: hffcPulse .42s ease;
}

.hffc-native-button-added,
.hffc-native-button-error {
    position: relative !important;
    overflow: hidden !important;
}

.hffc-native-button-added::after,
.hffc-native-button-error::after {
    content: attr(data-hffc-label);
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    background: inherit;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    line-height: inherit;
    pointer-events: none;
}

.hffc-native-button-added::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    background: rgba(255,255,255,.18);
    transform: translateX(-100%);
    animation: hffcButtonSweep .65s ease;
    pointer-events: none;
}

.hffc-native-button-error::after {
    background: #c62828;
    color: #fff;
}

.hffc-toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 2147483647;
    transform: translate(-50%, 18px) scale(.96);
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(17,17,17,.94);
    color: #fff;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    box-shadow: 0 12px 34px rgba(0,0,0,.22);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    pointer-events: none;
}

.hffc-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0) scale(1);
}

.hffc-fly-dot {
    position: fixed;
    z-index: 2147483646;
    width: 46px;
    height: 46px;
    margin: 0;
    border-radius: 50%;
    overflow: hidden;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hffc-button-bg, #111);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(0,0,0,.24);
    pointer-events: none;
}

.hffc-fly-dot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hffc-fly-fallback {
    animation: hffcFlyFallback .65s ease forwards;
}

@keyframes hffcSpin {
    to { transform: rotate(360deg); }
}

@keyframes hffcButtonSweep {
    to { transform: translateX(100%); }
}

@keyframes hffcFlyFallback {
    to { transform: translate(-50%, -120%) scale(.25); opacity: 0; }
}

@media (max-width: 767px) {
    .hffc-toggle {
        min-height: 50px;
        padding: 11px 14px;
        gap: 7px;
    }

    .hffc-toggle-text {
        display: none;
    }

    .hffc-drawer {
        width: min(var(--hffc-drawer-width), 94vw);
        border-radius: 18px 0 0 18px;
    }

    .hffc-side-left .hffc-drawer {
        border-radius: 0 18px 18px 0;
    }

    .hffc-drawer-head {
        padding: 18px 16px 12px;
    }

    .hffc-body {
        padding: 12px;
    }

    .hffc-footer {
        padding: 14px 16px 18px;
    }
}

/* v1.2.0: жесткий сброс стилей темы внутри корзины, чтобы Elementor/тема не красили кнопки и поля. */
.hffc-cart .hffc-drawer {
    font-family: inherit !important;
}

.hffc-cart .hffc-drawer button,
.hffc-cart .hffc-drawer input,
.hffc-cart .hffc-drawer a {
    box-shadow: none !important;
    text-shadow: none !important;
}

.hffc-cart .hffc-item {
    position: relative !important;
    grid-template-columns: 76px minmax(0, 1fr) !important;
    gap: 13px !important;
    padding: 12px 14px !important;
    min-height: 96px !important;
    align-items: center !important;
    background: #fff !important;
    border: 1px solid rgba(0,0,0,.08) !important;
    border-radius: 18px !important;
}

.hffc-cart .hffc-thumb {
    width: 76px !important;
    height: 76px !important;
    min-width: 76px !important;
    border-radius: 16px !important;
}

.hffc-cart .hffc-item-main {
    min-width: 0 !important;
    width: 100% !important;
    padding-right: 28px !important;
}

.hffc-cart .hffc-item-top {
    display: block !important;
    min-width: 0 !important;
}

.hffc-cart .hffc-item-name {
    max-width: 100% !important;
    padding-right: 0 !important;
    color: var(--hffc-drawer-color) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.24 !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
}

.hffc-cart button.hffc-remove {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    z-index: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(0,0,0,.06) !important;
    color: #555 !important;
    font-size: 20px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    transform: none !important;
}

.hffc-cart button.hffc-remove:hover {
    background: rgba(0,0,0,.12) !important;
    color: #111 !important;
}

.hffc-cart button.hffc-close {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(0,0,0,.06) !important;
    color: #111 !important;
    font-size: 32px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
}

.hffc-cart .hffc-item-bottom {
    margin-top: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    min-width: 0 !important;
}

.hffc-cart .hffc-qty {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 150px !important;
    height: 34px !important;
    overflow: hidden !important;
    border: 1px solid rgba(0,0,0,.12) !important;
    border-radius: 999px !important;
    background: #fff !important;
}

.hffc-cart .hffc-qty button,
.hffc-cart .hffc-qty span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 32px !important;
    min-width: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #111 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}

.hffc-cart input.hffc-qty-input,
.hffc-cart .hffc-qty .hffc-qty-input {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 54px !important;
    min-width: 54px !important;
    height: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: #111 !important;
    box-shadow: none !important;
    text-align: center !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 32px !important;
}

.hffc-cart .hffc-price {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    color: #111 !important;
    font-size: 15px !important;
    font-weight: 900 !important;
}

.hffc-cart .hffc-sync-badge {
    display: inline-flex !important;
    margin-top: 6px !important;
    padding: 4px 8px !important;
    border-radius: 999px !important;
    background: rgba(0,0,0,.06) !important;
    color: var(--hffc-muted) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}

.hffc-cart .hffc-item-optimistic {
    opacity: .86 !important;
    animation: hffcOptimisticIn .22s ease !important;
}

@keyframes hffcOptimisticIn {
    from { transform: translateY(-8px); opacity: 0; }
    to { transform: translateY(0); opacity: .86; }
}

@media (min-width: 768px) {
    .hffc-cart .hffc-drawer {
        width: min(var(--hffc-drawer-width), 460px) !important;
    }
}

@media (max-width: 480px) {
    .hffc-cart .hffc-drawer {
        width: 100vw !important;
        border-radius: 0 !important;
    }

    .hffc-cart .hffc-item {
        grid-template-columns: 68px minmax(0, 1fr) !important;
        padding: 11px !important;
    }

    .hffc-cart .hffc-thumb {
        width: 68px !important;
        height: 68px !important;
        min-width: 68px !important;
    }

    .hffc-cart .hffc-qty {
        min-width: 128px !important;
    }

    .hffc-cart .hffc-qty button,
    .hffc-cart .hffc-qty span {
        width: 34px !important;
        min-width: 34px !important;
    }

    .hffc-cart input.hffc-qty-input,
    .hffc-cart .hffc-qty .hffc-qty-input {
        width: 46px !important;
        min-width: 46px !important;
    }
}

/* v1.3.0: checkout waits until background add-to-cart request is saved in WooCommerce session. */
.hffc-cart.hffc-checkout-waiting .hffc-checkout,
.hffc-cart.hffc-has-pending-add .hffc-checkout {
    position: relative !important;
    pointer-events: auto !important;
    opacity: .88 !important;
}

.hffc-cart.hffc-checkout-waiting .hffc-checkout::after,
.hffc-cart.hffc-has-pending-add .hffc-checkout::after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    animation: hffcSpin .7s linear infinite;
}


/* v1.4.0: визуальный конструктор + изоляция от темы/Elementor. Этот блок специально идет последним. */
.hffc-cart.hffc-isolated,
.hffc-cart.hffc-isolated * {
    box-sizing: border-box !important;
}

.hffc-cart.hffc-isolated {
    font-family: inherit !important;
    line-height: 1.3 !important;
    color: var(--hffc-drawer-color) !important;
}

.hffc-cart.hffc-isolated :where(button, a, input, span, div, aside) {
    font-family: inherit !important;
}

.hffc-cart.hffc-isolated button,
.hffc-cart.hffc-isolated input,
.hffc-cart.hffc-isolated a {
    appearance: none !important;
    -webkit-appearance: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    outline: none !important;
}

.hffc-cart.hffc-isolated a,
.hffc-cart.hffc-isolated a:hover,
.hffc-cart.hffc-isolated a:focus,
.hffc-cart.hffc-isolated a:visited {
    text-decoration: none !important;
}

.hffc-cart.hffc-isolated .hffc-toggle {
    all: unset;
    box-sizing: border-box !important;
    position: fixed !important;
    z-index: var(--hffc-z) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: var(--hffc-button-gap) !important;
    min-height: calc((var(--hffc-button-py) * 2) + var(--hffc-button-icon-size)) !important;
    padding: var(--hffc-button-py) var(--hffc-button-px) !important;
    border: 0 !important;
    border-radius: var(--hffc-button-radius) !important;
    background: var(--hffc-button-bg) !important;
    color: var(--hffc-button-color) !important;
    cursor: pointer !important;
    font-size: var(--hffc-button-font-size) !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    transition: transform .18s ease, opacity .18s ease, background-color .18s ease, color .18s ease !important;
    -webkit-tap-highlight-color: transparent !important;
}

.hffc-cart.hffc-isolated .hffc-toggle:hover {
    background: var(--hffc-button-hover-bg) !important;
    color: var(--hffc-button-hover-color) !important;
    opacity: 1 !important;
    transform: translateY(-1px) !important;
}

.hffc-cart.hffc-isolated .hffc-toggle-icon,
.hffc-cart.hffc-isolated .hffc-toggle-icon svg {
    width: var(--hffc-button-icon-size) !important;
    height: var(--hffc-button-icon-size) !important;
    min-width: var(--hffc-button-icon-size) !important;
    color: currentColor !important;
    display: inline-flex !important;
}

.hffc-cart.hffc-hide-icon .hffc-toggle-icon {
    display: none !important;
}

.hffc-cart.hffc-isolated .hffc-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: var(--hffc-count-size) !important;
    height: var(--hffc-count-size) !important;
    padding: 0 8px !important;
    border-radius: 999px !important;
    background: var(--hffc-count-bg) !important;
    color: var(--hffc-count-color) !important;
    font-size: calc(var(--hffc-button-font-size) * .86) !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

.hffc-cart.hffc-isolated .hffc-drawer-head .hffc-count,
.hffc-cart.hffc-isolated .hffc-subtitle .hffc-count {
    min-width: auto !important;
    height: auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit !important;
    font-size: inherit !important;
}

.hffc-cart.hffc-isolated .hffc-total {
    color: currentColor !important;
    white-space: nowrap !important;
}

.hffc-cart.hffc-isolated .hffc-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: calc(var(--hffc-z) + 1) !important;
    background: var(--hffc-overlay-bg) !important;
}

.hffc-cart.hffc-isolated .hffc-drawer {
    position: fixed !important;
    top: var(--hffc-drawer-top) !important;
    bottom: var(--hffc-drawer-bottom) !important;
    z-index: calc(var(--hffc-z) + 2) !important;
    width: min(var(--hffc-drawer-width), 100vw) !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    height: auto !important;
    background: var(--hffc-drawer-bg) !important;
    color: var(--hffc-drawer-color) !important;
    border: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.hffc-cart.hffc-side-right.hffc-isolated .hffc-drawer {
    right: 0 !important;
    left: auto !important;
    border-radius: var(--hffc-drawer-radius) 0 0 var(--hffc-drawer-radius) !important;
}

.hffc-cart.hffc-side-left.hffc-isolated .hffc-drawer {
    left: 0 !important;
    right: auto !important;
    border-radius: 0 var(--hffc-drawer-radius) var(--hffc-drawer-radius) 0 !important;
}

.hffc-cart.hffc-has-shadow.hffc-isolated .hffc-drawer {
    box-shadow: 0 22px 70px rgba(0,0,0,.22) !important;
}

.hffc-cart.hffc-has-shadow.hffc-isolated .hffc-toggle {
    box-shadow: 0 16px 46px rgba(0,0,0,.20) !important;
}

.hffc-cart.hffc-isolated .hffc-drawer-head {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    padding: var(--hffc-header-padding) !important;
    border-bottom: 1px solid var(--hffc-border-color) !important;
    background: var(--hffc-header-bg) !important;
    color: var(--hffc-drawer-color) !important;
}

.hffc-cart.hffc-isolated .hffc-title {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--hffc-drawer-color) !important;
    font-size: var(--hffc-title-size) !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
}

.hffc-cart.hffc-isolated .hffc-subtitle {
    margin-top: 5px !important;
    color: var(--hffc-muted) !important;
    font-size: var(--hffc-subtitle-size) !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
}

.hffc-cart.hffc-isolated button.hffc-close {
    all: unset;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: var(--hffc-remove-bg) !important;
    color: var(--hffc-remove-color) !important;
    cursor: pointer !important;
    font-size: 32px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
}

.hffc-cart.hffc-isolated button.hffc-close:hover {
    background: var(--hffc-remove-hover-bg) !important;
    color: var(--hffc-remove-hover-color) !important;
}

.hffc-cart.hffc-isolated .hffc-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding: var(--hffc-body-padding) !important;
    background: var(--hffc-drawer-bg) !important;
    -webkit-overflow-scrolling: touch !important;
}

.hffc-cart.hffc-isolated .hffc-items {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--hffc-item-gap) !important;
}

.hffc-cart.hffc-isolated .hffc-empty {
    padding: 28px 12px !important;
    text-align: center !important;
    color: var(--hffc-muted) !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
}

.hffc-cart.hffc-isolated .hffc-item {
    display: grid !important;
    grid-template-columns: var(--hffc-thumb-size) minmax(0, 1fr) !important;
    gap: 13px !important;
    min-height: calc(var(--hffc-thumb-size) + (var(--hffc-item-padding) * 2)) !important;
    align-items: center !important;
    padding: var(--hffc-item-padding) !important;
    border: 1px solid var(--hffc-item-border-color) !important;
    border-radius: var(--hffc-item-radius) !important;
    background: var(--hffc-item-bg) !important;
    color: var(--hffc-drawer-color) !important;
    position: relative !important;
}

.hffc-cart.hffc-isolated .hffc-thumb {
    width: var(--hffc-thumb-size) !important;
    min-width: var(--hffc-thumb-size) !important;
    height: var(--hffc-thumb-size) !important;
    border-radius: var(--hffc-thumb-radius) !important;
    overflow: hidden !important;
    background: rgba(0,0,0,.05) !important;
}

.hffc-cart.hffc-isolated .hffc-thumb img,
.hffc-cart.hffc-isolated .hffc-img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
}

.hffc-cart.hffc-isolated .hffc-item-main {
    min-width: 0 !important;
    width: 100% !important;
    padding-right: calc(var(--hffc-remove-size) + 8px) !important;
}

.hffc-cart.hffc-isolated .hffc-item-top {
    display: block !important;
    min-width: 0 !important;
}

.hffc-cart.hffc-isolated .hffc-item-name,
.hffc-cart.hffc-isolated .hffc-item-name a {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--hffc-item-title-color) !important;
    font-size: var(--hffc-item-title-size) !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
}

.hffc-cart.hffc-isolated .hffc-variation {
    margin-top: 5px !important;
    color: var(--hffc-muted) !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
}

.hffc-cart.hffc-isolated button.hffc-remove {
    all: unset;
    box-sizing: border-box !important;
    position: absolute !important;
    top: var(--hffc-item-padding) !important;
    right: var(--hffc-item-padding) !important;
    z-index: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--hffc-remove-size) !important;
    min-width: var(--hffc-remove-size) !important;
    height: var(--hffc-remove-size) !important;
    border-radius: 50% !important;
    background: var(--hffc-remove-bg) !important;
    color: var(--hffc-remove-color) !important;
    cursor: pointer !important;
    font-size: calc(var(--hffc-remove-size) * .78) !important;
    font-weight: 500 !important;
    line-height: 1 !important;
}

.hffc-cart.hffc-isolated button.hffc-remove:hover {
    background: var(--hffc-remove-hover-bg) !important;
    color: var(--hffc-remove-hover-color) !important;
}

.hffc-cart.hffc-isolated .hffc-item-bottom {
    margin-top: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    min-width: 0 !important;
}

.hffc-cart.hffc-isolated .hffc-qty {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--hffc-qty-width) !important;
    min-width: 0 !important;
    height: var(--hffc-qty-height) !important;
    overflow: hidden !important;
    border: 1px solid var(--hffc-qty-border-color) !important;
    border-radius: var(--hffc-qty-radius) !important;
    background: var(--hffc-qty-bg) !important;
    color: var(--hffc-qty-color) !important;
}

.hffc-cart.hffc-isolated .hffc-qty button,
.hffc-cart.hffc-isolated .hffc-qty span {
    all: unset;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34% !important;
    height: 100% !important;
    cursor: pointer !important;
    color: var(--hffc-qty-color) !important;
    font-size: calc(var(--hffc-qty-font-size) + 3px) !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

.hffc-cart.hffc-isolated input.hffc-qty-input,
.hffc-cart.hffc-isolated .hffc-qty .hffc-qty-input {
    all: unset;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32% !important;
    height: 100% !important;
    color: var(--hffc-qty-color) !important;
    text-align: center !important;
    font-size: var(--hffc-qty-font-size) !important;
    font-weight: 800 !important;
    line-height: var(--hffc-qty-height) !important;
    -moz-appearance: textfield !important;
}

.hffc-cart.hffc-isolated input.hffc-qty-input::-webkit-inner-spin-button,
.hffc-cart.hffc-isolated input.hffc-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.hffc-cart.hffc-isolated .hffc-price {
    flex: 0 0 auto !important;
    color: var(--hffc-price-color) !important;
    font-size: var(--hffc-price-size) !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
}

.hffc-cart.hffc-isolated .hffc-footer {
    flex: 0 0 auto !important;
    padding: var(--hffc-footer-padding) !important;
    border-top: 1px solid var(--hffc-border-color) !important;
    background: var(--hffc-footer-bg) !important;
    color: var(--hffc-drawer-color) !important;
}

.hffc-cart.hffc-isolated .hffc-footer-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    color: var(--hffc-drawer-color) !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
}

.hffc-cart.hffc-isolated .hffc-footer-row strong,
.hffc-cart.hffc-isolated .hffc-footer-row .hffc-total {
    color: var(--hffc-total-color) !important;
    font-size: var(--hffc-total-font-size) !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
}

.hffc-cart.hffc-isolated .hffc-checkout,
.hffc-cart.hffc-isolated a.hffc-checkout,
.hffc-cart.hffc-isolated a.hffc-checkout:visited {
    all: unset;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: var(--hffc-checkout-height) !important;
    height: var(--hffc-checkout-height) !important;
    border: 0 !important;
    border-radius: var(--hffc-checkout-radius) !important;
    background: var(--hffc-accent) !important;
    color: var(--hffc-checkout-color) !important;
    cursor: pointer !important;
    font-size: var(--hffc-checkout-font-size) !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: transform .18s ease, background-color .18s ease, color .18s ease, opacity .18s ease !important;
}

.hffc-cart.hffc-isolated .hffc-checkout:hover,
.hffc-cart.hffc-isolated a.hffc-checkout:hover,
.hffc-cart.hffc-isolated .hffc-checkout:focus {
    background: var(--hffc-checkout-hover-bg) !important;
    color: var(--hffc-checkout-hover-color) !important;
    transform: translateY(-1px) !important;
    opacity: 1 !important;
}

.hffc-cart.hffc-preset-minimal {
    --hffc-button-bg: #ffffff;
    --hffc-button-color: #111111;
    --hffc-button-hover-bg: #f4f4f4;
    --hffc-button-hover-color: #111111;
    --hffc-drawer-bg: #ffffff;
    --hffc-item-bg: #ffffff;
    --hffc-accent: #111111;
}

.hffc-cart.hffc-preset-dark {
    --hffc-button-bg: #161616;
    --hffc-button-color: #ffffff;
    --hffc-button-hover-bg: #2b2b2b;
    --hffc-drawer-bg: #151515;
    --hffc-drawer-color: #ffffff;
    --hffc-header-bg: #151515;
    --hffc-footer-bg: #151515;
    --hffc-item-bg: #202020;
    --hffc-item-border-color: #303030;
    --hffc-item-title-color: #ffffff;
    --hffc-price-color: #ffffff;
    --hffc-muted: #bbbbbb;
    --hffc-border-color: #303030;
    --hffc-qty-bg: #151515;
    --hffc-qty-color: #ffffff;
    --hffc-qty-border-color: #444444;
    --hffc-remove-bg: #303030;
    --hffc-remove-color: #ffffff;
    --hffc-remove-hover-bg: #444444;
    --hffc-accent: #ffffff;
    --hffc-checkout-color: #111111;
    --hffc-checkout-hover-bg: #f0f0f0;
    --hffc-checkout-hover-color: #111111;
    --hffc-total-color: #ffffff;
    --hffc-count-bg: #ffffff;
    --hffc-count-color: #111111;
}

@media (max-width: 767px) {
    .hffc-cart.hffc-hide-text-mobile .hffc-toggle-text,
    .hffc-cart.hffc-hide-text-mobile .hffc-toggle .hffc-total {
        display: none !important;
    }

    .hffc-cart.hffc-isolated .hffc-toggle {
        min-height: calc((var(--hffc-button-py) * 2) + var(--hffc-button-icon-size)) !important;
    }

    .hffc-cart.hffc-mobile-full.hffc-isolated .hffc-drawer {
        top: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
    }

    .hffc-cart.hffc-mobile-boxed.hffc-isolated .hffc-drawer {
        width: min(var(--hffc-drawer-width), 94vw) !important;
    }

    .hffc-cart.hffc-isolated .hffc-item {
        grid-template-columns: min(var(--hffc-thumb-size), 72px) minmax(0, 1fr) !important;
    }

    .hffc-cart.hffc-isolated .hffc-thumb {
        width: min(var(--hffc-thumb-size), 72px) !important;
        min-width: min(var(--hffc-thumb-size), 72px) !important;
        height: min(var(--hffc-thumb-size), 72px) !important;
    }
}

@media (max-width: 767px) {
    .hffc-cart.hffc-show-text-mobile.hffc-isolated .hffc-toggle-text {
        display: inline-flex !important;
    }
}

/* v1.5.0: final Elementor positioning and style controls win over theme/previous reset rules. */
.hffc-cart.hffc-pos-bottom-right .hffc-toggle,
.hffc-cart.hffc-isolated.hffc-pos-bottom-right .hffc-toggle {
    right: var(--hffc-button-x) !important;
    bottom: var(--hffc-button-y) !important;
    left: auto !important;
    top: auto !important;
}

.hffc-cart.hffc-pos-bottom-left .hffc-toggle,
.hffc-cart.hffc-isolated.hffc-pos-bottom-left .hffc-toggle {
    left: var(--hffc-button-x) !important;
    bottom: var(--hffc-button-y) !important;
    right: auto !important;
    top: auto !important;
}

.hffc-cart.hffc-pos-top-right .hffc-toggle,
.hffc-cart.hffc-isolated.hffc-pos-top-right .hffc-toggle {
    right: var(--hffc-button-x) !important;
    top: var(--hffc-button-y) !important;
    left: auto !important;
    bottom: auto !important;
}

.hffc-cart.hffc-pos-top-left .hffc-toggle,
.hffc-cart.hffc-isolated.hffc-pos-top-left .hffc-toggle {
    left: var(--hffc-button-x) !important;
    top: var(--hffc-button-y) !important;
    right: auto !important;
    bottom: auto !important;
}

.hffc-cart.hffc-isolated .hffc-toggle {
    width: var(--hffc-button-width) !important;
    min-width: var(--hffc-button-min-width) !important;
    height: var(--hffc-button-height) !important;
    border: var(--hffc-button-border-width) solid var(--hffc-button-border-color) !important;
}

.hffc-cart.hffc-isolated .hffc-drawer {
    border: var(--hffc-drawer-border-width) solid var(--hffc-drawer-border-color) !important;
}

.hffc-cart.hffc-isolated.hffc-side-right .hffc-drawer {
    right: 0 !important;
    left: auto !important;
}

.hffc-cart.hffc-isolated.hffc-side-left .hffc-drawer {
    left: 0 !important;
    right: auto !important;
}

.hffc-cart.hffc-isolated button.hffc-close {
    width: var(--hffc-close-size) !important;
    min-width: var(--hffc-close-size) !important;
    height: var(--hffc-close-size) !important;
    background: var(--hffc-close-bg) !important;
    color: var(--hffc-close-color) !important;
    font-size: calc(var(--hffc-close-size) * .76) !important;
}

.hffc-cart.hffc-isolated button.hffc-close:hover {
    background: var(--hffc-close-hover-bg) !important;
    color: var(--hffc-close-hover-color) !important;
}

.hffc-cart.hffc-isolated .hffc-checkout,
.hffc-cart.hffc-isolated a.hffc-checkout,
.hffc-cart.hffc-isolated a.hffc-checkout:visited {
    margin-top: var(--hffc-checkout-margin-top) !important;
    padding-left: var(--hffc-checkout-px) !important;
    padding-right: var(--hffc-checkout-px) !important;
    border: var(--hffc-checkout-border-width) solid var(--hffc-checkout-border-color) !important;
}

/* keep Elementor editor preview clickable and positioned */
.elementor-editor-active .hffc-cart .hffc-toggle,
.elementor-editor-preview .hffc-cart .hffc-toggle {
    pointer-events: auto !important;
}

/* v2.2.0: оформление заказа без верхней таблицы корзины + нормальная ширина desktop. */
body.hffc-optimized-checkout .woocommerce > .woocommerce-cart-form,
body.hffc-optimized-checkout .woocommerce > .cart-collaterals,
body.hffc-optimized-checkout .woocommerce .cart-collaterals,
body.hffc-optimized-checkout .woocommerce-cart-form {
    display: none !important;
}

/* Некоторые темы/Elementor держат страницу checkout в узком контейнере.
   На странице оформления расширяем только контент WooCommerce, не трогая шапку. */
body.hffc-optimized-checkout #primary,
body.hffc-optimized-checkout #main,
body.hffc-optimized-checkout main.site-main,
body.hffc-optimized-checkout .site-main,
body.hffc-optimized-checkout .content-area,
body.hffc-optimized-checkout .entry-content,
body.hffc-optimized-checkout .page-content,
body.hffc-optimized-checkout .elementor-widget-woocommerce-checkout-page,
body.hffc-optimized-checkout .elementor-widget-woocommerce-checkout-page > .elementor-widget-container,
body.hffc-optimized-checkout .woocommerce {
    width: 100% !important;
    max-width: none !important;
}

body.hffc-optimized-checkout .woocommerce {
    box-sizing: border-box !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

body.hffc-optimized-checkout form.checkout.woocommerce-checkout,
body.hffc-optimized-checkout form.checkout {
    width: min(1180px, calc(100vw - 40px)) !important;
    max-width: 1180px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: grid !important;
    grid-template-columns: minmax(560px, 1fr) minmax(380px, 460px) !important;
    gap: 32px !important;
    align-items: start !important;
    box-sizing: border-box !important;
}

body.hffc-optimized-checkout form.checkout #customer_details {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 100% !important;
    min-width: 0 !important;
}

body.hffc-optimized-checkout form.checkout #order_review_heading {
    grid-column: 2 !important;
    grid-row: 1 !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    font-size: 24px !important;
    line-height: 1.2 !important;
}

body.hffc-optimized-checkout form.checkout #order_review {
    grid-column: 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 18px !important;
    border: 1px solid rgba(0,0,0,.08) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 14px 40px rgba(0,0,0,.07) !important;
}

body.hffc-optimized-checkout #customer_details,
body.hffc-optimized-checkout .woocommerce-billing-fields,
body.hffc-optimized-checkout .woocommerce-additional-fields,
body.hffc-optimized-checkout .woocommerce-shipping-fields {
    padding: 0 !important;
    margin: 0 !important;
}

body.hffc-optimized-checkout #customer_details.col2-set,
body.hffc-optimized-checkout #customer_details .col-1,
body.hffc-optimized-checkout #customer_details .col-2,
body.hffc-optimized-checkout .woocommerce .col2-set .col-1,
body.hffc-optimized-checkout .woocommerce .col2-set .col-2 {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    clear: both !important;
}

body.hffc-optimized-checkout #customer_details {
    background: #fff !important;
    border: 1px solid rgba(0,0,0,.08) !important;
    border-radius: 18px !important;
    padding: 24px !important;
    box-shadow: 0 14px 40px rgba(0,0,0,.05) !important;
}

body.hffc-optimized-checkout .woocommerce-billing-fields > h3,
body.hffc-optimized-checkout .woocommerce-additional-fields > h3,
body.hffc-optimized-checkout #order_review_heading {
    font-weight: 900 !important;
    color: #222 !important;
}

body.hffc-optimized-checkout form.checkout input.input-text,
body.hffc-optimized-checkout form.checkout textarea,
body.hffc-optimized-checkout form.checkout select {
    width: 100% !important;
    min-height: 46px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0,0,0,.24) !important;
    box-shadow: none !important;
    padding: 10px 12px !important;
    background: #fff !important;
}

body.hffc-optimized-checkout form.checkout .form-row {
    margin-bottom: 16px !important;
}

body.hffc-optimized-checkout table.shop_table.woocommerce-checkout-review-order-table {
    margin: 0 0 16px !important;
    border: 0 !important;
    border-collapse: collapse !important;
    width: 100% !important;
}

body.hffc-optimized-checkout table.shop_table.woocommerce-checkout-review-order-table th,
body.hffc-optimized-checkout table.shop_table.woocommerce-checkout-review-order-table td {
    border: 0 !important;
    border-bottom: 1px solid rgba(0,0,0,.08) !important;
    padding: 10px 0 !important;
    vertical-align: top !important;
}

body.hffc-optimized-checkout #payment,
body.hffc-optimized-checkout .woocommerce-checkout-payment {
    background: transparent !important;
    border-radius: 0 !important;
}

body.hffc-optimized-checkout #place_order {
    width: 100% !important;
    min-height: 52px !important;
    border-radius: 999px !important;
    background: #111 !important;
    color: #fff !important;
    font-weight: 900 !important;
    border: 0 !important;
    box-shadow: none !important;
}

@media (max-width: 1024px) {
    body.hffc-optimized-checkout form.checkout.woocommerce-checkout,
    body.hffc-optimized-checkout form.checkout {
        width: min(940px, calc(100vw - 32px)) !important;
        grid-template-columns: minmax(0, 1fr) minmax(320px, 380px) !important;
        gap: 22px !important;
    }
}

@media (max-width: 820px) {
    body.hffc-optimized-checkout .woocommerce {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    body.hffc-optimized-checkout form.checkout.woocommerce-checkout,
    body.hffc-optimized-checkout form.checkout {
        width: calc(100vw - 24px) !important;
        display: block !important;
    }

    body.hffc-optimized-checkout #customer_details {
        padding: 16px !important;
        border-radius: 16px !important;
    }

    body.hffc-optimized-checkout form.checkout #order_review {
        margin-top: 18px !important;
        padding: 14px !important;
        border-radius: 16px !important;
    }
}

/* v2.3.0: Жесткий full-width режим для checkout, если Elementor/тема держит форму в узком контейнере. */
body.hffc-optimized-checkout {
    overflow-x: hidden !important;
}

body.hffc-optimized-checkout .elementor,
body.hffc-optimized-checkout .elementor-section,
body.hffc-optimized-checkout .elementor-container,
body.hffc-optimized-checkout .elementor-column,
body.hffc-optimized-checkout .elementor-widget-wrap,
body.hffc-optimized-checkout .elementor-widget,
body.hffc-optimized-checkout .elementor-widget-container,
body.hffc-optimized-checkout .elementor-shortcode,
body.hffc-optimized-checkout .entry-content,
body.hffc-optimized-checkout .page-content,
body.hffc-optimized-checkout #content,
body.hffc-optimized-checkout #primary,
body.hffc-optimized-checkout #main,
body.hffc-optimized-checkout main,
body.hffc-optimized-checkout article,
body.hffc-optimized-checkout .site-content,
body.hffc-optimized-checkout .content-area {
    overflow: visible !important;
}

body.hffc-optimized-checkout .elementor-section.elementor-section-boxed > .elementor-container,
body.hffc-optimized-checkout .elementor-container,
body.hffc-optimized-checkout .elementor-column.elementor-col-100,
body.hffc-optimized-checkout .elementor-column[data-col="100"],
body.hffc-optimized-checkout .elementor-widget-woocommerce-checkout-page,
body.hffc-optimized-checkout .elementor-widget-shortcode {
    width: 100% !important;
    max-width: none !important;
}

body.hffc-optimized-checkout .woocommerce {
    position: relative !important;
    left: 50% !important;
    right: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    margin-left: -50vw !important;
    margin-right: 0 !important;
    padding: 28px 24px 60px !important;
    box-sizing: border-box !important;
    transform: none !important;
    clear: both !important;
}

body.hffc-optimized-checkout .woocommerce-notices-wrapper,
body.hffc-optimized-checkout form.checkout.woocommerce-checkout,
body.hffc-optimized-checkout form.checkout {
    width: 100% !important;
    max-width: 1180px !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

@media (min-width: 821px) {
    body.hffc-optimized-checkout form.checkout.woocommerce-checkout,
    body.hffc-optimized-checkout form.checkout {
        display: grid !important;
        grid-template-columns: minmax(560px, 1fr) minmax(420px, 480px) !important;
        gap: 32px !important;
        align-items: start !important;
    }

    body.hffc-optimized-checkout form.checkout #customer_details,
    body.hffc-optimized-checkout form.checkout .hffc-checkout-customer,
    body.hffc-optimized-checkout form.checkout > #customer_details {
        grid-column: 1 !important;
        grid-row: 1 / span 2 !important;
    }

    body.hffc-optimized-checkout form.checkout #order_review_heading {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: end !important;
        width: 100% !important;
    }

    body.hffc-optimized-checkout form.checkout #order_review {
        grid-column: 2 !important;
        grid-row: 2 !important;
        width: 100% !important;
        max-width: none !important;
    }
}

@media (max-width: 820px) {
    body.hffc-optimized-checkout .woocommerce {
        left: 50% !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        margin-left: -50vw !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* v2.4.0: оформление заказа прямо внутри выезжающей корзины */
.hffc-cart .hffc-popup-checkout {
    display: none;
    padding: var(--hffc-body-padding, 16px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    background: var(--hffc-drawer-bg, #fff);
}

.hffc-cart.hffc-checkout-step .hffc-body,
.hffc-cart.hffc-checkout-step .hffc-footer {
    display: none !important;
}

.hffc-cart.hffc-checkout-step .hffc-popup-checkout {
    display: block !important;
}

.hffc-cart.hffc-checkout-success .hffc-popup-checkout-form,
.hffc-cart.hffc-checkout-success .hffc-popup-checkout-head {
    display: none !important;
}

.hffc-cart .hffc-popup-success {
    display: none;
    min-height: 64vh;
    padding: 34px 18px;
    text-align: center;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.hffc-cart.hffc-checkout-success .hffc-popup-success {
    display: flex !important;
}

.hffc-cart .hffc-popup-checkout-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
}

.hffc-cart button.hffc-popup-back,
.hffc-cart.hffc-isolated button.hffc-popup-back {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: var(--hffc-close-bg, #f3f3f3) !important;
    color: var(--hffc-close-color, #111) !important;
    font-size: 34px !important;
    font-weight: 400 !important;
    line-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.hffc-cart .hffc-popup-title {
    font-size: var(--hffc-title-size, 22px);
    font-weight: 900;
    line-height: 1.15;
    color: var(--hffc-drawer-color, #111);
}

.hffc-cart .hffc-popup-subtitle {
    margin-top: 3px;
    color: var(--hffc-muted, #777);
    font-size: 13px;
    line-height: 1.25;
}

.hffc-cart .hffc-popup-checkout-form {
    display: block;
    margin: 0;
    padding: 0;
}

.hffc-cart .hffc-popup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.hffc-cart .hffc-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    margin: 0 !important;
    color: var(--hffc-muted, #777) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.hffc-cart .hffc-field-full {
    grid-column: 1 / -1;
}

.hffc-cart .hffc-field input,
.hffc-cart .hffc-field textarea,
.hffc-cart.hffc-isolated .hffc-field input,
.hffc-cart.hffc-isolated .hffc-field textarea {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 100% !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    border: 1px solid var(--hffc-border-color, #e5e5e5) !important;
    border-radius: 14px !important;
    background: #fff !important;
    color: var(--hffc-drawer-color, #111) !important;
    font: inherit !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    box-shadow: none !important;
    outline: none !important;
    resize: vertical !important;
}

.hffc-cart .hffc-field input:focus,
.hffc-cart .hffc-field textarea:focus {
    border-color: var(--hffc-accent, #111) !important;
    box-shadow: 0 0 0 3px rgba(0,0,0,.07) !important;
}

.hffc-cart .hffc-popup-order {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--hffc-border-color, #eee);
    border-radius: var(--hffc-item-radius, 18px);
    background: var(--hffc-item-bg, #fff);
}

.hffc-cart .hffc-popup-order-title {
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: 900;
    color: var(--hffc-drawer-color, #111);
}

.hffc-cart .hffc-popup-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--hffc-border-color, #eee);
    align-items: start;
}

.hffc-cart .hffc-popup-order-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.hffc-cart .hffc-popup-order-row-name {
    min-width: 0;
    color: var(--hffc-drawer-color, #111);
    font-size: 14px;
    line-height: 1.25;
}

.hffc-cart .hffc-popup-order-row-name strong {
    display: block;
    font-weight: 800;
}

.hffc-cart .hffc-popup-order-row-name span,
.hffc-cart .hffc-popup-order-row-name em {
    display: inline-block;
    margin-top: 4px;
    margin-right: 6px;
    color: var(--hffc-muted, #777);
    font-style: normal;
    font-size: 12px;
}

.hffc-cart .hffc-popup-order-row-price {
    white-space: nowrap;
    color: var(--hffc-price-color, #111);
    font-size: 14px;
    font-weight: 900;
}

.hffc-cart .hffc-popup-order-total .hffc-footer-row {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--hffc-border-color, #eee);
}

.hffc-cart .hffc-popup-message {
    display: none;
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.hffc-cart .hffc-popup-message.is-error,
.hffc-cart .hffc-popup-message.is-success {
    display: block;
}

.hffc-cart .hffc-popup-message.is-error {
    background: #fff0f0;
    color: #b00020;
    border: 1px solid rgba(176,0,32,.16);
}

.hffc-cart .hffc-popup-message.is-success {
    background: #f2fbf5;
    color: #0f7a35;
    border: 1px solid rgba(15,122,53,.16);
}

.hffc-cart button.hffc-submit-order,
.hffc-cart.hffc-isolated button.hffc-submit-order {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: var(--hffc-checkout-height, 52px) !important;
    margin: 16px 0 0 !important;
    padding: 0 var(--hffc-checkout-px, 18px) !important;
    border: var(--hffc-checkout-border-width, 0) solid var(--hffc-checkout-border-color, transparent) !important;
    border-radius: var(--hffc-checkout-radius, 999px) !important;
    background: var(--hffc-accent, #111) !important;
    color: var(--hffc-checkout-color, #fff) !important;
    font-size: var(--hffc-checkout-font-size, 16px) !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-align: center !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: transform .18s ease, opacity .18s ease, background-color .18s ease, color .18s ease !important;
}

.hffc-cart button.hffc-submit-order:hover {
    background: var(--hffc-checkout-hover-bg, #2a2a2a) !important;
    color: var(--hffc-checkout-hover-color, #fff) !important;
    transform: translateY(-1px) !important;
}

.hffc-cart.hffc-order-submitting button.hffc-submit-order {
    pointer-events: none !important;
    opacity: .82 !important;
}

.hffc-cart.hffc-order-submitting button.hffc-submit-order::after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    animation: hffcSpin .7s linear infinite;
}

.hffc-cart .hffc-popup-success-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 900;
}

.hffc-cart .hffc-popup-success-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--hffc-drawer-color, #111);
    line-height: 1.15;
}

.hffc-cart .hffc-popup-success-text {
    margin: 10px auto 18px;
    max-width: 320px;
    color: var(--hffc-muted, #777);
    font-size: 15px;
    line-height: 1.45;
}

.hffc-cart .hffc-popup-success-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--hffc-accent, #111);
    color: var(--hffc-checkout-color, #fff) !important;
    font-weight: 800;
    text-decoration: none !important;
}

@media (min-width: 768px) {
    .hffc-cart.hffc-checkout-step .hffc-drawer {
        width: min(max(var(--hffc-drawer-width), 520px), 620px) !important;
    }
}

@media (max-width: 480px) {
    .hffc-cart .hffc-popup-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }
}
