/* =========================
   BASE / DESKTOP STYLES
   ========================= */

.vm-order-wrapper {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
}

/* Scroll container */
.vm-table-scroll {
    width: 100%;
}

/* Table */
.vm-order-table {
    width: 100%;
    border-collapse: collapse;
    /* allow content-based width */
    /* table-layout: auto;  */
    table-layout: fixed;   /* 🔥 MOST IMPORTANT */
}

.vm-order-table th,
.vm-order-table td {
    border: 1px solid #dddddd;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.vm-order-table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* =========================
   ITEM COLUMN (NO EXTRA SPACE)
   ========================= */

/* .vm-order-table td:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    white-space: normal;
} */
/* ITEM CELL – tighter layout */
.vm-order-table td:first-child {
    display: flex;
    align-items: center;
    gap: 10px;                 /* controlled spacing */
    padding-right: 12px;       /* prevent over-stretch */
    white-space: normal;
}
/* Wrap text + meta + button */
.vm-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;  /* 🔥 removes extra vertical space */
}
/* Image */
.vm-item-img {
    width: 55px;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    cursor: pointer;
}

/* Title */
.vm-item-title {
    font-size: 13px;    
    line-height: 1.2;
    font-weight:900 !important;
    color:#000 !important;
}

/* View button — INLINE */
.vm-view-btn {
    background-color: #ff7a00 !important;
    color: #ffffff !important;
    padding: 6px 14px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer;
    white-space: nowrap;
    align-self: flex-start;    /* 🔥 stops stretching */
    width: 80px !important;
}


.vm-view-btn:hover {
    background-color: #e66900 !important;
}

/* Image zoom on hover */
.vm-item-img:hover {
    transform: scale(2.5);
    z-index: 20;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* =========================
   REQUIRED QTY
   ========================= */
/* REQUIRED QTY COLUMN */
.vm-order-table th:nth-child(5),
.vm-order-table td:nth-child(5) {
    width: 80px;              /* 🔥 reduced width */
    padding-left: 6px;
    padding-right: 6px;
}

.vm-add-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}


/* Quantity input smaller */
/* .vm-qty {
    width: 55px;
    padding: 4px;
} */

.vm-add-wrap input[type="checkbox"] {
    margin: 0;
}
/* ITEM COLUMN WIDTH CONTROL */
.vm-col-item {
    width: 400px;          /* 🔥 adjust: try 220–280px */
    max-width: 400px;
    padding-right: 8px;
}

/* =========================
   STICKY TOTAL BAR
   ========================= */

.vm-sticky-total {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Checkout button (unchanged) */
.vm-checkout-btn {
    background: #2e7d32 !important;
    color: #ffffff !important;
    padding: 14px 28px !important;
    border-radius: 999px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border: none !important;
    cursor: pointer;
}

.vm-view-btn:hover {
    background-color: #e66900 !important;
}

.vm-checkout-btn {
    display: inline-block !important;
    background: #2e7d32 !important;
    color: #ffffff !important;
    padding: 14px 28px !important;
    border-radius: 999px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border: none !important;
    cursor: pointer;
}

.vm-checkout-btn:hover {
    background: #1b5e20 !important;
}

#vm-error {
    color: red;
    margin: 10px 0;
}


/* =========================
   POPUP
   ========================= */

.vm-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}


.vm-popup {
    background: #ffffff;
    padding: 25px;
    font-weight: 900 !important;
    font-size: 14px !important;
    width: 90%;
    max-width: 900px;     /* wider popup */
    max-height: 85vh;     /* taller popup */
    overflow-y: auto;
    border-radius: 10px !important;
    position: relative;
}

.vm-popup img {
    max-width: 100%;
    margin-bottom: 12px;
}

