/* ============================================================
   KIDSORY COMMERCE UX V5
   Side cart drawer + Buy Now + cart/checkout polish
   ============================================================ */

body.ks-cart-drawer-open {
    overflow: hidden;
}

.ks-cart-drawer-root {
    position: fixed;
    inset: 0;
    z-index: 999999;
    pointer-events: none;
    visibility: hidden;
}

.ks-cart-drawer-root.is-open {
    pointer-events: auto;
    visibility: visible;
}

.ks-cart-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(14, 29, 25, .52);
    opacity: 0;
    transition: opacity .26s ease;
    backdrop-filter: blur(2px);
}

.ks-cart-drawer-root.is-open .ks-cart-drawer-overlay {
    opacity: 1;
}

.ks-cart-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(470px, 94vw);
    height: 100%;
    background: #fff;
    transform: translateX(102%);
    transition: transform .3s cubic-bezier(.22,.61,.36,1);
    box-shadow: -24px 0 70px rgba(15, 39, 32, .16);
    outline: 0;
    overflow: hidden;
}

.ks-cart-drawer-root.is-open .ks-cart-drawer-panel {
    transform: translateX(0);
}

.ks-cart-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #17382f;
}

.ks-cart-drawer-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 25px 26px 18px;
    border-bottom: 1px solid rgba(23,56,47,.09);
}

.ks-cart-drawer-kicker {
    display: block;
    margin-bottom: 4px;
    color: #f53650;
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.ks-cart-drawer-heading-row h2 {
    margin: 0;
    color: #102f27;
    font-size: 29px;
    line-height: 1.05;
    letter-spacing: -.035em;
}

.ks-cart-drawer-heading-row h2 span {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    margin-left: 5px;
    padding: 0 7px;
    border-radius: 999px;
    background: #ff9418;
    color: #fff;
    font-size: 12px;
    vertical-align: 4px;
}

.ks-cart-drawer-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(23,56,47,.12);
    border-radius: 50%;
    background: #fffaf2;
    color: #17382f;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.ks-cart-drawer-delivery {
    margin: 16px 26px 0;
    padding: 14px 16px;
    border: 1px solid rgba(26,166,213,.16);
    border-radius: 16px;
    background: #eefaff;
}

.ks-cart-drawer-delivery strong,
.ks-cart-drawer-delivery span {
    display: block;
}

.ks-cart-drawer-delivery strong {
    margin-bottom: 2px;
    font-size: 12px;
}

.ks-cart-drawer-delivery span {
    color: #5c6c66;
    font-size: 11px;
    line-height: 1.45;
}

.ks-cart-drawer-items {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px 26px 18px;
    overscroll-behavior: contain;
}

.ks-cart-drawer-item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(23,56,47,.09);
    transition: opacity .2s ease;
}

.ks-cart-drawer-item.is-updating {
    opacity: .48;
    pointer-events: none;
}

.ks-cart-drawer-item-image {
    overflow: hidden;
    align-self: start;
    border: 1px solid rgba(23,56,47,.08);
    border-radius: 16px;
    background: #f7f8f5;
    aspect-ratio: 1 / 1;
}

.ks-cart-drawer-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ks-cart-drawer-item-copy {
    min-width: 0;
}

.ks-cart-drawer-item-title {
    display: block;
    margin: 1px 0 5px;
    color: #17382f;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 850;
    text-decoration: none;
}

.ks-cart-drawer-variation {
    margin: 0 0 7px;
    color: #718079;
    font-size: 10px;
}

.ks-cart-drawer-variation dl,
.ks-cart-drawer-variation p {
    margin: 0;
}

.ks-cart-drawer-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 11px;
}

.ks-cart-drawer-price {
    color: #17382f;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.ks-cart-drawer-qty {
    display: inline-grid;
    grid-template-columns: 31px 38px 31px;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(23,56,47,.14);
    border-radius: 999px;
    background: #fff;
}

.ks-cart-qty-button {
    width: 31px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #17382f;
    font-size: 16px;
    cursor: pointer;
}

.ks-cart-qty-input {
    width: 38px !important;
    height: 32px !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #17382f;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

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

.ks-cart-remove {
    margin-top: 10px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: transparent;
    color: #7b8580;
    font-size: 10px;
    line-height: 1.4;
    cursor: pointer;
}

.ks-cart-drawer-summary {
    flex: 0 0 auto;
    padding: 18px 26px 25px;
    border-top: 1px solid rgba(23,56,47,.1);
    background: #fff;
    box-shadow: 0 -14px 34px rgba(23,56,47,.04);
}

.ks-cart-drawer-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 800;
}

.ks-cart-drawer-total-row strong {
    font-size: 18px;
}

.ks-cart-drawer-summary > p {
    margin: 0 0 15px;
    color: #77837e;
    font-size: 10px;
    line-height: 1.5;
}

