/* =====================================================================
   SHOP UI  -  cart button, mini cart, cart page, mobile checkout bar
   Loaded after the theme CSS so it can override it.
   ===================================================================== */

:root {
    --shop-accent: #e4144d;
    --shop-accent-dark: #c1103f;
    --shop-ink: #1d1d1f;
    --shop-line: #e6e6e6;
    --shop-muted: #7a7a7a;
}

/* ---------------------------------------------------------------
   1. HEADER CART BUTTON
   --------------------------------------------------------------- */

.shop-cart-li { position: relative; }
.shop-cart-wrap { position: relative; display: inline-block; }

.shop-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 30px;
    background: var(--shop-accent);
    color: #fff !important;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background .15s ease;
}
.shop-cart-btn:hover,
.shop-cart-btn:focus { background: var(--shop-accent-dark); color: #fff !important; }

.shop-cart-btn .fa { font-size: 16px; margin-right: 2px; }

.shop-cart-badge {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #fff;
    color: var(--shop-accent);
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}
.shop-cart-badge.is-empty { display: none; }

.shop-cart-total { font-weight: 600; }

/* ---------------------------------------------------------------
   2. MINI CART DROPDOWN
   --------------------------------------------------------------- */

.shop-mini-cart {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    /* The theme's mega menu uses z-index 999999, so sit above it */
    z-index: 1000001;
    width: 340px;
    max-width: calc(100vw - 30px);
    background: #fff;
    border: 1px solid var(--shop-line);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,.14);
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.shop-mini-cart.open { opacity: 1; visibility: visible; transform: translateY(0); }

.shop-mini-cart .mini-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--shop-line);
    font-weight: 700;
    color: var(--shop-ink);
}

.shop-mini-cart .mini-body { max-height: 320px; overflow-y: auto; }

.shop-mini-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f2f2f2;
    align-items: center;
}
.shop-mini-item img {
    width: 52px; height: 52px; object-fit: cover;
    border-radius: 6px; border: 1px solid var(--shop-line); flex: 0 0 52px;
}
.shop-mini-item .mi-name {
    font-size: 13px; font-weight: 600; color: var(--shop-ink);
    line-height: 1.3; margin: 0 0 3px 0;
}
.shop-mini-item .mi-meta { font-size: 12px; color: var(--shop-muted); }
.shop-mini-item .mi-info { flex: 1 1 auto; min-width: 0; }

.shop-mini-cart .mini-foot { padding: 14px 16px; }
.shop-mini-cart .mini-total {
    display: flex; justify-content: space-between;
    font-weight: 700; color: var(--shop-ink); margin-bottom: 12px;
}
.shop-mini-cart .mini-empty {
    padding: 28px 16px; text-align: center; color: var(--shop-muted); font-size: 14px;
}

/* ---------------------------------------------------------------
   3. BUTTONS
   --------------------------------------------------------------- */

