/*

Template : Roladel

Author Name : Roladel
Author Email : support@roladel.com

Theme Url : https://roladel.com

Theme Version : 1.0

*/


/** Write Here Your Modifications Styles **/


// Add first-featured-image class to the featured image of the latest post
function skip_lazy_class_first_featured_image($attr) {
    global $wp_query;
    
    // Check if it's the first post in the loop
    if ( 0 == $wp_query->current_post ) {
        // Ensure the 'class' attribute exists before appending
        if (isset($attr['class'])) {
            $attr['class'] .= ' first-featured-image';  
        } else {
            $attr['class'] = 'first-featured-image'; 
        }
    }
    
    return $attr;
}
add_filter('wp_get_attachment_image_attributes', 'skip_lazy_class_first_featured_image');
a {
    text-decoration: none !important;
}


/* ===============================
   STICKY FOOTER FIX
================================= */

.sticky-footer {
    position: fixed;
    bottom: 0; /* Default desktop */
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px;
    z-index: 1000;
    overflow-x: auto;
}

/* Footer button layout - a single full-width "Order Now" button (the
   cart button that used to sit beside it was removed from the markup in
   proposals/proposal.php, not just hidden here). */
.footer-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
}

.footer-buttons a,
.footer-buttons button {
    flex: 1 1 auto;
    width: 100%;
    white-space: nowrap;
    max-width: 100%;
}

.money-back {
    font-size: 10px;
    color: #555;
    text-align: center;
    margin-top: 5px;
}

/* ===============================
   MOBILE FIX (IMPORTANT)
================================= */

@media (max-width: 768px) {

    /* Move sticky footer above bottom nav */
    .sticky-footer {
        bottom: 65px; /* Same height as mobile-bottom-nav */
    }

    /* Prevent content hiding behind both */
    body {
        padding-bottom: 60px; 
        /* 65px nav + ~85px sticky footer */
    }

}




/* =========================
   PROFILE SECTION
========================= */
.insert-message {
    text-align: center;
}

.seller-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
}

.insert-message h4 {
    color: var(--brand-green);
    font-weight: 600;
}

.p-style {
    color: #555;
    font-size: 14px;
}

/* =========================
   CHAT CONTAINER
========================= */
#display-messages {
    background: #f7f7f7;
    padding: 15px;
    height: 400px;
    overflow-y: auto;
    border-radius: 15px;
    padding-bottom: 70px; /* space for input */
}

/* =========================
   CHAT HEADER
========================= */
.chat-status {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}

/* =========================
   MESSAGE BUBBLES
========================= */
.message-div {
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    max-width: 75%;
    font-size: 14px;
}

.message-div-hover {
    background: #e6f7ec;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    margin-left: auto;
    max-width: 75%;
    font-size: 14px;
}

/* =========================
   INPUT BOX (DESKTOP)
========================= */
.insert-message-box {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box; /* ✅ VERY IMPORTANT */
    background: #fff;
    padding: 4px;
    border-top: 1px solid #ddd;
    z-index: 1000;
    padding-bottom: 60px;
    padding-left: 10px;   /* move content right */
    padding-right: 20px;  /* move content left */
}

/* =========================
   CHAT FORM
========================= */
.chat-form {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 6px;
}

/* TEXTAREA */
.chat-form textarea {
    flex: 1;
    min-width: 0;
    border-radius: 20px;
    border: 1px solid #ddd;
    padding: 8px 12px;
    resize: none;
    min-height: 38px;
    max-height: 120px;
    overflow-y: auto;
    font-size: 15px;
    background: #f1f1f1;
}

/* =========================
   BUTTONS
========================= */
.chat-btn {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* SEND BUTTON */
.chat-btn.send-btn {
    background: var(--brand-green);
    color: #fff;
}

/* ATTACH BUTTON */
.chat-btn.offer-btn {
    background: #ddd;
    color: #333;
}





.msg-status{
    font-size:11px;
    margin-left:6px;
    display:inline-block;
}






.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper textarea {
    width: 100%;
    padding-left: 45px; /* space for icon */
    height: 45px;
    resize: none;
    border-radius: 25px;
    border: 1px solid #ccc;
    padding-top: 10px;
}

.file-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #555;
    cursor: pointer;
}