.ks-cart-primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 54px;
    padding: 12px 18px;
    border-radius: 14px;
    background: #17382f;
    color: #fff !important;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    text-decoration: none !important;
}

.ks-cart-primary-button:hover {
    background: #f53650;
}

.ks-cart-primary-button span {
    opacity: .82;
}

.ks-cart-secondary-link {
    display: block;
    margin-top: 11px;
    color: #17382f;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.ks-cart-drawer-empty {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 42px 34px;
    text-align: center;
}

.ks-cart-drawer-empty-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #ffe16d;
    color: #f53650;
    font-size: 30px;
}

.ks-cart-drawer-empty h3 {
    margin: 0 0 8px;
    color: #17382f;
    font-size: 25px;
    line-height: 1.1;
    letter-spacing: -.03em;
}

.ks-cart-drawer-empty p {
    max-width: 310px;
    margin: 0 0 22px;
    color: #708078;
    font-size: 13px;
    line-height: 1.55;
}

.ks-cart-drawer-empty .ks-cart-primary-button {
    max-width: 250px;
}

/* Single-product action layout. */
.single-product form.cart .kidsory-buy-now-button {
    display: block !important;
    width: 100% !important;
    min-height: 52px !important;
    margin: 12px 0 0 !important;
    padding: 0 28px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #f53650 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    letter-spacing: .01em;
}

.single-product form.cart .kidsory-buy-now-button:hover {
    background: #e62742 !important;
}

.single-product form.cart.is-kidsory-loading {
    opacity: .7;
    pointer-events: none;
}

.single-product form.cart .quantity input.qty {
    max-width: 88px;
}

.ks-commerce-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000000;
    max-width: min(360px, calc(100vw - 32px));
    padding: 13px 17px;
    border-radius: 13px;
    background: #17382f;
    color: #fff;
    box-shadow: 0 16px 40px rgba(9,31,25,.22);
    font-size: 12px;
    font-weight: 800;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: .22s ease;
}

.ks-commerce-toast.is-error {
    background: #b72d3e;
}

.ks-commerce-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 600px) {
    .ks-cart-drawer-panel {
        width: min(430px, 100vw);
    }

    .ks-cart-drawer-heading-row {
        padding: 19px 18px 15px;
    }

    .ks-cart-drawer-heading-row h2 {
        font-size: 25px;
    }

    .ks-cart-drawer-delivery {
        margin: 12px 18px 0;
    }

    .ks-cart-drawer-items {
        padding: 6px 18px 14px;
    }

    .ks-cart-drawer-item {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 11px;
        padding: 15px 0;
    }

    .ks-cart-drawer-item-title {
        font-size: 13px;
    }

    .ks-cart-drawer-summary {
        padding: 15px 18px max(18px, env(safe-area-inset-bottom));
    }

    .ks-cart-drawer-qty {
        grid-template-columns: 28px 34px 28px;
    }

    .ks-cart-qty-button {
        width: 28px;
    }

    .ks-cart-qty-input {
        width: 34px !important;
    }

    .single-product form.cart .kidsory-buy-now-button {
        min-height: 50px !important;
        margin-top: 10px !important;
        font-size: 13px !important;
    }

    .ks-commerce-toast {
        right: 16px;
        bottom: 16px;
    }
}

/* ============================================================
   KIDSORY WHATSAPP DIRECT ORDER
   ============================================================ */

.woocommerce ul.products li.product .kidsory-whatsapp-order-loop,
.woocommerce-page ul.products li.product .kidsory-whatsapp-order-loop {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100% !important;
    min-height: 44px;
    margin: 9px 0 0 !important;
    padding: 10px 16px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #25d366 !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    text-align: center;
    text-decoration: none !important;
    box-sizing: border-box;
}

.woocommerce ul.products li.product .kidsory-whatsapp-order-loop:hover,
.woocommerce-page ul.products li.product .kidsory-whatsapp-order-loop:hover {
    background: #1fb858 !important;
    color: #fff !important;
}

.single-product form.cart .kidsory-whatsapp-order-single {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100% !important;
    min-height: 52px !important;
    margin: 12px 0 0 !important;
    padding: 0 28px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #25d366 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    letter-spacing: .01em;
    cursor: pointer;
}

.single-product form.cart .kidsory-whatsapp-order-single:hover {
    background: #1fb858 !important;
}

@media (max-width: 600px) {
    .woocommerce ul.products li.product .kidsory-whatsapp-order-loop,
    .woocommerce-page ul.products li.product .kidsory-whatsapp-order-loop {
        min-height: 42px;
        font-size: 11px !important;
    }

    .single-product form.cart .kidsory-whatsapp-order-single {
        min-height: 50px !important;
        margin-top: 10px !important;
        font-size: 13px !important;
    }
}

