

#cartBtn {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff9ec6;
    color: #1a2a44;
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 18, 40, 0.45);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    z-index: 4000;
}

.cart-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

body.cart-open {
    overflow: hidden;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 92vw;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    box-shadow: none; /* shadow only while open — otherwise it bleeds onto the page edge */
    z-index: 4001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
    font-family: 'Poppins', sans-serif;
}

.cart-drawer.is-open {
    right: 0;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25);
}

.cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    background: #1C2B4B;
    color: #ffffff;
    flex-shrink: 0;
}

.cart-drawer__header h2 {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: 1.4rem;
    margin: 0;
}

.cart-drawer__close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.cart-drawer__close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.cart-drawer__items[hidden] {
    display: none;
}

.cart-drawer__items {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cart-drawer__empty {
    padding: 40px 24px;
    top: 0;
    transform: translateY(-335%);
    text-align: center;
    color: #5a6b85;
    font-size: 0.95rem;
}

.cart-drawer__empty a {
    color: #2d79ba;
    text-decoration: underline;
}

.cart-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 18px;
    background: #eef4fc;
}

.cart-item__thumb {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 12px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cart-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item__info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding-right: 24px;
}

.cart-item__label {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a2a44;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item__sub {
    font-size: 0.85rem;
    color: #6b7a90;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item__price {
    margin-top: 6px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a2a44;
}

.cart-item__qty-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.cart-item__qty-text {
    font-size: 0.85rem;
    color: #6b7a90;
    margin-right: 2px;
}

.cart-item__qty-btn {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #a7c7e7;
    background: #ffffff;
    color: #1a2a44;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.cart-item__qty-btn::before {
    content: '';
    position: absolute;
    inset: -6px;
}

.cart-item__qty-btn:hover {
    background: #d6eaff;
}

.cart-item__qty-value {
    min-width: 20px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a2a44;
}

.cart-item__remove {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: #8a97ab;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
}

.cart-item__remove:hover {
    color: #d1293d;
}

.cart-item__remove::before {
    content: '';
    position: absolute;
    inset: -8px;
}

.cart-drawer__summary {
    flex-shrink: 0;
    padding: 18px 20px 22px;
    border-top: 1px solid rgba(28, 43, 75, 0.08);
}

.cart-drawer__row {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: #1a2a44;
    margin-bottom: 6px;
}

.cart-drawer__row--total {
    font-weight: 700;
    font-size: 1.15rem;
    border-top: 1px solid rgba(28, 43, 75, 0.08);
    padding-top: 10px;
    margin-top: 8px;
}

.cart-drawer__row--discount span:last-child {
    color: #2e7d4f;
    font-weight: 600;
}

.cart-promo {
    display: flex;
    gap: 8px;
    margin: 10px 0 4px;
}

.cart-promo__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 40px;
    padding: 8px 14px;
    border: 2px solid #a7c7e7;
    border-radius: 999px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    outline: none;
    background: #ffffff;
    color: #1a2a44;
    text-transform: uppercase;
}

.cart-promo__input::placeholder {
    text-transform: none;
}

.cart-promo__input:focus {
    border-color: #2d79ba;
}

.cart-promo__btn {
    flex-shrink: 0;
    min-height: 40px;
    padding: 8px 18px;
    border: none;
    border-radius: 999px;
    background: #1C2B4B;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cart-promo__btn:hover {
    background: #2d79ba;
}