.file-icon:hover {
    color: var(--brand-green);
}




.voice-icon {
    background: none;
    border: none;
    font-size: 20px;
    color: #555;
    margin-left: 10px;
    cursor: pointer;
    
    
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);

}

.voice-icon.recording {
    color: red;
}







.go-back-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-green);
    font-size: 1.5rem;
    text-decoration: none;
}

.go-back-icon:hover {
    color: #043d06;
}



#scrollToBottomBtn{
    position: fixed;
    bottom: 200px;
    right: 20px;   /* 👈 changed from right to left */
    left: auto;  /* 👈 important to remove right conflict */

    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--brand-green);
    color: #fff;
    font-size: 18px;
    display: none;
    z-index: 99999;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

/* mobile tweak */
@media (max-width: 768px){
    #scrollToBottomBtn{
        bottom: 160px;
        right: 15px;   /* 👈 also move left on mobile */
        left: auto;
    }
}


.chat-status {
  background: #f0f2f5;
  padding: 10px 15px;
  border-bottom: 1px solid #ddd;
}

html.dark .chat-status {
  background: #1e1e1e;
  border-bottom: 1px solid #333;
}

/* FLEX LAYOUT */
.chat-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* AVATAR */
.chat-avatar {
  position: relative;
}

.chat-avatar .seller-image {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
}

/* badge positioning */
.chat-avatar .seller-level-image {
  width: 16px;
  height: 16px;
  position: absolute;
  bottom: 0;
  right: 0;
}

/* TEXT AREA */
.chat-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chat-name {
  font-weight: 600;
  font-size: 15px;
  color: #111;
}

html.dark .chat-name {
  color: #fff;
}

/* STATUS LINE */
.chat-meta {
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-meta .online {
  color: #000000;
  font-weight: 700;
}

html.dark .chat-meta .online {
  color: #ffffff;
}

html.dark .chat-meta {
  color: #aaa;
}





/* =====================================
   SCOPE EVERYTHING TO THIS PAGE
===================================== */
.order-details-page {
    background: #f5f7fa;
}

/* STATUS BAR */
.order-details-page #order-status-bar {
    background: #fff;
    padding: 12px 20px;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* CARDS */
.order-details-page .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* SUBSCRIPTION CARD - shown only for orders.subscription_id IS NOT NULL.
   Deliberately kept to the site's existing black/white/accent palette and
   the same left-accent-border pattern already used by the pinned-message
   card (order_conversations.php's .oc-pinned-message) - no new colors,
   badges, or decoration introduced. */
.order-details-page .odp-subscription-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-left: 4px solid var(--brand-green);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 16px 18px;
    margin-bottom: 20px;
}

html.dark .order-details-page .odp-subscription-card {
    background: var(--dark-surface);
    border-color: var(--dark-border);
    border-left-color: var(--brand-green-bright);
}

.order-details-page .odp-subscription-card__label {
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-green);
    margin-bottom: 6px;
}

html.dark .order-details-page .odp-subscription-card__label {
    color: var(--brand-green-bright);
}

.order-details-page .odp-subscription-card__interval {
    font-size: 1.05rem;
    font-weight: 600;
    color: #171717;
    margin-bottom: 10px;
}

html.dark .order-details-page .odp-subscription-card__interval {
    color: var(--dark-text);
}

.order-details-page .odp-subscription-card__dot {
    color: var(--light-text-muted);
    margin: 0 2px;
}

.order-details-page .odp-subscription-card__rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.order-details-page .odp-subscription-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--light-text-muted);
}

.order-details-page .odp-subscription-card__cycle {
    font-weight: 600;
    color: #171717;
}

html.dark .order-details-page .odp-subscription-card__cycle {
    color: var(--dark-text);
}

.order-details-page .odp-subscription-card__key {
    color: var(--light-text-muted);
}

.order-details-page .odp-subscription-card__value {
    font-weight: 600;
    color: #171717;
}

html.dark .order-details-page .odp-subscription-card__value {
    color: var(--dark-text);
}

.order-details-page .odp-subscription-status {
    font-weight: 600;
}

.order-details-page .odp-subscription-status--active {
    color: var(--brand-green);
}