.shop-btn {
    display: inline-block;
    padding: 12px 22px;
    border: 0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.shop-btn-primary { background: var(--shop-accent); color: #fff !important; }
.shop-btn-primary:hover { background: var(--shop-accent-dark); color: #fff !important; }

.shop-btn-secondary {
    background: #fff; color: var(--shop-ink) !important;
    border: 1px solid #cfcfcf;
}
.shop-btn-secondary:hover { border-color: #999; }

.shop-btn-block { display: block; width: 100%; }
.shop-btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------------------------------------------------------------
   4. QUANTITY STEPPER
   --------------------------------------------------------------- */

.qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.qty-stepper button {
    width: 38px; height: 38px;
    border: 0; background: #f7f7f7;
    color: var(--shop-ink); font-size: 18px; line-height: 1;
    cursor: pointer;
}
.qty-stepper button:hover { background: #ececec; }
.qty-stepper button:disabled { opacity: .4; cursor: not-allowed; }
.qty-stepper input {
    width: 46px; height: 38px;
    border: 0; border-left: 1px solid #e6e6e6; border-right: 1px solid #e6e6e6;
    text-align: center; font-size: 15px; font-weight: 600;
    -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------------------------------------------------------------
   5. CART PAGE
   --------------------------------------------------------------- */

.cart-layout { display: flex; flex-wrap: wrap; gap: 26px; align-items: flex-start; }
.cart-lines { flex: 1 1 520px; min-width: 0; }
.cart-aside  { flex: 0 0 320px; max-width: 100%; }

.cart-line {
    display: flex;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--shop-line);
    align-items: flex-start;
}
.cart-line.is-busy { opacity: .5; pointer-events: none; }
.cart-line img {
    width: 96px; height: 96px; object-fit: cover;
    border-radius: 8px; border: 1px solid var(--shop-line); flex: 0 0 96px;
}
.cart-line .cl-main { flex: 1 1 auto; min-width: 0; }
.cart-line .cl-name {
    font-size: 16px; font-weight: 600; color: var(--shop-ink);
    margin: 0 0 4px 0; line-height: 1.35;
}
.cart-line .cl-name a { color: inherit; text-decoration: none; }
.cart-line .cl-name a:hover { color: var(--shop-accent); }
.cart-line .cl-meta { font-size: 13px; color: var(--shop-muted); margin-bottom: 4px; }
.cart-line .cl-unit { font-size: 13px; color: var(--shop-muted); margin-bottom: 10px; }
.cart-line .cl-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cart-line .cl-total {
    flex: 0 0 110px; text-align: right;
    font-size: 17px; font-weight: 700; color: var(--shop-ink);
}
.cart-line .cl-stock { font-size: 12px; color: #c1103f; margin-top: 6px; }

.cl-remove {
    background: none; border: 0; padding: 0;
    color: var(--shop-muted); font-size: 13px; cursor: pointer;
    text-decoration: underline;
}
.cl-remove:hover { color: var(--shop-accent); }

.cart-summary {
    border: 1px solid var(--shop-line);
    border-radius: 10px;
    padding: 20px;
    background: #fafafa;
    position: sticky;
    top: 20px;
}
.cart-summary h4 { margin: 0 0 14px 0; font-weight: 700; font-size: 17px; }
.cart-summary .cs-row {
    display: flex; justify-content: space-between;
    padding: 7px 0; font-size: 14px; color: #444;
}
.cart-summary .cs-total {
    display: flex; justify-content: space-between;
    border-top: 1px solid #ddd; margin-top: 10px; padding-top: 12px;
    font-size: 19px; font-weight: 700; color: var(--shop-ink);
}
.cart-summary .cs-note { font-size: 12px; color: var(--shop-muted); margin-top: 10px; }
.cart-summary .shop-btn { margin-top: 16px; }

.cart-empty { text-align: center; padding: 60px 20px; }
.cart-empty .fa { font-size: 54px; color: #d8d8d8; margin-bottom: 18px; }
.cart-empty h2 { font-size: 24px; font-weight: 700; margin: 0 0 8px 0; }
.cart-empty p { color: var(--shop-muted); margin-bottom: 22px; }

/* ---------------------------------------------------------------
   6. ADD TO CART CONFIRMATION (product page)
   --------------------------------------------------------------- */

.added-banner {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 16px 18px; margin-bottom: 24px;
    background: #e8f7ec; border: 1px solid #b6e3c2; border-radius: 8px;
}
.added-banner .ab-text { flex: 1 1 240px; font-weight: 600; color: #1c6b34; }
.added-banner .fa-check-circle { font-size: 20px; color: #2e9e51; }

/* ---------------------------------------------------------------
   7. TOAST
   --------------------------------------------------------------- */

#shop-toast {
    position: fixed; left: 50%; bottom: 30px;
    transform: translateX(-50%) translateY(20px);
    z-index: 3000;
    max-width: 90vw;
    padding: 13px 20px;
    border-radius: 8px;
    background: var(--shop-ink);
    color: #fff; font-size: 14px; font-weight: 500;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
#shop-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
#shop-toast.warn { background: #a3341c; }

/* ---------------------------------------------------------------
   8. STICKY MOBILE CHECKOUT BAR
   --------------------------------------------------------------- */

.shop-mobile-bar {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 1100;
    padding: 10px 14px;
    background: #fff;
    border-top: 1px solid var(--shop-line);
    box-shadow: 0 -4px 18px rgba(0,0,0,.10);
    align-items: center; gap: 12px;
}
.shop-mobile-bar .smb-info { flex: 1 1 auto; line-height: 1.25; }
.shop-mobile-bar .smb-label { font-size: 11px; color: var(--shop-muted); text-transform: uppercase; letter-spacing: .04em; }
.shop-mobile-bar .smb-total { font-size: 18px; font-weight: 700; color: var(--shop-ink); }
.shop-mobile-bar .shop-btn { flex: 0 0 auto; }

/* ---------------------------------------------------------------
   9. RESPONSIVE
   --------------------------------------------------------------- */

@media (max-width: 991px) {
    /* Keep the cart button on the same line as the login links */
    .header .right ul li { vertical-align: middle; }
    .shop-cart-btn { padding: 8px 14px; }
}

@media (max-width: 767px) {

    .cart-aside { flex: 1 1 100%; }
    .cart-summary { position: static; }

    .cart-line { gap: 12px; padding: 16px 0; flex-wrap: wrap; }
    .cart-line img { width: 74px; height: 74px; flex: 0 0 74px; }
    .cart-line .cl-name { font-size: 15px; }
    .cart-line .cl-total {
        flex: 1 1 100%; text-align: left; margin-top: 10px; font-size: 16px;
    }
    .cart-line .cl-total .cl-total-label { color: var(--shop-muted); font-weight: 400; font-size: 13px; }

    /* Room for the fixed bottom bar */
    body.has-mobile-bar { padding-bottom: 78px; }
    .shop-mobile-bar { display: flex; }

    #shop-toast { bottom: 88px; }

    .shop-mini-cart { position: fixed; left: 12px; right: 12px; top: auto; bottom: 90px; width: auto; }
}

@media (min-width: 768px) {
    .cl-total-label { display: none; }
}


/* ---------------------------------------------------------------
   10. PAYMENT METHOD BLOCKS
   Their children are floated Bootstrap columns, so without a
   clearfix the wrapper collapses to zero height and the next
   block slides underneath it.
   --------------------------------------------------------------- */

#cashfree_form::after,
#paypal_form::after,
#bank_form::after,
#stripe_form::after { content: ""; display: table; clear: both; }

#cashfree_form, #paypal_form, #bank_form, #stripe_form { width: 100%; }