.cart-promo__msg {
    min-height: 1.1em;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.cart-promo__msg--success {
    color: #2e7d4f;
}

.cart-promo__msg--error {
    color: #d1293d;
}

.cart-order-form[hidden] {
    display: none;
}

.cart-order-form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-order-form h3 {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: 1.15rem;
    color: #1C2B4B;
    margin: 0 0 4px;
}

.cart-form__label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.cart-form__optional {
    font-weight: 400;
    color: #9aa9c2;
    font-size: 0.75rem;
}

.cart-form__input {
    min-height: 46px;
    padding: 12px 16px;
    border: 2px solid #1C2B4B;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    outline: none;
    background: #ffffff;
    color: #1a2a44;
}

.cart-form__input:focus {
    border-color: #2d79ba;
}

.cart-form__textarea {
    min-height: 80px;
    resize: none;
}

.cart-form__totals {
    border-top: 1px solid rgba(28, 43, 75, 0.08);
    padding-top: 14px;
    margin-top: 4px;
}

.cart-form__totals-heading {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: #1C2B4B;
    margin: 0 0 10px;
}

.cart-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.cart-btn {
    min-height: 48px;
    padding: 13px;
    border-radius: 30px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.cart-btn--secondary {
    flex: 1;
    border: 1px solid #a7c7e7;
    background: #ffffff;
    color: #1a2a44;
    font-weight: 600;
}

.cart-btn--secondary:hover {
    background: #f0f6fc;
}

.cart-btn--primary {
    flex: 2;
    border: none;
    background: #1C2B4B;
    color: #ffffff;
    text-transform: uppercase;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.cart-btn--primary:hover {
    background-color: #a7c7e7;
    color: #1C2B4B;
    box-shadow: 0 6px 16px rgba(167, 199, 231, 0.45);
}

.cart-btn--primary:disabled {
    opacity: 0.7;
    cursor: default;
}

.cart-order-status {
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 1.2em;
    text-align: center;
}

.cart-order-status--success {
    color: #2e7d4f;
}

.cart-order-status--error {
    color: #d1293d;
}

/* --- Order form: 3 numbered steps with big tap-to-choose cards --- */
.cart-order-form .cart-form__label {
    font-size: 1rem;
}

.cart-drawer__row[hidden],
.cart-form__label[hidden],
.cart-suboptions[hidden],
.cart-form__hint[hidden] {
    display: none;
}

.cart-form__intro {
    margin: 0;
    font-size: 1rem;
    color: #1C2B4B;
}

.cart-step {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-order-form .cart-step__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-style: normal;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1C2B4B;
}

.cart-step__num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1C2B4B;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.cart-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-option {
    width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid #d6e4f3;
    border-radius: 16px;
    background: #ffffff;
    text-align: left;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.cart-option:hover {
    border-color: #a7c7e7;
}

.cart-option[aria-checked="true"] {
    border-color: #1C2B4B;
    background: #f0f6fc;
}

.cart-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-option__icon {
    flex-shrink: 0;
    font-size: 1.5rem;
}

.cart-option__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cart-option__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1C2B4B;
}

.cart-option__detail {
    font-size: 0.875rem;
    color: #6b7a90;
}

.cart-option__price {
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1C2B4B;
}

.cart-option__price--free {
    color: #2e7d4f;
}

.cart-option__check {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 2px solid #d6e4f3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: #ffffff;
}

.cart-option[aria-checked="true"] .cart-option__check {
    background: #1C2B4B;
    border-color: #1C2B4B;
}

.cart-option[aria-checked="true"] .cart-option__check::after {
    content: '✓';
}

.cart-suboptions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 12px;
    border-left: 4px solid #d6e4f3;
}

.cart-form__hint {
    font-size: 0.875rem;
    font-weight: 400;
    color: #6b7a90;
}



.cart-form__note {
    margin: 0;
    padding: 12px 16px;
    border-radius: 16px;
    background: #f0f6fc;
    font-size: 1rem;
    color: #1C2B4B;
}

.cart-order-form .cart-order-status {
    font-size: 1rem;
}

.cart-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 16px);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 32px);
    padding: 12px 16px;
    border-radius: 999px;
    background: #1C2B4B;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    box-shadow: 0 10px 30px rgba(15, 42, 79, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
    z-index: 5000;
}

.cart-toast.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.cart-toast__check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2e7d4f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.cart-toast__text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-toast__view-btn {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.14);
    border: none;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cart-toast__view-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 480px) {
    .cart-drawer {
        width: 100%;
        max-width: 100vw;
        right: -100%;
    }

    .cart-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        transform: translate(0, 16px);
        max-width: none;
    }

    .cart-toast.is-visible {
        transform: translate(0, 0);
    }
}

html.dark-mode .cart-drawer {
    background: #0f172a;
    color: #e5e7eb;
}

html.dark-mode .cart-item {
    background: #16233d;
}

html.dark-mode .cart-item__label,
html.dark-mode .cart-item__price,
html.dark-mode .cart-drawer__row,
html.dark-mode .cart-item__qty-value,
html.dark-mode .cart-form__totals-heading {
    color: #e5e7eb;
}

html.dark-mode .cart-form__input {
    background: #1c2b4b;
    color: #ffffff;
    border-color: #3a5a82;
}

html.dark-mode .cart-btn--secondary {
    background: #1c2b4b;
    color: #e5e7eb;
}

html.dark-mode .cart-promo__input {
    background: #1c2b4b;
    color: #ffffff;
    border-color: #3a5a82;
}

/* --- Result after coming back from Ziina's payment page --- */
.cart-result {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cart-result__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 43, 75, 0.6);
}

.cart-result__box {
    position: relative;
    width: min(100%, 340px);
    padding: 26px 24px 22px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(15, 42, 79, 0.35);
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

.cart-result__title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #d1293d;
}

.cart-result__box--success .cart-result__title {
    color: #2e7d4f;
}

.cart-result__text {
    margin: 0 0 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #1c2b4b;
}

.cart-result__btn {
    min-width: 120px;
}
