/* ===================================================================
   Order pages — cart UI (shared by shop.php cards + index.php table)
   =================================================================== */

:root {
    --rst-primary: #df4538;
    --rst-green: #027d15;
    --rst-dark: #1b1a1a;
    --rst-border: #e6e6e6;
    --rst-blue: #cfe9f7;
    --rst-blue-dark: #b3dcf0;
}

.order-wrap { padding: 18px 16px 40px; background: var(--rst-blue); }

.order-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.order-toolbar .order-search {
    flex: 1 1 240px;
    max-width: 420px;
    border: 1px solid var(--rst-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    outline: none;
}
.order-toolbar .order-search:focus { border-color: var(--rst-primary); }

.order-note {
    background: #fff4e5;
    border: 1px solid #ffd8a8;
    color: #8a5300;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 14px;
    text-align: center;
}

/* ---- Category section heading ---- */
.cat-heading {
    background: var(--rst-primary);
    color: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    margin: 26px 0 16px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cat-heading .cat-off {
    background: #fff;
    color: var(--rst-primary);
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 13px;
    font-weight: 700;
}

/* ===================== CARD LAYOUT (shop.php) ===================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}
.pcard {
    border: 1px solid var(--rst-border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s, border-color .2s;
    position: relative;
}
.pcard:hover { box-shadow: 0 8px 24px rgba(0,0,0,.10); transform: translateY(-2px); }
.pcard.in-cart { border-color: var(--rst-green); box-shadow: 0 0 0 2px rgba(2,125,21,.15); }

.pcard__media {
    position: relative;
    background: #f7f7f7;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pcard__media img { width: 100%; height: 100%; object-fit: contain; }
.pcard__off {
    position: absolute; top: 8px; left: 8px;
    background: var(--rst-primary); color: #fff;
    font-size: 12px; font-weight: 700;
    padding: 3px 8px; border-radius: 6px;
}
.pcard__nostock {
    position: absolute; inset: 0;
    background: rgba(255,255,255,.7);
    display: flex; align-items: center; justify-content: center;
    color: #c0392b; font-weight: 700; font-size: 15px;
}
.pcard__body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.pcard__name { font-size: 14px; font-weight: 600; color: #222; line-height: 1.3; min-height: 36px; }
.pcard__name small { display: block; color: #777; font-weight: 400; font-size: 12px; }
.pcard__price { margin: 6px 0 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pcard__mrp { color: #999; text-decoration: line-through; font-size: 13px; }
.pcard__net { color: var(--rst-green); font-size: 18px; font-weight: 700; }
.pcard__foot { margin-top: auto; }

/* Add button / stepper */
.add-btn {
    width: 100%;
    border: none;
    background: var(--rst-primary);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.add-btn:hover { background: #c5392d; }
.add-btn.added { background: var(--rst-green); }
.add-btn:disabled { background: #bbb; cursor: not-allowed; }

.stepper {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--rst-primary);
    border-radius: 8px;
    overflow: hidden;
}
.stepper__btn {
    border: none;
    background: var(--rst-primary);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    width: 38px;
    cursor: pointer;
    line-height: 1;
}
.stepper__btn:hover { background: #c5392d; }
.stepper__val {
    flex: 1;
    border: none;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    width: 100%;
    -moz-appearance: textfield;
}
.stepper__val::-webkit-outer-spin-button,
.stepper__val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pcard.in-cart .add-line { display: none; }
.pcard:not(.in-cart) .stepper-line { display: none; }

/* ===================== TABLE LAYOUT (index.php) ===================== */
.order-table { width: 100%; border-collapse: collapse; background: var(--rst-blue); }
.order-table th, .order-table td {
    border: 1px solid #fff;
    padding: 8px 6px;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
}
.order-table tbody td { background: var(--rst-blue); }
.order-table thead th {
    background: var(--rst-blue-dark);
    color: #1b3a4a;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2;
}
.order-table tr.cat-row td {
    background: var(--rst-primary) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 15px;
    text-align: left;
}
.order-table tr.row-instock.in-cart td { background: #f1fbf2; }
.order-table tr.row-nostock { display: none; }
.order-table .ot-img { width: 54px; height: 54px; object-fit: contain; cursor: pointer; background:#f7f7f7; border-radius:6px; }
.order-table .ot-name { text-align: left; font-weight: 600; color: #222; }
.order-table .ot-name small { color: #777; font-weight: 400; display:block; }
.order-table .ot-mrp { color: #999; text-decoration: line-through; }
.order-table .ot-net { color: var(--rst-green); font-weight: 800; }
.order-table .ot-stepper { display: inline-flex; }
.order-table .ot-stepper .stepper { width: 118px; }
.order-table .ot-line { color: var(--rst-dark); font-weight: 700; white-space: nowrap; }

/* ===================== STICKY SUMMARY BAR ===================== */
.summary-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: var(--rst-primary);
    color: #fff;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,.15);
    padding: 10px 16px;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.summary-bar__totals { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; }
.summary-bar__totals b { font-size: 16px; }
.summary-bar__view {
    background: #fff;
    color: var(--rst-primary);
    border: none;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
}
.summary-bar__view .cart-count {
    background: var(--rst-green);
    color: #fff;
    border-radius: 12px;
    padding: 0 7px;
    font-size: 12px;
    margin-left: 6px;
}

/* ===================== CART DRAWER ===================== */
#cart-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    opacity: 0; visibility: hidden;
    transition: opacity .25s;
    z-index: 1090;
}
#cart-overlay.show { opacity: 1; visibility: visible; }

#cart-drawer {
    position: fixed;
    top: 0; right: 0;
    height: 100%;
    width: 400px;
    max-width: 92vw;
    background: #fff;
    z-index: 1100;
    transform: translateX(100%);
    transition: transform .28s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -6px 0 24px rgba(0,0,0,.2);
}
#cart-drawer.open { transform: translateX(0); }

.cart-drawer__head {
    background: var(--rst-primary);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
}
.cart-drawer__close {
    background: none; border: none; color: #fff;
    font-size: 26px; line-height: 1; cursor: pointer;
}
#cart-items { flex: 1; overflow-y: auto; padding: 10px 14px; }
.cart-empty { text-align: center; color: #888; padding: 50px 10px; font-size: 15px; }

.cart-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--rst-border);
    align-items: center;
}
.cart-item__img { width: 52px; height: 52px; object-fit: contain; background: #f7f7f7; border-radius: 6px; flex: 0 0 auto; }
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-size: 13.5px; font-weight: 600; color: #222; line-height: 1.25; }
.cart-item__name small { color: #888; font-weight: 400; }
.cart-item__price { font-size: 12px; color: #666; margin: 2px 0 6px; }
.cart-item__right { text-align: right; flex: 0 0 auto; }
.cart-item__total { font-weight: 700; color: var(--rst-dark); font-size: 14px; white-space: nowrap; }
.cart-item__remove { background: none; border: none; color: #c0392b; font-size: 20px; cursor: pointer; line-height: 1; }

.cart-stepper { display: inline-flex; border: 1px solid var(--rst-primary); border-radius: 6px; overflow: hidden; }
.cart-stepper__btn { border: none; background: var(--rst-primary); color: #fff; width: 28px; font-size: 16px; cursor: pointer; line-height: 1; }
.cart-stepper__val { width: 42px; border: none; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.cart-stepper__val::-webkit-outer-spin-button,
.cart-stepper__val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart-drawer__foot { border-top: 2px solid var(--rst-border); padding: 14px 18px; background: #fafafa; }
.cart-foot__row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.cart-foot__row.net { font-size: 18px; font-weight: 700; color: var(--rst-primary); }
#cart-min-note { display: none; background: #fff4e5; border: 1px solid #ffd8a8; color: #8a5300; border-radius: 6px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }
.cart-foot__btn {
    display: block; width: 100%; text-align: center;
    background: var(--rst-green); color: #fff;
    border: none; border-radius: 8px;
    padding: 12px; font-size: 16px; font-weight: 700;
    cursor: pointer; margin-top: 8px;
}
.cart-foot__btn:hover { filter: brightness(.95); }

body.cart-open { overflow: hidden; }

/* ===================== CHECKOUT SECTION ===================== */
.checkout-card {
    border: 1px solid var(--rst-border);
    border-radius: 12px;
    background: #fff;
    padding: 22px;
    margin-top: 26px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.checkout-card h3 { color: var(--rst-primary); margin-bottom: 16px; font-weight: 700; }
.checkout-card .form-group { margin-bottom: 14px; }
.checkout-card label { font-weight: 600; font-size: 14px; margin-bottom: 4px; display: block; }
.checkout-card .form-control { width: 100%; border: 1px solid var(--rst-border); border-radius: 8px; padding: 10px 12px; font-size: 15px; }
.checkout-card .form-control:focus { border-color: var(--rst-primary); outline: none; }
.checkout-submit {
    background: var(--rst-primary); color: #fff; border: none;
    border-radius: 8px; padding: 12px 26px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.checkout-submit:hover { background: #c5392d; }
.checkout-submit:disabled { background: #bbb; cursor: not-allowed; }
.terms-box { font-size: 13px; color: #555; margin-top: 16px; }
.terms-box ul { padding-left: 18px; }

/* ===================== IMAGE POPUP (Bootstrap modal) =====================
   The theme's style.css defines its own ".modal" (quickview/newsletter popups)
   with visibility:hidden; opacity:0; z-index:99, which overrides Bootstrap 5's
   modal and keeps the product image popups invisible & behind the backdrop.
   These rules restore Bootstrap behaviour, scoped to .modal.fade only so the
   theme's own popups (which use .modal + .is-visible, no .fade) are untouched. */
.modal.fade {
    display: none;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    background: transparent;
    cursor: auto;
    visibility: visible;
    opacity: 1;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 1055;
}
.modal-backdrop { z-index: 1050; }

/* ===================== FLOATING PRICE LIST BADGE ===================== */
.pl-float {
    position: fixed;
    left: 14px;
    bottom: 152px;
    z-index: 1080;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* background: linear-gradient(135deg, #ff5a3c, #df4538); */
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: .5px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    /* box-shadow: 0 6px 16px rgba(0,0,0,.30); */
    transform: rotate(-6deg);
    transition: transform .15s ease, box-shadow .15s ease;
}
.pl-float:hover {
    color: #fff;
    /* transform: rotate(-6deg) scale(1.06);
    box-shadow: 0 8px 20px rgba(0,0,0,.36); */
}
.pl-float__spark { font-size: 16px; line-height: 1; }
@media (max-width: 600px) {
    .pl-float { left: 10px; bottom: 156px; font-size: 12px; padding: 8px 11px; }
}

/* ===================== FLOATING WHATSAPP BUTTON ===================== */
.wa-float {
    position: fixed;
    left: 18px;
    bottom: 88px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.28);
    z-index: 1080;
    transition: transform .15s ease, box-shadow .15s ease;
}
.wa-float:hover {
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0,0,0,.34);
}
@media (max-width: 600px) {
    .wa-float { width: 50px; height: 50px; left: 14px; bottom: 96px; }
}

@media (max-width: 600px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .pcard__name { min-height: 32px; font-size: 13px; }
    .pcard__net { font-size: 16px; }
    .summary-bar__totals { gap: 12px; font-size: 12px; }
    .order-table th, .order-table td { font-size: 11px; padding: 5px 3px; }
    .order-table .ot-stepper .stepper { width: 96px; }
    .order-table .stepper__btn { width: 28px; font-size: 16px; }
}
