/* =========================================================
   SKC Product Table Add-on – layout for all devices
   Desktop: full table · Tablet: compact table · Phone: cards
   ========================================================= */
.skc-rt {
    --skc-blue: #0b5aa6;
    --skc-orange: #ff6a00;
    --skc-row: #fff7f3;
    --skc-row-picked: #ffeedd;
    --skc-line: #eadfd8;
    --skc-ink: #1d1d1f;
    --skc-muted: #8a8a8a;
    max-width: 100%;
    box-sizing: border-box;
}
.skc-rt *,
.skc-rt *::before,
.skc-rt *::after { box-sizing: border-box; }
.skc-rt img { max-width: 100%; height: auto; }
.skc-rt .wpt_table_tag_wrapper { max-width: 100%; }

/* ---------- Top controls ---------- */
.skc-rt .all_check_header_footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.skc-rt .wpt-stats-report {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
}
.skc-rt .wpt-search-full-wrapper input[type="search"],
.skc-rt .wpt-search-full-wrapper input[type="text"] { max-width: 100%; }

/* ---------- Table (desktop) ---------- */
.skc-rt .wpt-table-tag { width: 100%; border-collapse: collapse; table-layout: auto; }
.skc-rt .wpt-tr-tag.wpt_row > .wpt-td-tag { vertical-align: middle; }
.skc-rt .wpt-tr-tag.wpt_row { background: var(--skc-row); }
.skc-rt .wpt-tr-tag.wpt_row.wpt_selected_tr > .wpt-td-tag,
.skc-rt .wpt-tr-tag.wpt_row.skc-picked > .wpt-td-tag { background: var(--skc-row-picked) !important; }
.skc-rt .wpt_product_title a,
.skc-rt a.wpt_product_title_in_td { word-break: break-word; overflow-wrap: anywhere; }
.skc-rt .wpt_price del,
.skc-rt .skc-mrp { color: var(--skc-muted); font-weight: 600; white-space: nowrap; }
.skc-rt .wpt_price ins { text-decoration: none; font-weight: 800; white-space: nowrap; }
.skc-rt .skc-per,
.skc-rt .skc-our-price { font-weight: 800; white-space: nowrap; }
.skc-rt .wpt_quantity .quantity { display: inline-flex; max-width: 100%; }
.skc-rt .wpt_quantity input.qty {
    width: 80px;
    max-width: 100%;
    min-height: 40px;
    text-align: center;
    font-size: 16px;            /* 16px stops iPhone zooming in */
    border-radius: 6px;
}
.skc-rt .wpt_quantity input.qty:focus {
    border-color: var(--skc-orange) !important;
    box-shadow: 0 0 0 2px rgba(255, 106, 0, .25);
    outline: none;
}
.skc-rt .wpt_total strong { white-space: nowrap; }
.skc-rt .wpt_thumbnails img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; }

