.saffron-atc-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.saffron-atc-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.saffron-atc-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.saffron-atc-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    direction: rtl;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.25s ease;
    height: auto;
}

.saffron-atc-modal.is-open .saffron-atc-modal__dialog {
    transform: translateY(0) scale(1);
}

.saffron-atc-modal__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 0;
}

.saffron-atc-modal__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #00783b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.saffron-atc-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.saffron-atc-modal__subtitle {
    margin: 8px 20px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.saffron-atc-modal__content {
    margin: 16px 20px 0;
    flex-shrink: 0;
}

.saffron-atc-modal__items {
    overflow-x: hidden;
    overflow-y: visible;
}

.saffron-atc-modal__items.is-scrollable {
    max-height: min(280px, calc(90vh - 260px));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #00783b transparent;
}

.saffron-atc-modal__items.is-scrollable::-webkit-scrollbar {
    width: 6px;
}

.saffron-atc-modal__items.is-scrollable::-webkit-scrollbar-thumb {
    background: #00783b;
    border-radius: 6px;
}

.saffron-atc-modal__loading {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
}

.saffron-atc-modal__items .saffron-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.saffron-atc-modal__items .saffron-cart-item:last-child {
    border-bottom: none;
}

.saffron-atc-modal__items .saffron-item-image {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.saffron-atc-modal__items .saffron-item-placeholder {
    width: 56px;
    height: 56px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    flex-shrink: 0;
}

.saffron-atc-modal__items .saffron-item-details {
    flex: 1;
    min-width: 0;
}

.saffron-atc-modal__items .saffron-item-details h4 {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.saffron-atc-modal__items .saffron-item-details h4 a {
    color: #333;
    text-decoration: none;
}

.saffron-atc-modal__items .saffron-item-details p {
    margin: 0;
    font-size: 12px;
    color: #888;
}

.saffron-atc-modal__items .saffron-item-controls {
    flex-shrink: 0;
}

.saffron-atc-modal__items .saffron-remove-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d32f2f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.saffron-atc-modal__items .saffron-remove-btn:hover {
    background: #ffebee;
    border-color: #ef9a9a;
}

.saffron-atc-modal__items .saffron-remove-btn.is-removing {
    opacity: 0.5;
    pointer-events: none;
}

.saffron-atc-modal__items .saffron-cart-empty {
    text-align: center;
    padding: 16px 0;
    margin: 0;
    font-size: 14px;
    color: #888;
}

.saffron-atc-modal__footer-total {
    padding: 12px 0 0;
    font-size: 14px;
    font-weight: 700;
    color: #00783b;
    text-align: left;
}

.saffron-atc-modal__actions {
    display: flex;
    gap: 10px;
    padding: 20px;
    margin-top: auto;
}

.saffron-atc-modal__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.saffron-atc-modal__btn--continue {
    background: #f5f5f5;
    color: #333;
}

.saffron-atc-modal__btn--continue:hover {
    background: #ebebeb;
}

.saffron-atc-modal__btn--cart {
    background: #00783b;
    color: #fff;
}

.saffron-atc-modal__btn--cart:hover {
    background: #006633;
    color: #fff;
}

body.saffron-atc-modal-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .saffron-atc-modal__actions {
        flex-direction: column-reverse;
    }
}
