.ko-app,
.ko-app *,
.ko-cart-bar,
.ko-cart-bar *,
.ko-toast {
    font-family: inherit !important;
    direction: rtl;
}

.ko-product-placeholder {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', inherit !important;
}

.ko-hidden {
    display: none !important;
}

.ko-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 20px;
    margin: 18px 0;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.ko-hero {
    background: linear-gradient(135deg, #f8fafc, #ecfdf5);
    overflow: hidden;
    position: relative;
}

.ko-hero::after {
    content: "";
    position: absolute;
    inset: auto -40px -70px auto;
    width: 170px;
    height: 170px;
    background: rgba(156, 175, 136, .18);
    border-radius: 50%;
}

.ko-checkout-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.ko-checkout-main {
    min-width: 0;
}

.ko-checkout-summary {
    position: sticky;
    top: 96px;
}
}

.ko-progress {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0;
}

.ko-progress span {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #64748b;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.ko-progress span.active {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.ko-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.ko-product,
.ko-cart-item,
.ko-order-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    background: #f8fafc;
}

.ko-cart-panel {
    margin-top: 0;
}

.ko-cart-head,
.ko-cart-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ko-cart-head h3 {
    margin-bottom: 4px;
}

.ko-cart-head p,
.ko-cart-item span {
    color: #64748b;
    font-size: 13px;
}

.ko-cart-item {
    background: #fff;
    margin-bottom: 10px;
}

.ko-more-menu summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--primary-color, #0f766e);
}

.ko-more-menu .ko-menu-grid {
    margin-top: 16px;
}

.ko-product img,
.ko-product-placeholder {
    width: 100%;
    height: 130px;
    border-radius: 12px;
    background: #e2e8f0;
}

.ko-product img {
    object-fit: cover;
}

.ko-product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 42px;
}

.ko-addon-hint,
.ko-muted {
    display: block;
    color: #64748b;
    font-size: 12px;
    line-height: 1.8;
}

.ko-product button,
.ko-card-order-btn,
.ko-primary,
.ko-panel button,
.ko-cart-bar a {
    border: 0;
    border-radius: 999px;
    background: var(--primary-color, #0f766e);
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
}

.ko-card-order-btn {
    width: 100%;
    margin-top: 10px;
}

.ko-single-order-btn {
    width: auto;
}

.ko-cart-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #0f172a;
    color: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, .28);
}

.ko-cart-bar.active {
    display: flex;
}

.ko-cart-bar a {
    background: #fff;
    color: #0f172a;
}

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

.ko-qty {
    background: #f1f5f9;
    border-radius: 999px;
    padding: 4px;
    flex-wrap: nowrap;
}

.ko-qty button {
    width: 30px;
    height: 30px;
    padding: 0;
}

.ko-remove {
    background: transparent !important;
    color: #dc2626 !important;
    padding: 6px 0 !important;
    font-size: 12px;
}

.ko-section-title {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.ko-section-title > span {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #0f766e);
    color: #fff;
    font-weight: 800;
}

.ko-section-title h3 {
    margin-bottom: 4px;
}

.ko-section-title p {
    color: #64748b;
    margin: 0;
}

.ko-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

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

.ko-panel input,
.ko-panel textarea,
.ko-panel select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 6px 0 12px;
    box-sizing: border-box;
}

.ko-inline input {
    flex: 1;
    min-width: 180px;
}

.ko-message {
    min-height: 22px;
    margin: -4px 0 12px;
    font-size: 13px;
    line-height: 1.8;
    color: #64748b;
}

.ko-message.success {
    color: #15803d;
}

.ko-message.warning {
    color: #a16207;
}

.ko-message.error {
    color: #dc2626;
}

.ko-form-errors {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.ko-form-errors.active {
    display: block;
}

.ko-form-errors p {
    margin: 0 0 6px;
}

.ko-form-errors p:last-child {
    margin-bottom: 0;
}

.ko-field-error input,
.ko-field-error textarea,
.ko-field-error select,
input.ko-field-error,
textarea.ko-field-error,
select.ko-field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

.ko-otp-row {
    display: none;
}

.ko-otp-row.active {
    display: flex;
}

.ko-addons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.ko-addons > b {
    grid-column: 1 / -1;
}

.ko-addon-row {
    display: grid;
    grid-template-columns: 1fr 74px;
    gap: 8px;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
}

.ko-addon-row input[type="number"] {
    margin: 0;
    padding: 6px;
    text-align: center;
}

.ko-total,
.ko-invoice {
    padding: 14px;
    border-radius: 14px;
    background: #ecfdf5;
    margin-top: 12px;
}

.ko-invoice p {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
}

.ko-invoice strong {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.ko-invoice.mini {
    background: #f8fafc;
}

.ko-summary-cta,
.ko-submit {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 12px;
}

.ko-success {
    text-align: center;
    background: radial-gradient(circle at top right, #dcfce7, transparent 34%), linear-gradient(135deg, #ecfdf5, #eff6ff);
    border-radius: 24px;
    padding: 40px 20px;
    border: 1px solid #bfdbfe;
}

.ko-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #16a34a;
    color: #fff;
    font-size: 42px;
    font-weight: 900;
    box-shadow: 0 14px 30px rgba(22, 163, 74, .25);
    margin-bottom: 14px;
}

.ko-status-card {
    max-width: 680px;
    margin: 22px auto 0;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 20px;
    padding: 18px;
    text-align: right;
}

.ko-live-pill {
    display: inline-flex;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 10px;
}

.ko-status-timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 14px 0;
}

.ko-status-timeline span {
    background: #f1f5f9;
    color: #64748b;
    border-radius: 999px;
    padding: 9px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
}

.ko-status-timeline span.active {
    background: #dcfce7;
    color: #166534;
}

.ko-status-timeline span.cancelled {
    grid-column: 1 / -1;
    background: #fee2e2;
    color: #b91c1c;
}

.ko-success-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.ko-success-actions a,
.ko-success-actions button {
    border: 0;
    border-radius: 999px;
    background: var(--primary-color, #0f766e);
    color: #fff;
    padding: 10px 18px;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.ko-toast {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 10000;
    background: #0f172a;
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
}

@media (max-width: 767px) {
    .ko-panel {
        padding: 14px;
        border-radius: 14px;
    }

    .ko-menu-grid {
        grid-template-columns: 1fr;
    }

    .ko-progress {
        grid-template-columns: 1fr;
    }

    .ko-checkout-shell {
        display: flex;
        flex-direction: column;
    }

    .ko-checkout-summary {
        order: -1;
        position: static;
        width: 100%;
    }

    .ko-form-grid,
    .ko-status-timeline {
        grid-template-columns: 1fr;
    }

    .ko-cart-head,
    .ko-cart-line {
        align-items: stretch;
        flex-direction: column;
    }

    .ko-summary-cta {
        display: none;
    }

    .ko-cart-bar {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}
