.emci-root,
.emci-root * {
    box-sizing: border-box;
}

.emci-root {
    font-family: Poppins, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: #111827;
}

.emci-floating-cart {
    position: fixed;
    z-index: 999998;
    width: 66px;
    height: 66px;
    border: 0;
    border-radius: 999px;
    background: var(--emci-primary);
    color: var(--emci-primary-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 34px rgba(17, 24, 39, .2), 0 8px 18px rgba(248, 79, 137, .26);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.emci-floating-cart:hover,
.emci-floating-cart:focus {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 20px 40px rgba(17, 24, 39, .25), 0 10px 22px rgba(248, 79, 137, .32);
    outline: none;
}

.emci-cart-icon svg,
.emci-mobile-icon svg,
.emci-btn-icon svg {
    display: block;
}

.emci-floating-count,
.emci-mobile-count {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--emci-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    border: 2px solid #fff;
    line-height: 1;
}

.emci-mobile-bar {
    display: none;
}

.emci-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}

.emci-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.emci-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .44);
    backdrop-filter: blur(3px);
}

.emci-drawer {
    position: absolute;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: min(calc(100% - 32px), var(--emci-modal-width));
    height: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -18px 0 50px rgba(0, 0, 0, .18);
    transform: translateX(calc(100% + 32px));
    transition: transform .24s ease;
    overflow: hidden;
}

.emci-desktop-left .emci-drawer {
    right: auto;
    left: 16px;
    transform: translateX(calc(-100% - 32px));
    box-shadow: 18px 0 50px rgba(0, 0, 0, .18);
}

.emci-overlay.is-open .emci-drawer {
    transform: translateX(0);
}

.emci-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 22px 22px 14px;
    border-bottom: 1px solid #eef0f4;
}

.emci-header h2 {
    margin: 2px 0 0;
    font-size: 19px;
    line-height: 1.22;
    font-weight: 800;
    color: #111827;
}

.emci-title-count {
    color: #6b7280;
    font-weight: 700;
}

.emci-success {
    display: none;
    color: #12823a;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.emci-overlay.emci-show-success .emci-success {
    display: block;
}

.emci-close {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    flex: 0 0 36px;
    border: 0 !important;
    border-radius: 999px;
    background: #f4f5f7;
    color: #111827;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    transition: background .16s ease, transform .16s ease;
}

.emci-close svg {
    display: block;
    width: 18px;
    height: 18px;
    margin: 0;
    pointer-events: none;
}

.emci-close:hover,
.emci-close:focus {
    background: #e7e9ee;
    transform: scale(1.04);
    outline: none;
}

.emci-body {
    flex: 1;
    overflow: auto;
    padding: 8px 20px 20px;
    -webkit-overflow-scrolling: touch;
}

.emci-loading {
    padding: 28px 0;
    color: #6b7280;
    text-align: center;
    font-weight: 600;
}

.emci-ajax-error {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.emci-adding-product {
    opacity: .68 !important;
    pointer-events: none !important;
    cursor: progress !important;
}

.emci-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 8px;
}

.emci-item {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 13px;
    padding: 12px;
    border: 1px solid #edf0f4;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .035);
}

.emci-item-image a,
.emci-item-image {
    display: block;
}

.emci-item-image img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    border: 1px solid #edf0f4;
}

.emci-item-content {
    min-width: 0;
}

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

.emci-item-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.28;
    font-weight: 800;
    color: #111827;
}

.emci-item-title a {
    color: inherit;
    text-decoration: none;
}

.emci-item-title a:hover {
    color: var(--emci-primary);
}

.emci-remove {
    width: 25px;
    height: 25px;
    min-width: 25px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    text-align: center;
    transition: background .15s ease, color .15s ease;
}

.emci-remove svg {
    display: block;
    pointer-events: none;
}

.emci-remove:hover,
.emci-remove:focus {
    background: #fee2e2;
    color: #b91c1c;
    outline: none;
}

.emci-variation {
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.35;
}

.emci-variation dl,
.emci-variation p {
    margin: 0;
}

.emci-item-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 11px;
}

.emci-quantity {
    display: inline-flex;
    align-items: center;
    height: 34px;
    border: 1px solid #d7dce5;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.emci-qty-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: #fff;
    color: #334155;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.emci-qty-btn:hover,
.emci-qty-btn:focus {
    background: #f3f4f6;
    outline: none;
}

.emci-qty-input {
    width: 42px !important;
    height: 32px !important;
    border: 0 !important;
    border-left: 1px solid #d7dce5 !important;
    border-right: 1px solid #d7dce5 !important;
    text-align: center;
    padding: 0 !important;
    margin: 0 !important;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    box-shadow: none !important;
    appearance: textfield;
}

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

.emci-prices {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 90px;
}

.emci-regular-price {
    color: #ef4444;
    text-decoration: line-through;
    font-size: 12px;
    line-height: 1.1;
}

.emci-current-price {
    color: #111827;
    font-size: 15px;
    line-height: 1.1;
    font-weight: 800;
}

.emci-discount {
    color: #238a31;
    font-size: 11px;
    line-height: 1.1;
}

.emci-empty {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

.emci-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff1f6;
    font-size: 30px;
    margin-bottom: 8px;
}

.emci-empty strong {
    color: #111827;
    font-size: 17px;
}

.emci-empty span {
    max-width: 260px;
    font-size: 13px;
    line-height: 1.5;
}

.emci-footer {
    padding: 16px 20px 18px;
    border-top: 1px solid #eef0f4;
    background: #fff;
    box-shadow: 0 -10px 24px rgba(15, 23, 42, .045);
}

.emci-subtotal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    color: #111827;
    font-size: 14px;
}

