/* ==========================================================================
   ED Quick Order — Styles
   ALL selectors scoped under #ed-quick-order to prevent conflicts with
   other plugins (YITH Wishlist, Flatsome, WooCommerce, etc.)
   ========================================================================== */

#ed-quick-order {
    font-family: inherit;
    color: inherit;
}

/* --------------------------------------------------------------------------
   Help panel
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-help-panel {
    background: #f0f3fb;
    border-left: 4px solid #283474;
    border-radius: 6px;
    margin-bottom: 24px;
    padding: 0;
}

#ed-quick-order .ed-qo-help-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
}

#ed-quick-order .ed-qo-help-title {
    font-size: 18px;
    font-weight: 700;
    color: #283474;
    margin: 0 0 8px;
}

#ed-quick-order .ed-qo-help-body {
    font-size: 14px;
    color: #444;
    line-height: 1.4;
    margin: 0;
}

#ed-quick-order .ed-qo-help-body i {
    color: #283474;
}

#ed-quick-order .ed-qo-help-dismiss {
    flex-shrink: 0;
    background: none;
    border: 1px solid #283474;
    color: #283474;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s;
    margin-top: 2px;
}

#ed-quick-order .ed-qo-help-dismiss:hover {
    background: #283474;
    color: #fff;
}

#ed-quick-order .ed-qo-help-restore {
    margin-bottom: 16px;
}

#ed-quick-order .ed-qo-help-restore-btn {
    background: none;
    border: none;
    color: #283474;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.75;
    transition: opacity 0.15s;
}

#ed-quick-order .ed-qo-help-restore-btn:hover {
    opacity: 1;
}

@media ( max-width: 640px ) {
    #ed-quick-order .ed-qo-help-inner {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    #ed-quick-order .ed-qo-help-dismiss {
        align-self: flex-start;
    }
}

/* --------------------------------------------------------------------------
   Filter bar
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-filter {
    margin-bottom: 24px;
}

#ed-quick-order .ed-qo-filter-cols {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

#ed-quick-order .ed-qo-filter-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px;
    min-width: 0;
}

#ed-quick-order .ed-qo-filter-col--search { flex: 0 0 40%; }
#ed-quick-order .ed-qo-filter-col--cat    { flex: 0 0 calc(50% - 24px); }
#ed-quick-order .ed-qo-filter-col--btn    { flex: 1 1 auto; }

#ed-quick-order .ed-qo-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}

#ed-quick-order .ed-qo-label--hidden {
    visibility: hidden;
    pointer-events: none;
}

#ed-quick-order .ed-qo-search-input,
#ed-quick-order .ed-qo-select {
    width: 100% !important;
    max-width: 100% !important;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: inherit;
    box-sizing: border-box;
    display: block !important;
}

#ed-quick-order .ed-qo-search-input::placeholder {
    color: #bbb;
}

#ed-quick-order .ed-qo-search-input:focus,
#ed-quick-order .ed-qo-select:focus {
    outline: none;
    border-color: #999;
}

#ed-quick-order .ed-qo-select {
    cursor: pointer;
}

#ed-quick-order .ed-qo-search-btn {
    width: 100%;
    height: 44px;
    padding: 0 !important;
    white-space: nowrap;
    font-size: 14px;
}

#ed-quick-order .ed-qo-clear-link {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.8em;
    color: #999;
    text-decoration: none;
    vertical-align: middle;
}

#ed-quick-order .ed-qo-clear-link:hover {
    color: #333;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Results bar: count + per-page selector
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-results-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

#ed-quick-order .ed-qo-result-count {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.4;
    color: #333;
    margin: 0;
}

#ed-quick-order .ed-qo-per-page {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

#ed-quick-order .ed-qo-per-opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    background: #fff;
    text-decoration: none;
    margin-left: 4px;
    transition: background 0.1s, border-color 0.1s;
    cursor: pointer;
}

#ed-quick-order a.ed-qo-per-opt:hover {
    background: #f0f0f0;
    border-color: #bbb;
    color: #222;
    text-decoration: none;
}

#ed-quick-order .ed-qo-per-opt--active {
    background: #222;
    border-color: #222;
    color: #fff;
    cursor: default;
}

/* --------------------------------------------------------------------------
   Product list — div/CSS Grid

   Desktop columns: image | title | sku | price | stock | qty | action
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-list {
    width: 100%;
    font-size: 14px;
}

#ed-quick-order .ed-qo-list-head,
#ed-quick-order .ed-qo-list-row {
    display: grid;
    grid-template-columns: 70px 1fr 100px 120px 90px 160px;
    align-items: center;
    gap: 0 12px;
}

#ed-quick-order .ed-qo-list-head {
    border-bottom: 2px solid #e8e8e8;
    background: #f6f6f6;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}

#ed-quick-order .ed-qo-list-row {
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 14px;
    transition: background 0.12s ease;
}

#ed-quick-order .ed-qo-list-row:hover {
    background: #fafafa;
}

#ed-quick-order .ed-qo-col-price  { font-weight: 600; font-size: 16px; }
#ed-quick-order .ed-qo-col-qty    { justify-self: end; }
#ed-quick-order .ed-qo-col-action { justify-self: end; text-align: right; }

#ed-quick-order .ed-qo-col-title a {
    font-size: 18px;
    font-weight: 500;
}

/* SKU rendered below the product title instead of its own column */
#ed-quick-order .ed-qo-title-sku {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
    line-height: 1.3;
}