html.dark .order-details-page .odp-subscription-status--active {
    color: var(--brand-green-bright);
}

.order-details-page .odp-subscription-status--paused,
.order-details-page .odp-subscription-status--past_due,
.order-details-page .odp-subscription-status--cancelled {
    color: var(--light-text-muted);
}

.order-details-page .odp-subscription-cancel-note {
    font-size: 0.85rem;
    margin-top: -8px;
    margin-bottom: 16px;
}

@media (max-width: 576px) {
    .order-details-page .odp-subscription-card {
        padding: 14px 14px;
    }
}

/* CHAT-FIRST MAIN AREA - the conversation is the primary content of the
   page now, not a small box at the bottom of a long order page. Centered,
   professional width on desktop rather than stretching edge to edge. */
.order-details-page .odp-chat-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 15px 16px;
}

/* CHAT PANEL - #order-conversations (message list) and the composer are
   siblings inside this one bordered card, so the composer is genuinely
   attached to the bottom of the conversation instead of being pinned to
   the browser viewport. The panel carries a viewport-relative height (most
   of the space below the sticky header/status bar) instead of a small
   fixed box; the message list fills whatever space is left via flex:1, and
   the composer is a flex-shrink:0 item pinned to the bottom of THIS panel
   (not the browser viewport) - so it never scrolls away and never grows/
   shrinks the overall panel height even if the textarea expands for a
   multiline message. */
.order-details-page .odp-chat-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* min-height/max-height are desktop-only on purpose: on mobile they would
   override the JS-computed inline height (odpSizeChatPanel() in
   order_details.php) with a floor/ceiling that isn't width-scoped, and a
   420px min-height is exactly tall enough to push the composer below the
   fold on a short viewport when page chrome above it (e.g. the "verify
   your email" banner) is present - see the JS function's own comments. */
@media (min-width: 769px) {
    .order-details-page .odp-chat-panel {
        min-height: 420px;
        max-height: 820px;
    }
}

/* CHAT AREA - the only scrollable part of the panel */
.order-details-page .odp-chat-panel #order-conversations {
    flex: 1 1 auto;
    min-height: 0; /* required for a flex child to actually shrink and scroll instead of stretching to fit its content */
    background: #f7f7f7;
    padding: 15px;
    padding-bottom: 24px; /* extra breathing room so the last message never sits flush against the composer's top border */
    border-radius: 0;
    overflow-y: auto;
}

/* MESSAGE (LEFT) */
.order-details-page .message-div {
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    max-width: 75%;
}

/* MESSAGE (RIGHT) */
.order-details-page .message-div-hover {
    background: #e6f7ec;
    margin-left: auto;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    max-width: 75%;
}

/* COMPOSER - normal document flow, not position:fixed, so it can never
   float over unrelated page content and never covers the latest message.
   flex-shrink:0 keeps it at its natural height and pinned to the bottom of
   the .odp-chat-panel flex column even as #order-conversations above it
   grows/shrinks or scrolls. */
.order-details-page .odp-composer {
    flex: 0 0 auto;
    flex-shrink: 0;
    background: #fff;
    border-top: 1px solid #e2e2e2;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
    padding: 10px 14px;
}

.order-details-page .odp-composer .chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-details-page .odp-composer .input-wrapper {
    flex: 1;
    min-width: 0;
}

.order-details-page .odp-composer .input-wrapper textarea {
    box-sizing: border-box;
    width: 100%;
    height: 52px;
    min-height: 52px;
    max-height: 120px;
    line-height: 1.4;
    padding: 15px 45px;
    border-radius: 24px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    resize: none;
    font-size: 14px;
}

.order-details-page .odp-composer .chat-btn {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
}

.order-details-page .odp-composer .chat-btn.send-btn {
    background: var(--brand-green);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

/* MOBILE */
@media (max-width: 768px) {

    .order-details-page .odp-chat-main {
        max-width: 100%;
        padding: 8px 8px 10px;
    }

    .order-details-page .odp-chat-panel {
        height: calc(100vh - 130px - var(--mobile-bottom-nav-height, 65px));
        max-height: none;
        border-radius: 10px;
    }

    .order-details-page .odp-chat-panel #order-conversations {
        padding-bottom: 18px;
    }

    .order-details-page .odp-composer {
        padding: 8px 10px;
    }

    .order-details-page .odp-composer .input-wrapper textarea {
        box-sizing: border-box;
        height: 46px;
        min-height: 46px;
        padding: 12px 40px;
    }

    .order-details-page .odp-composer .chat-btn {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
    }

}