.emci-subtotal-row strong {
    font-size: 16px;
    font-weight: 800;
}

.emci-checkout-btn,
.emci-continue-btn {
    width: 100%;
    min-height: 46px;
    border-radius: var(--emci-button-radius);
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none !important;
    transition: transform .15s ease, opacity .15s ease, background .15s ease;
}

.emci-checkout-btn {
    background: var(--emci-primary);
    color: var(--emci-primary-text) !important;
    border: 0;
    box-shadow: 0 10px 22px rgba(248, 79, 137, .22);
}

.emci-checkout-btn:hover,
.emci-checkout-btn:focus {
    opacity: .94;
    transform: translateY(-1px);
    outline: none;
}

.emci-continue-btn {
    margin-top: 10px;
    border: 0;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    min-height: 38px;
}

.emci-continue-btn:hover,
.emci-continue-btn:focus {
    color: var(--emci-secondary);
    background: #f8fafc;
    outline: none;
}

.emci-root.emci-loading-state .emci-body,
.emci-root.emci-loading-state .emci-footer {
    opacity: .64;
    pointer-events: none;
}

.emci-root.is-empty .emci-checkout-btn {
    opacity: .45;
    pointer-events: none;
}

body.emci-lock {
    overflow: hidden;
}

@media (min-width: 769px) {
    .emci-root[data-desktop-enabled="no"] .emci-floating-cart {
        display: none;
    }
}

@media (max-width: 768px) {
    body.emci-mobilebar-active {
        padding-bottom: 86px !important;
    }

    .emci-floating-cart {
        display: none;
    }

    .emci-root[data-mobile-enabled="no"] .emci-mobile-bar {
        display: none;
    }

    .emci-mobile-bar {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 999998;
        min-height: 64px;
        border-radius: 18px;
        background: var(--emci-mobile-bg);
        color: var(--emci-mobile-text);
        border: 1px solid rgba(17, 24, 39, .08);
        box-shadow: 0 14px 35px rgba(15, 23, 42, .18);
        display: grid;
        grid-template-columns: 44px 1fr 22px;
        align-items: center;
        gap: 10px;
        padding: 10px 14px 10px 12px;
        cursor: pointer;
    }

    .emci-mobile-left {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        background: var(--emci-primary);
        color: var(--emci-primary-text);
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .emci-mobile-count {
        top: -8px;
        right: -9px;
        min-width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .emci-mobile-info {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    .emci-mobile-info strong {
        font-size: 14px;
        line-height: 1.2;
        color: var(--emci-mobile-text);
    }

    .emci-mobile-info .emci-subtotal,
    .emci-mobile-info .emci-subtotal * {
        font-size: 13px;
        color: var(--emci-mobile-text);
        font-weight: 700;
    }

    .emci-mobile-arrow {
        font-size: 32px;
        color: var(--emci-mobile-text);
        line-height: 1;
        margin-top: -2px;
        opacity: .72;
    }

    .emci-drawer,
    .emci-desktop-left .emci-drawer {
        top: auto;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        width: calc(100% - 20px);
        max-width: none;
        height: min(84vh, 720px);
        border-radius: var(--emci-modal-radius);
        transform: translateY(calc(100% + 28px));
        box-shadow: 0 -18px 45px rgba(0, 0, 0, .2);
    }

    .emci-overlay.is-open .emci-drawer,
    .emci-desktop-left .emci-overlay.is-open .emci-drawer {
        transform: translateY(0);
    }

    .emci-header {
        padding: 18px 18px 12px;
    }

    .emci-header h2 {
        font-size: 18px;
    }

    .emci-body {
        padding: 6px 14px 16px;
    }

    .emci-footer {
        padding: 13px 14px calc(14px + env(safe-area-inset-bottom));
    }

    .emci-item {
        grid-template-columns: 68px 1fr;
        gap: 11px;
        padding: 10px;
    }

    .emci-item-image img {
        width: 68px;
        height: 68px;
    }

    .emci-item-title {
        font-size: 13px;
    }

    .emci-item-bottom {
        align-items: center;
    }

    .emci-quantity {
        height: 32px;
    }

    .emci-qty-btn {
        width: 30px;
        height: 30px;
    }

    .emci-qty-input {
        width: 38px !important;
        height: 30px !important;
    }

    .emci-prices {
        min-width: 72px;
    }

    .emci-current-price {
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .emci-mobile-bar {
        left: 8px;
        right: 8px;
        border-radius: 16px;
    }

    .emci-item {
        grid-template-columns: 58px 1fr;
    }

    .emci-item-image img {
        width: 58px;
        height: 58px;
    }

    .emci-item-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 9px;
    }

    .emci-prices {
        align-items: flex-start;
        text-align: left;
    }
}