/* Wishlist heart icon (FontAwesome) */
#ed-quick-order .ed-qo-heart {
    color: #b90000;
    font-size: 13px;
    margin-right: 5px;
    vertical-align: middle;
    line-height: 1;
}

/* Subtle left accent on wishlisted rows */
#ed-quick-order .ed-qo-row--wishlisted {
    border-left: 3px solid #b90000;
}

/* --------------------------------------------------------------------------
   In-cart basket indicator
   -------------------------------------------------------------------------- */

/* Stock badge + in-cart badge side by side: "198 🛒 1" */
#ed-quick-order .ed-qo-col-stock {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

#ed-quick-order .ed-qo-in-cart {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #283474;
    white-space: nowrap;
}

#ed-quick-order .ed-qo-in-cart i {
    font-size: 11px;
}

/* --------------------------------------------------------------------------
   Thumbnail
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-thumb {
    display: block;
    width: 60px !important;
    height: 60px !important;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* --------------------------------------------------------------------------
   Stock column
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-stock {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

#ed-quick-order .ed-qo-stock--in  { background: #eaf7ea; color: #2d7a2d; }
#ed-quick-order .ed-qo-stock--low { background: #fff7e6; color: #b36200; }
#ed-quick-order .ed-qo-stock--out { background: #fdf0f0; color: #a02020; }

/* --------------------------------------------------------------------------
   Quantity input
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-qty {
    width: 76px;
    height: 40px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 15px;
    background: #fff;
    color: inherit;
    box-sizing: border-box;
}

#ed-quick-order .ed-qo-qty:focus {
    outline: none;
    border-color: #999;
}

/* --------------------------------------------------------------------------
   Add to Basket button + row messages
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-add-btn {
    height: 40px !important;
    line-height: 40px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    font-size: 13px !important;
    white-space: nowrap;
    box-sizing: border-box;
}

#ed-quick-order .ed-qo-add-btn.ed-qo-btn--loading {
    opacity: 0.7;
    cursor: not-allowed;
}

#ed-quick-order .ed-qo-row-msg {
    display: block;
    font-size: 12px;
    margin-top: 5px;
    line-height: 1.4;
}

#ed-quick-order .ed-qo-msg--success { color: #46a046; }
#ed-quick-order .ed-qo-msg--error   { color: #c0392b; }

/* --------------------------------------------------------------------------
   Out of stock rows
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-row--oos .ed-qo-col-title,
#ed-quick-order .ed-qo-row--oos .ed-qo-col-sku,
#ed-quick-order .ed-qo-row--oos .ed-qo-col-price,
#ed-quick-order .ed-qo-row--oos .ed-qo-col-stock,
#ed-quick-order .ed-qo-row--oos .ed-qo-col-qty,
#ed-quick-order .ed-qo-row--oos .ed-qo-col-action {
    opacity: 0.55;
}

#ed-quick-order .ed-qo-trade-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #283474;
    text-decoration: none;
    white-space: nowrap;
}

#ed-quick-order .ed-qo-trade-link:hover {
    color: #b90000;
    text-decoration: underline;
}

#ed-quick-order .ed-qo-oos-label {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Notices
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-notice {
    padding: 16px 20px;
    background: #f8f8f8;
    border-left: 4px solid #ddd;
    border-radius: 2px;
    color: #666;
    margin: 8px 0 24px;
    font-size: 14px;
}

#ed-quick-order .ed-qo-na { color: #bbb; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-pagination {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #eee;
}

#ed-quick-order .ed-qo-pager-side { flex: 0 0 auto; }
#ed-quick-order .ed-qo-pager-center { flex: 1; text-align: center; }

#ed-quick-order .ed-qo-pager-btn {
    display: inline-flex !important;
    align-items: center;
    white-space: nowrap;
    font-size: 14px !important;
    padding: 0 24px !important;
    height: 44px !important;
    line-height: 44px !important;
}

#ed-quick-order .ed-qo-pager-btn--disabled {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 24px;
    font-size: 14px;
    opacity: 0.35;
    cursor: not-allowed;
    white-space: nowrap;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #888;
}

#ed-quick-order .ed-qo-page-label {
    font-size: 15px;
    color: #555;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Add to Basket confirmation modal
   -------------------------------------------------------------------------- */