.vm-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 22px;
    cursor: pointer;
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 600px) {

    .vm-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .vm-table-scroll table {
        min-width: 900px;
    }

    .vm-item-img {
        width: 42px;
    }

    .vm-view-btn {
        padding: 5px 10px !important;
        font-size: 11px !important;
    }

    .vm-sticky-total {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #ddd;
        padding: 10px;
        z-index: 999;
    }

    body {
        padding-bottom: 90px;
    }
}
/* =========================
   ITEM META (UNDER TITLE)
   ========================= */
/* 
.vm-item-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

.vm-item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 10px;
    white-space: nowrap;
} */

/* =========================
   TOOLTIP (VIEW DETAILS)
   ========================= */

.vm-tooltip {
    position: absolute;
    background: #ffffff;
    border: 1px solid #ddd;
    font-weight: 900;
    font-size: 14px;
    color: #333;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    width: 220px;
    display: none;
    padding: 25px;
    width: 90%;
    max-width: 600px;     /* wider popup */
    max-height: 85vh;     /* taller popup */
    overflow-y: auto;
    border-radius: 10px !important;

}



.vm-tooltip img {
    max-width: 100%;
    margin-bottom: 12px;
}

/* Arrow */
.vm-tooltip::after {
    content: "";
    position: absolute;
    top: -6px;
    left: 20px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #ddd transparent;
}

/* =========================
   MOBILE: COLLAPSE META
   ========================= */


@media (max-width: 600px) {

    /* Item column layout */
    .vm-order-table td:first-child {
        align-items: flex-start;
    }

    /* Meta block stacked */
    .vm-item-meta {
        display: flex;
        flex-direction: column;
        gap: 2px;              /* 🔥 tight vertical stack */
        font-size: 12px;
        font-weight:900 !important;
        color:#000 !important;
    }

}
/* Prevent image + button from forcing width */
.vm-item-img {
    flex-shrink: 0;
}

.vm-item-content {
    min-width: 0;          /* 🔥 allows text wrapping */
}

.vm-item-title,
.vm-item-meta {
    word-wrap: break-word;
    font-weight:900 !important;
    color:#000 !important;
}

.vm-view-btn {
    padding: 4px 10px !important;
    font-size: 12px !important;
}

/* =====================================
   FIX: FORCE NUMBER INPUT SPIN BUTTONS
   ===================================== */

/* Show number spinners on mobile */
.vm-qty {
    -webkit-appearance: number-input;
    appearance: number-input;
}

/* Touch-friendly quantity + spinner size */
@media (max-width: 600px) {
    .vm-qty {
        width: 72px !important;     /* wider so spinner fits */
        height: 36px !important;    /* taller for touch */
        padding: 6px !important;
        font-size: 14px;
    }
}

/* Make checkbox + input area touch friendly */
.vm-add-wrap {
    min-height: 40px;
}

/* iOS Safari specific fix */
input[type="number"] {
    -webkit-text-size-adjust: 100%;
}

/* =========================
   CUSTOM QTY CONTROLS (MOBILE SAFE)
   ========================= */

.vm-qty-minus,
.vm-qty-plus {
    width: 28px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #2e7d32 !important;
    color: #ffffff !important;   
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 10px;
}


.vm-qty {
    width: 40px;
    text-align: center;
    font-size: 14px;
}

.vm-qty-minus:disabled,
.vm-qty-plus:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Mobile friendly */
@media (max-width: 600px) {
    .vm-qty-minus,
    .vm-qty-plus {
        width: 40px;
        height: 36px;
        font-size: 20px;
        
    }

    .vm-qty {
        width: 40px;
        height: 36px;
    }
}
.vm-qty-minus,
.vm-qty-plus {
    touch-action: manipulation;
}

/* =========================
   RESPONSIVE LAYOUT SWITCH
   ========================= */
.vm-desktop-only { display: block; }
.vm-mobile-only { display: none; }

@media (max-width: 600px) {
    .vm-desktop-only { display: none; }
    .vm-mobile-only { display: block; }
}

/* =========================
   MOBILE ITEM CARD
   ========================= */