/* ---------- Category heading rows ---------- */
.skc-rt .skc-cat-row > .skc-cat-cell,
.wpt-wrap .skc-cat-row > .skc-cat-cell {
    color: #fff !important;
    font-weight: 800 !important;
    text-align: center !important;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-size: 18px;
    line-height: 1.3;
    padding: 14px 10px !important;
    border: 0 !important;
}
.wpt-wrap .skc-cat-row.skc-cat-blue > .skc-cat-cell { background: var(--skc-blue, #0b5aa6) !important; }
.wpt-wrap .skc-cat-row.skc-cat-orange > .skc-cat-cell { background: var(--skc-orange, #ff6a00) !important; }
.wpt-wrap section.skc-cat-row,
.wpt-wrap div.skc-cat-row { display: block; }
.wpt-wrap .skc-cat-row > div.skc-cat-cell { display: block; width: 100%; }

/* ---------- Tablet & small laptop ---------- */
@media (max-width: 1024px) {
    .skc-rt .wpt_table_tag_wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .skc-rt .wpt-tr-tag > .wpt-td-tag,
    .skc-rt .wpt-tr-tag > th { padding: 8px 6px !important; font-size: 15px; }
    .skc-rt .wpt_thumbnails img { width: 56px; height: 56px; }
    .skc-rt .wpt_quantity input.qty { width: 64px; }
}

/* ---------- Phones: product cards ---------- */
@media (max-width: 767px) {
    .skc-rt .wpt_table_tag_wrapper { overflow: visible; }
    .skc-rt .wpt-table-tag,
    .skc-rt .wpt-tbody-tag { display: block !important; width: 100% !important; }
    .skc-rt .wpt-thead-tag,
    .skc-rt .wpt_table_header_row { display: none !important; }

    /* heading bars */
    .skc-rt .skc-cat-row { display: block !important; margin: 14px 0 8px; border-radius: 8px; overflow: hidden; }
    .skc-rt .skc-cat-row > .skc-cat-cell { display: block !important; width: 100% !important; font-size: 15px; padding: 11px 8px !important; }

    /* product card */
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row {
        display: grid !important;
        grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 30px;
        grid-template-areas:
            "img title title chk"
            "img per   mrp   mrp"
            "img price price price"
            "img qty   tot   tot";
        column-gap: 10px;
        row-gap: 0;
        align-items: center;
        width: 100% !important;
        margin: 0 0 8px !important;
        padding: 10px !important;
        border: 1px solid var(--skc-line) !important;
        border-radius: 10px;
        flex-direction: initial !important;
    }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag {
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 2px 0 !important;
        border: 0 !important;
        background: transparent !important;
        text-align: left !important;
        font-size: 15px;
        grid-column: 2 / -1;
    }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row.skc-picked { background: var(--skc-row-picked) !important; border-color: var(--skc-orange) !important; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag::before { display: none !important; }
    .skc-rt .wpt-tr-tag.wpt_row > .wpt-td-tag > div { margin-left: 0 !important; }

    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_serial_number { display: none !important; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_thumbnails { grid-area: img !important; align-self: start; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_thumbnails img { width: 64px !important; height: 64px !important; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_check { grid-area: chk !important; justify-self: end; align-self: start; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_check input { width: 20px; height: 20px; margin: 0; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_product_title { grid-area: title !important; font-weight: 700; line-height: 1.3; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_product_title a { min-width: 0 !important; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_skc_per { grid-area: per !important; font-size: 13px; color: var(--skc-muted); }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_skc_mrp { grid-area: mrp !important; font-size: 13px; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_price,
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_skc_price { grid-area: price !important; font-size: 16px; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_quantity { grid-area: qty !important; padding-top: 6px !important; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_total {
        grid-area: tot !important;
        justify-self: end;
        text-align: right !important;
        padding-top: 6px !important;
        font-size: 16px;
    }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_quantity input.qty { width: 90px; min-height: 42px; }

    /* controls */
    .skc-rt .all_check_header_footer .add_to_cart_all_selected { flex: 1 1 auto; text-align: center; }
    .skc-rt .all_check_header_footer > span { flex: 0 0 auto; }
    .skc-rt .wpt-stats-report { font-size: 14px; }
}

@media (max-width: 380px) {
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row { grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr) 26px; column-gap: 8px; padding: 8px !important; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_thumbnails img { width: 52px !important; height: 52px !important; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_quantity input.qty { width: 72px; }
    .skc-rt .wpt-tbody-tag > .wpt-tr-tag.wpt_row > .wpt-td-tag { font-size: 14px; }
}

/* ---------- Sticky order bar ---------- */
.skc-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #111;
    color: #fff;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, .25);
    font-size: 15px;
    line-height: 1.2;
    transform: translateY(110%);
    transition: transform .25s ease;
}
.skc-bar.is-on { transform: translateY(0); }
.skc-bar__info { display: flex; gap: 22px; align-items: flex-end; }
.skc-bar__info > div { display: flex; flex-direction: column; }
.skc-bar__info span { opacity: .7; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.skc-bar__info b { font-size: 18px; }
.skc-bar__total { color: #ffb27a; font-size: 20px !important; font-weight: 800; }
.skc-bar__actions { display: flex; gap: 8px; }
.skc-bar__btn,
.skc-bar__clear {
    border: 0;
    border-radius: 8px;
    padding: 11px 20px;
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}
.skc-bar__btn { background: #ff6a00; color: #fff; }
.skc-bar__btn:hover, .skc-bar__btn:focus { background: #e25e00; color: #fff; }
.skc-bar__clear { background: #fff; color: #111; }
.skc-bar__clear:hover, .skc-bar__clear:focus { background: #eee; color: #111; }
body.skc-has-bar { padding-bottom: 80px; }
@media (max-width: 560px) {
    .skc-bar { justify-content: space-between; gap: 8px; padding-left: 10px; padding-right: 10px; }
    .skc-bar__info { gap: 12px; }
    .skc-bar__info b { font-size: 15px; }
    .skc-bar__total { font-size: 16px !important; }
    .skc-bar__btn, .skc-bar__clear { padding: 10px 12px; font-size: 14px; }
}
@media (max-width: 360px) {
    .skc-bar__info > div:nth-child(2) { display: none; }
}

/* ---------- Quick order mode: hide cart buttons ---------- */
body.skc-hide-cart .wpt-wrap .all_check_header_footer,
body.skc-hide-cart .wpt-wrap .wpt_action .add_to_cart_button,
body.skc-hide-cart .wpt-wrap .wpt_action .single_add_to_cart_button,
body.skc-hide-cart .wpt-wrap .wpt_action .wpt_woo_add_cart_button,
body.skc-hide-cart .wpt-wrap .tables_cart_message_box,
body.skc-hide-cart .wpt-wrap .wpt-cart-remove { display: none !important; }