#ed-qo-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ed-qo-modal .ed-qo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

#ed-qo-modal .ed-qo-modal-panel {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    padding: 36px 40px 32px;
    max-width: 420px;
    width: calc(100% - 40px);
    text-align: center;
    animation: ed-qo-modal-in 0.2s ease;
}

@keyframes ed-qo-modal-in {
    from { transform: translateY(-16px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

#ed-qo-modal .ed-qo-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

#ed-qo-modal .ed-qo-modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

#ed-qo-modal .ed-qo-modal-icon {
    width: 56px;
    height: 56px;
    background: #eaf7ea;
    color: #2d7a2d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

#ed-qo-modal .ed-qo-modal-icon i {
    font-size: 24px;
}

#ed-qo-modal .ed-qo-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin: 0 0 10px;
    line-height: 1.3;
}

#ed-qo-modal .ed-qo-modal-body {
    font-size: 15px;
    color: #555;
    margin: 0 0 24px;
    line-height: 1.5;
}

#ed-qo-modal .ed-qo-modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
}

#ed-qo-modal .ed-qo-modal-basket-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 0 20px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 14px !important;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
    background: #fff !important;
    color: #283474 !important;
    border: 2px solid #283474 !important;
    border-radius: 4px;
}

#ed-qo-modal .ed-qo-modal-basket-btn:hover {
    background: #f0f2fa !important;
    color: #283474 !important;
    text-decoration: none;
}

#ed-qo-modal .ed-qo-modal-continue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 20px;
    height: 44px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #247525;
    border: 2px solid #247525;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

#ed-qo-modal .ed-qo-modal-continue:hover {
    background: #1d5e1e;
    border-color: #1d5e1e;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Modal — mobile button sizing
   -------------------------------------------------------------------------- */