.vm-item-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.vm-card-header {
    display: flex;
    gap: 10px;
    align-items: center;
     color: #000;
    font-weight: bolder;
}

.vm-item-meta {
    font-size: 12px;
    color: #000;
    font-weight: bolder;
      display: flex;
    flex-direction: column;
}


.vm-card-total {
    margin-top: 8px;
    font-weight: bold;
}

.vm-ordered-items {
    margin-top: 8px;
    font-weight: bold;
}

/* Qty controls already styled earlier */

/* =========================
   MOBILE: ITEM META IN ONE LINE
   ========================= */
@media (max-width: 600px) {

    .vm-item-meta {
        display: block;  /* cancel column layout */
        font-size: 12px;
         color: #000;
        font-weight: bolder;
        line-height: 1.4;
        white-space: normal;
    }

    /* Add commas between lines visually */
    .vm-item-meta br {
        display: none;
    }
}

/* ==================================================
   FIX: COMPACT QTY CONTROLS (NO GAPS)
   ================================================== */

.vm-add-wrap {
    display: inline-flex;          /* 🔥 inline-flex removes gaps */
    align-items: center;
    gap: 0 !important;             /* 🔥 force no gap */
}

/* Minus & Plus buttons */
.vm-qty-minus,
.vm-qty-plus {
    width: 36px;
    height: 36px;
    border-radius: 6px 0 0 6px;     /* left rounded */
    border: 1px solid #ddd;
    background: #8bc34a;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    margin: 0 !important;
}



/* Quantity input */
.vm-qty {
    width: 50px;
    height: 36px;
    text-align: center;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    border-left: 0;                 /* 🔥 merge borders */
    border-right: 0;                /* 🔥 merge borders */
    margin: 0 !important;
    padding: 0;
    font-size: 14px;
    border-radius: 0;               /* 🔥 no rounding */
}

/* Disabled state */
.vm-qty-minus:disabled,
.vm-qty-plus:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* ==================================================
   FIX: QTY CONTROL ALIGNMENT (DESKTOP + MOBILE)
   ================================================== */

/* Wrapper */
.vm-add-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0 !important;            /* no gap between - 0 + */
}

/* Add gap ONLY between checkbox and minus button */
.vm-add-wrap input[type="checkbox"] {
    margin-right: 8px;            /* ✅ space after checkbox */
}

/* Minus & Plus buttons */
.vm-qty-minus,
.vm-qty-plus {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: #8bc34a;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    margin: 0 !important;
    padding: 0;
}



/* Quantity input */
.vm-qty {
    width: 50px;
    height: 36px;                /* ✅ EXACT same height */
    line-height: 36px;           /* ✅ vertical centering */
    text-align: center;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    border-left: 0;
    border-right: 0;
    border-radius: 0 !important; /* ❌ NO rounding */
    margin: 0 !important;
    padding: 0;
    font-size: 14px;
    box-shadow: none;
    appearance: number-input;
    -webkit-appearance: number-input;
}

/* Disabled state */
.vm-qty-minus:disabled,
.vm-qty-plus:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Left & right rounding */
.vm-qty-minus {
    width: 40px !important;
    height:40px !important;
    border-radius: 10px 0 0 10px !important;
}

.vm-qty-plus {
    width: 40px !important;
    height:40px !important;
    border-radius: 0 10px 10px 0 !important;
}

.vm-qty{
    width: 60px !important;
    height:40px !important
}
.vm-qty-minus:hover,
.vm-qty-plus:hover {
      height:40px !important;
      background: #1b5e20 !important;}

.vm-item-meta{
    font-weight:900 !important;
    color:#000 !important;
}


.vm-item-meta {
        display: block !important;  /* cancel column layout */
        font-size: 12px;
         color: #000;
        font-weight: bolder;
        line-height: 1.4;
        white-space: normal;
    }

    /* Add commas between lines visually */
    .vm-item-meta br {
        display: none !important;
    }

    .vm-ordered-items {
    margin-top: 8px;
    font-weight: bold;
}