@media (max-width: 768px) {
    
    
    
    .insert-message-box {
    bottom: 0 !important;
    padding: 8px 8px !important;
    border-radius: 50px !important;
    margin: 8px !important;
    width: calc(100% - 16px) !important;
   }
    

    #order-conversations {
        padding-bottom: 120px;
    }

}

/* ORDER DETAILS BUTTON - compact trigger sitting in the sticky black status bar */
.order-details-page .odp-details-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    line-height: 1.3;
    cursor: pointer;
}

.order-details-page .odp-details-btn:hover,
.order-details-page .odp-details-btn:focus {
    background: rgba(255,255,255,0.14);
    color: #fff;
    outline: none;
}

/* ORDER DETAILS MODAL - desktop: centered modal. mobile: bottom sheet
   (same single modal, styled differently per viewport - one conceptual
   interaction, not two implementations). */
.order-details-page .odp-details-dialog {
    max-width: 560px;
}

.order-details-page .odp-details-content {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
}

.order-details-page .odp-details-header {
    background: #000;
    color: #fff;
    border-bottom: none;
    padding: 14px 18px;
    align-items: center;
}

.order-details-page .odp-details-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    margin: 0;
}

.order-details-page .odp-details-close {
    color: #fff;
    opacity: 0.85;
    text-shadow: none;
    font-size: 1.4rem;
    padding: 0;
    margin: 0;
}

.order-details-page .odp-details-close:hover {
    opacity: 1;
    color: #fff;
}

.order-details-page .odp-details-body {
    max-height: 75vh;
    overflow-y: auto;
    padding: 16px;
    background: #f5f7fa;
}

.order-details-page .odp-details-section {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.order-details-page .odp-details-section:last-child {
    margin-bottom: 0;
}

.order-details-page .odp-details-section-title {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-green);
    margin-bottom: 10px;
}

/* the subscription card already carries its own border/shadow - avoid
   double-boxing it inside a details section */
.order-details-page .odp-details-section .odp-subscription-card {
    box-shadow: none;
    margin-bottom: 0;
}

/* MOBILE: bottom sheet - same modal markup, transformed to slide up from
   the bottom with rounded top corners and its own internal scroll. */
@media (max-width: 768px) {

    .order-details-page #order-details-modal .modal-dialog {
        max-width: 100%;
        margin: 0;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        transition: transform 0.25s ease-out;
        transform: translateY(100%);
    }

    .order-details-page #order-details-modal.show .modal-dialog {
        transform: translateY(0);
    }

    .order-details-page .odp-details-content {
        border-radius: 16px 16px 0 0;
    }

    .order-details-page .odp-details-body {
        max-height: 78vh;
        padding: 14px;
    }

}





    #display-messages {
        height: calc(100vh - 145px) !important;
        padding-bottom: 110px !important;
    }

/* "Near me" distance badge - proposal cards in search.php/category.php,
   only rendered when a nearby search is active (functions.php). */
.rld-distance-badge {
    color: var(--brand-green);
    font-size: 13px;
    font-weight: 600;
    margin: -8px 0 8px;
}

html.dark .rld-distance-badge {
    color: var(--brand-green-bright);
}

/* Subscription/recurring order indicator - manage_orders/*.php order-list
   tables (buying_orders.php / selling_orders.php). Shown only when the
   order's own subscription_id is set; a normal one-time order never gets
   this element at all. Deliberately quiet/secondary, matching the same
   tokens as order_details.php's subscription card and the
   .rld-distance-badge pattern above - no badge shape, no new colors. */
.order-subscription-line {
    color: var(--brand-green);
    font-size: 12px;
    font-weight: 600;
    margin: 2px 0 0;
    white-space: normal;
}

html.dark .order-subscription-line {
    color: var(--brand-green-bright);
}