@media ( max-width: 480px ) {

    #ed-qo-modal .ed-qo-modal-panel {
        padding: 28px 20px 24px;
    }

    #ed-qo-modal .ed-qo-modal-actions {
        gap: 8px;
        width: 100%;
    }

    #ed-qo-modal .ed-qo-modal-basket-btn,
    #ed-qo-modal .ed-qo-modal-continue {
        flex: 1 1 0;
        justify-content: center;
        padding: 0 10px !important;
        white-space: normal;
        text-align: center;
        height: auto !important;
        min-height: 44px;
        line-height: 1.3 !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
}

/* --------------------------------------------------------------------------
   Thumbnail — zoomable cursor
   -------------------------------------------------------------------------- */

#ed-quick-order .ed-qo-thumb--zoomable {
    cursor: pointer;
}

#ed-quick-order .ed-qo-thumb--zoomable:hover {
    opacity: 0.85;
    transition: opacity 0.15s;
}

/* --------------------------------------------------------------------------
   Image lightbox modal
   -------------------------------------------------------------------------- */

#ed-qo-img-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ed-qo-img-modal .ed-qo-img-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

#ed-qo-img-modal .ed-qo-img-modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(680px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    animation: ed-qo-modal-in 0.2s ease;
}

#ed-qo-img-modal .ed-qo-img-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

#ed-qo-img-modal .ed-qo-img-modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

#ed-qo-img-modal .ed-qo-img-modal-img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: 4px;
}

#ed-qo-img-modal .ed-qo-img-modal-title {
    margin: 14px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media ( max-width: 640px ) {

    #ed-quick-order .ed-qo-filter-cols {
        flex-wrap: wrap !important;
    }

    #ed-quick-order .ed-qo-filter-col--search,
    #ed-quick-order .ed-qo-filter-col--cat,
    #ed-quick-order .ed-qo-filter-col--btn {
        flex: 1 1 100% !important;
    }

    #ed-quick-order .ed-qo-label--hidden {
        display: none;
    }

    /*
     * Mobile product row layout:
     *
     *  [ img ] [ title              ] [ SKU  ] [ stock ]
     *  [ img ] [ qty ] [ Add to Basket               ]
     *  ──────────────────────────────────────────────────
     */
    #ed-quick-order .ed-qo-list-head { display: none; }

    /*
     * Mobile layout:
     *
     *  [ img ] [ Product Title   ]
     *  [ img ] [ SKU             ]
     *  [ img ] [ Stock / Basket  ]
     *  [ qty ] [ ADD TO BASKET   ]
     */
    #ed-quick-order .ed-qo-list-row {
        display: grid !important;
        grid-template-areas:
            "img title"
            "img stock"
            "qty action";
        grid-template-columns: 72px 1fr;
        grid-template-rows: auto auto auto;
        column-gap: 12px;
        row-gap: 4px;
        padding: 14px 8px;
        align-items: start;
    }

    #ed-quick-order .ed-qo-col-image  { grid-area: img;    align-self: start; padding-top: 0; }
    #ed-quick-order .ed-qo-col-title  { grid-area: title;  align-self: end; }
    #ed-quick-order .ed-qo-col-stock  { grid-area: stock;  align-self: start; }
    #ed-quick-order .ed-qo-col-price  { display: none; }
    #ed-quick-order .ed-qo-col-qty    { grid-area: qty;    justify-self: start; align-self: center; margin-top: 10px; }
    #ed-quick-order .ed-qo-col-action { grid-area: action; justify-self: stretch; width: 100%; align-self: center; margin-top: 10px; }

    #ed-quick-order .ed-qo-col-title a {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.3;
    }

    #ed-quick-order .ed-qo-qty {
        width: 70px;
        height: 40px;
    }

    #ed-quick-order .ed-qo-add-btn {
        width: 100%;
        font-size: 12px !important;
    }

    #ed-quick-order .ed-qo-thumb {
        width: 64px !important;
        height: 64px !important;
    }

    #ed-quick-order .ed-qo-results-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    #ed-quick-order .ed-qo-pager-btn {
        padding: 0 16px !important;
        font-size: 13px !important;
    }
}
