/* Slide-out cart drawer (right side). Markup rendered in wp_footer by
   satyadev_cart_drawer_markup(); content inside .widget_shopping_cart_content
   is the theme's mini-cart template, kept live by WooCommerce cart fragments. */

/* The old hover-dropdown mini cart is replaced by the drawer everywhere */
.goal-topcart .dropdown-menu { display: none !important; }

#sdi-cart-drawer {
    position: fixed;
    inset: 0;
    z-index: 10000000;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear .35s;
}
#sdi-cart-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
    transition: none;
}
body.sdi-drawer-open { overflow: hidden; }

.sdi-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 16, 55, .5);
    opacity: 0;
    transition: opacity .3s;
    cursor: pointer;
}
#sdi-cart-drawer.is-open .sdi-drawer-overlay { opacity: 1; }

.sdi-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 400px;
    max-width: 92vw;
    background: #fff;
    box-shadow: -10px 0 34px rgba(0, 0, 0, .22);
    transform: translateX(102%);
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    flex-direction: column;
}
#sdi-cart-drawer.is-open .sdi-drawer-panel { transform: none; }

/* Header */
.sdi-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #0A299B;
    flex-shrink: 0;
}
.sdi-drawer-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .3px;
}
.sdi-cart-count {
    display: inline-block;
    min-width: 24px;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #fff;
    color: #0A299B;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    vertical-align: 2px;
}
.sdi-drawer-close {
    background: none;
    border: 0;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
    opacity: .85;
}
.sdi-drawer-close:hover { opacity: 1; }

/* Scrollable body */
.sdi-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
}
.sdi-drawer-body .widget_shopping_cart_content,
.sdi-drawer-body .shopping_cart_content {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.sdi-drawer-body .cart_list { flex: 1; }

/* Product rows (theme mini-cart markup: .media.widget-product) */
.sdi-drawer-body .widget-product {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid #edf0f7;
    position: relative;
}
.sdi-drawer-body .widget-product .media-left {
    padding: 0;
    flex: 0 0 64px;
}
.sdi-drawer-body .widget-product .image img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border: 1px solid #edf0f7;
    border-radius: 8px;
    background: #fff;
}
.sdi-drawer-body .cart-main-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
    padding-right: 26px; /* room for the remove button */
}
.sdi-drawer-body .cart-main-content h3.name {
    order: -2;
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
}
.sdi-drawer-body .cart-main-content h3.name a { color: #1a1a2e; }
.sdi-drawer-body .cart-main-content dl.variation {
    order: -1;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
    align-items: baseline;
    margin: 0;
    font-size: 12px;
    color: #777;
}
.sdi-drawer-body .cart-main-content dl.variation dt,
.sdi-drawer-body .cart-main-content dl.variation dd {
    display: inline;
    margin: 0;
    padding: 0;
    float: none;
    font-weight: 400;
}
.sdi-drawer-body .cart-main-content dl.variation dd p {
    display: inline;
    margin: 0;
}
.sdi-drawer-body .widget-product a.remove {
    position: absolute;
    top: 12px;
    right: 0;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    background: #f2f4fa;
    color: #666;
    font-size: 10px;
}
.sdi-drawer-body .widget-product a.remove:hover {
    background: #e02b2b;
    color: #fff;
}

/* Quantity pill (+ / −) */
.sdi-qty {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0;
    margin-top: 2px;
}
.sdi-qty .sdi-qty-btn,
.sdi-qty .sdi-qty-num {
    position: static; /* guard against theme .plus/.minus absolute positioning */
    float: none;
    margin: 0;
}
.sdi-qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #d7dcea;
    background: #fff;
    color: #0A299B;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.sdi-qty-btn.minus { border-radius: 6px 0 0 6px; }
.sdi-qty-btn.plus { border-radius: 0 6px 6px 0; }
.sdi-qty-btn:hover { background: #0A299B; color: #fff; border-color: #0A299B; }
.sdi-qty-num {
    min-width: 30px;
    height: 26px;
    line-height: 24px;
    text-align: center;
    border-top: 1px solid #d7dcea;
    border-bottom: 1px solid #d7dcea;
    font-size: 13px;
    font-weight: 600;
}
.sdi-qty-price {
    margin-left: auto;
    font-weight: 700;
    color: #0A299B;
    font-size: 14px;
}

/* Empty state */
.sdi-drawer-body .cart_list p.total.empty {
    margin: 40px 0 16px;
    text-align: center;
    font-size: 15px;
}

/* Bottom: total + free-shipping bar + buttons */
.sdi-drawer-body .cart-bottom {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 2px solid #edf0f7;
    padding: 12px 0 4px;
    margin-top: auto;
}
.sdi-drawer-body .cart-bottom p.total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    margin: 0 0 10px;
}
.sdi-drawer-body .cart-bottom .buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}
.sdi-drawer-body .cart-bottom .buttons a {
    display: block;
    width: 100%;
    float: none;
    text-align: center;
    padding: 12px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
}
.sdi-drawer-body .cart-bottom .buttons a.checkout {
    background: #0A299B;
    color: #fff;
    order: -1; /* checkout first — it's the money button */
}
.sdi-drawer-body .cart-bottom .buttons a.checkout:hover { background: #081f75; }
.sdi-drawer-body .cart-bottom .buttons a:not(.checkout) {
    background: #eef1f9;
    color: #0A299B;
}
.sdi-drawer-body .cart-bottom .buttons a:not(.checkout):hover { background: #dfe5f5; }

/* Busy overlay while a quantity update is in flight */
#sdi-cart-drawer.is-busy .sdi-drawer-body {
    opacity: .45;
    pointer-events: none;
    transition: opacity .15s;
}

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