/* ==========================================================================
   VodShop live session — design pass (Aurès pilot)
   Applies only to the live shopping page (/meeting/webrtc), desktop widths.
   Loaded last in index.html so it wins over the older layered rules.
   Goals: one slim header · warm Aurès accents · larger text · no empty blocks.
   To undo the whole pass, remove the <link> to this file in index.html.
   ========================================================================== */

:root {
    --aur-terra: #b4502b;        /* Aurès terracotta: accents, selection, key actions */
    --aur-terra-dark: #933f20;
    --aur-terra-soft: #fbeee6;
    --aur-cream: #fdf8f2;        /* warm page background */
    --aur-sand: #f2e6d9;         /* warm borders */
    --live-ink: #1f2a37;         /* main text */
    --live-muted: #5b6676;       /* secondary text */
    --live-green: #15803d;       /* "connected / live" status only */
}

@media (min-width: 992px) {

    /* ---------------------------------------------------------------- page */

    html body:has(.vodshop-meeting-shell) {
        background: var(--aur-cream) !important;
    }

    html body:has(.vodshop-meeting-shell) .vodshop-web > main > article.content {
        padding: 12px 20px 0 !important;
        max-width: 1600px !important;
    }

    /* The session used to sit in a white box with extra top padding. */
    html body:has(.vodshop-meeting-shell) .vodshop-meeting-shell {
        padding-top: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* ---------------------------------------------- 1. one slim site header */
    /* The site header used two rows (menu + language/account) and ~170px.
       During a live session it becomes one compact row. */

    html body:has(.vodshop-meeting-shell) .web-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0 !important;
        padding: 0 24px;
    }

    html body:has(.vodshop-meeting-shell) .web-header .navbar {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0 !important;
        padding: 8px 0 !important;
    }

    html body:has(.vodshop-meeting-shell) .web-header .top-row {
        flex: 0 0 auto;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    html body:has(.vodshop-meeting-shell) .web-header .nav-logo,
    html body:has(.vodshop-meeting-shell) .web-header .navbar-brand img {
        height: 44px !important;
        max-height: 44px !important;
    }

    html body:has(.vodshop-meeting-shell) .web-header .aures-brand-guest {
        transform: scale(.82);
        transform-origin: left center;
    }

    html body:has(.vodshop-meeting-shell) .web-header .nav-item a {
        height: 38px !important;
        padding: 8px 10px !important;
    }

    html body:has(.vodshop-meeting-shell) .web-nav-search input,
    html body:has(.vodshop-meeting-shell) .web-nav-search button {
        height: 40px !important;
    }

    /* -------------------------------- 2. session bar: slim, warm, Aurès-like */
    /* Replaces the second big blue band ("SERVER / AGENT", "CLIENT / CUSTOMER"). */

    html body:has(.vodshop-meeting-shell) .vodshop-meeting-shell .vodshop-app-header {
        min-height: 0 !important;
        height: auto !important;
        margin: 0 0 12px !important;
        padding: 10px 18px !important;
        color: var(--live-ink) !important;
        background: #fff !important;
        border: 1px solid var(--aur-sand) !important;
        border-left: 5px solid var(--aur-terra) !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 14px rgba(120, 72, 40, .06) !important;
    }

    html body:has(.vodshop-meeting-shell) .vodshop-app-header .vodshop-brand-lockup,
    html body:has(.vodshop-meeting-shell) .vodshop-app-header .vodshop-brand-lockup strong {
        color: var(--aur-terra) !important;
        font-size: 18px !important;
    }

    html body:has(.vodshop-meeting-shell) .vodshop-app-header .vodshop-brand-lockup .material-icons {
        color: var(--aur-terra) !important;
    }

    html body:has(.vodshop-meeting-shell) .vodshop-app-header .vodshop-session-title strong {
        color: var(--live-ink) !important;
        font-size: 15px !important;
        letter-spacing: .06em;
    }

    html body:has(.vodshop-meeting-shell) .vodshop-app-header .vodshop-session-title span {
        color: var(--live-muted) !important;
        font-size: 13px !important;
    }

    html body:has(.vodshop-meeting-shell) .vodshop-app-header .vodshop-header-presence {
        padding: 5px 12px;
        border-radius: 999px;
        color: var(--live-green) !important;
        background: #ecfdf3;
        font-size: 13px !important;
        font-weight: 700;
    }

    /* ------------------------------------------------------- 3. panels */
    /* Warm, consistent cards everywhere in the session. */

    html body:has(.vodshop-meeting-shell) .top-remote-video-show-wrap {
        background: transparent !important;
    }

    html body:has(.vodshop-meeting-shell) #meetingContainer,
    html body:has(.vodshop-meeting-shell) .vodshop-customer-queue,
    html body:has(.vodshop-meeting-shell) .people-chat-wrap,
    html body:has(.vodshop-meeting-shell) .vodshop-selected-cart,
    html body:has(.vodshop-meeting-shell) .vodshop-product-workspace.vsw {
        border-color: var(--aur-sand) !important;
    }

    /* ------------------------------------------ 4. cart: bigger, easier text */

    html body:has(.vodshop-meeting-shell) #cart .product {
        gap: 12px !important;
        padding: 12px !important;
        border: 1px solid var(--aur-sand) !important;
        border-radius: 12px !important;
        background: #fff !important;
    }

    html body:has(.vodshop-meeting-shell) #cart .product img {
        width: 64px !important;
        height: 64px !important;
        border-radius: 10px !important;
        object-fit: cover;
        background: var(--aur-cream);
    }

    html body:has(.vodshop-meeting-shell) #cart .product h6 {
        margin: 0 0 4px !important;
        color: var(--live-ink) !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
    }

    html body:has(.vodshop-meeting-shell) #cart .product .details p {
        margin: 0 !important;
        color: var(--live-muted) !important;
        font-size: 14px !important;
        line-height: 1.45 !important;
    }

    html body:has(.vodshop-meeting-shell) #cart .product .details p:last-child {
        margin-top: 2px !important;
        color: var(--aur-terra) !important;
        font-size: 15px !important;
        font-weight: 800 !important;
    }

    /* Totals: right under the items (not pushed to the bottom), larger. */

    html body:has(.vodshop-meeting-shell) .vodshop-selected-cart {
        justify-content: flex-start !important;
    }

    html body:has(.vodshop-meeting-shell) #cart {
        flex: 0 0 auto !important;
        max-height: none !important;
    }

    html body:has(.vodshop-meeting-shell) #cart-summary {
        margin-top: 12px !important;
        padding: 14px 16px !important;
        border: 1px solid var(--aur-sand) !important;
        border-radius: 12px !important;
        background: var(--aur-cream) !important;
    }

    html body:has(.vodshop-meeting-shell) #cart-summary .cart-totals {
        color: var(--live-muted) !important;
        font-size: 14px !important;
        line-height: 1.7 !important;
    }

    html body:has(.vodshop-meeting-shell) #cart-summary .cart-totals:last-child {
        grid-column: 1 / -1;
        margin-top: 6px !important;
        padding-top: 8px !important;
        border-top: 1px solid var(--aur-sand) !important;
        color: var(--live-ink) !important;
        font-size: 22px !important;
        font-weight: 800 !important;
    }

    /* ------------------------------------------------ 5. agent screen only */

    /* Wider customer list and cart columns (were 220px / 330px). */
    html body:has(#meetingContainer.serverVodShopLayout) .vodshop-agent-shell .top-remote-video-show-wrap {
        grid-template-columns: 250px minmax(520px, 1fr) 350px !important;
    }

    /* Customer list: readable names, warm selection instead of green. */
    html body:has(.vodshop-agent-shell) .vodshop-customer-queue .in-call-wrap {
        min-height: 60px !important;
        border-radius: 12px !important;
    }

    html body:has(.vodshop-agent-shell) .vodshop-customer-queue .participant-name {
        max-width: 150px !important;
        color: var(--live-ink) !important;
        font-size: 14px !important;
    }

    html body:has(.vodshop-agent-shell) .vodshop-customer-queue .queue-status {
        font-size: 12.5px !important;
    }

    html body:has(.vodshop-agent-shell) .vodshop-customer-queue .in-call-wrap.selected,
    html body:has(.vodshop-agent-shell) .vodshop-customer-queue .in-call-wrap.active {
        border-color: var(--aur-terra) !important;
        background: var(--aur-terra-soft) !important;
        box-shadow: inset 4px 0 0 var(--aur-terra) !important;
    }

    /* Active customer bar: name larger. */
    html body:has(.vodshop-agent-shell) .vodshop-active-customer #activeCustomerName {
        font-size: 18px !important;
    }

    html body:has(.vodshop-agent-shell) .vodshop-active-customer {
        background: var(--aur-cream) !important;
        border-color: var(--aur-sand) !important;
    }

    /* Selected customer's video: terracotta frame instead of green. */
    html body:has(.vodshop-agent-shell) #divUsers .vodshop-customer-card.selected-video-holder {
        outline: 3px solid var(--aur-terra) !important;
        outline-offset: -3px !important;
        border-color: var(--aur-terra) !important;
    }

    /* Panel headings */
    html body:has(.vodshop-agent-shell) .people-heading,
    html body:has(.vodshop-agent-shell) .vodshop-selected-cart::before {
        color: var(--live-ink) !important;
        font-size: 15px !important;
    }

    /* "Send PayPal Checkout": strong, full width, right under the total. */
    html body:has(.vodshop-agent-shell) #serverProceedToCheckout.vodshop-paypal-request {
        margin-top: 12px !important;
        min-height: 52px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
    }

    /* "Add products" card: warm heading icon, terracotta focus. */
    html body:has(.vodshop-agent-shell) .vsw .vsw-head-icon {
        background: var(--aur-terra-soft) !important;
        color: var(--aur-terra) !important;
    }

    html body:has(.vodshop-agent-shell) .vsw .form-control:focus {
        border-color: var(--aur-terra) !important;
        box-shadow: 0 0 0 4px rgba(180, 80, 43, .14) !important;
    }

    html body:has(.vodshop-agent-shell) .vsw .vsw-review {
        background: var(--aur-cream) !important;
        border-color: var(--aur-sand) !important;
    }

    /* ---------------------------------------------- 6. customer screen only */

    /* The bar next to "Your VodShop agent" was an empty grey block (it only
       holds the receipt link, which the script shows after payment). */
    html body:has(.vodshop-customer-shell) .g-top-left {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    /* "Connected" is already shown in the session bar: no second pill. */
    html body:has(.vodshop-customer-shell) .vodshop-client-heading .vodshop-live-status {
        display: none !important;
    }

    /* The participant-count box above "Your Cart" was empty for customers. */
    html body:has(.vodshop-customer-shell) .people-chat-wrap {
        display: none !important;
    }

    html body:has(.vodshop-customer-shell) .vodshop-client-heading h1 {
        font-size: 24px !important;
        color: var(--live-ink) !important;
    }

    html body:has(.vodshop-customer-shell) .vodshop-client-heading .vodshop-eyebrow {
        color: var(--aur-terra) !important;
        font-size: 12px !important;
    }

    html body:has(.vodshop-customer-shell) .vodshop-client-stage {
        border-radius: 16px !important;
    }

    /* Cart title */
    html body:has(.vodshop-customer-shell) .vodshop-selected-cart::before,
    html body:has(.vodshop-customer-shell) .cart-wrapper > h5,
    html body:has(.vodshop-customer-shell) .cart-wrapper > .cart-title {
        color: var(--live-ink) !important;
        font-size: 18px !important;
    }
}

/* --------------------------------------------------------------------------
   "Send PayPal Checkout" feedback (agent).
   The checkout opens on the customer's screen, so the agent's button shows
   what happened: pressed effect, spinner while sending, then a status.
   States are set by the page script (data-checkout-state).
   -------------------------------------------------------------------------- */

html body:has(.vodshop-agent-shell) #serverProceedToCheckout.vodshop-paypal-request {
    gap: 8px;
    cursor: pointer;
    transition: transform .08s ease, filter .15s ease, background-color .2s ease, box-shadow .2s ease;
}

html body:has(.vodshop-agent-shell) #serverProceedToCheckout.vodshop-paypal-request:hover:not(:disabled) {
    filter: brightness(1.04);
    box-shadow: 0 8px 20px rgba(217, 119, 6, .28) !important;
}

html body:has(.vodshop-agent-shell) #serverProceedToCheckout.vodshop-paypal-request:active:not(:disabled) {
    transform: scale(.97);
}

html body:has(.vodshop-agent-shell) #serverProceedToCheckout.vodshop-paypal-request:focus-visible {
    outline: 3px solid rgba(180, 80, 43, .35);
    outline-offset: 2px;
}

/* Sending / waiting / paying: clearly "in progress", not broken. */
html body:has(.vodshop-agent-shell) #serverProceedToCheckout.vodshop-paypal-request.is-busy,
html body:has(.vodshop-agent-shell) #serverProceedToCheckout.vodshop-paypal-request:disabled {
    cursor: default;
    opacity: 1 !important;
}

html body:has(.vodshop-agent-shell) #serverProceedToCheckout[data-checkout-state="sending"],
html body:has(.vodshop-agent-shell) #serverProceedToCheckout[data-checkout-state="sent"] {
    background-image: none !important;
    color: #7a4a12 !important;
    background: #fdf1d8 !important;
    border: 1px solid #f3cf8a !important;
    box-shadow: none !important;
}

html body:has(.vodshop-agent-shell) #serverProceedToCheckout[data-checkout-state="opened"] {
    background-image: none !important;
    color: #fff !important;
    background: var(--aur-terra, #b4502b) !important;
    border: 1px solid var(--aur-terra-dark, #933f20) !important;
    box-shadow: none !important;
}

html body:has(.vodshop-agent-shell) #serverProceedToCheckout[data-checkout-state="opened"] .material-icons {
    background-image: none !important;
    animation: checkout-pulse 1.4s ease-in-out infinite;
}

html body:has(.vodshop-agent-shell) #serverProceedToCheckout[data-checkout-state="failed"] {
    background-image: none !important;
    color: #8a1c13 !important;
    background: #fdecea !important;
    border: 1px solid #f5b5ad !important;
}

.checkout-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(122, 74, 18, .25);
    border-top-color: #7a4a12;
    border-radius: 50%;
    animation: checkout-spin .8s linear infinite;
}

/* Clicked with no products: short shake instead of doing nothing. */
html body:has(.vodshop-agent-shell) #serverProceedToCheckout.checkout-shake {
    animation: checkout-shake .35s ease;
}

@keyframes checkout-spin { to { transform: rotate(360deg); } }

@keyframes checkout-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}

@keyframes checkout-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Title of the agent's "selected customer's cart" panel (set in webrtc.css with
   English text) in the user's language. */
html[lang="fr"] body:has(#meetingContainer.serverVodShopLayout) .vodshop-selected-cart::before {
    content: "Panier du client sélectionné";
}

html[lang="ar"] body:has(#meetingContainer.serverVodShopLayout) .vodshop-selected-cart::before {
    content: "سلة العميل المحدد";
    left: auto;
    right: 12px;
}

/* Agent screen below 1097px (small tablets): the participants / receipt bar is
   positioned absolutely and covered the "Clients" heading. Put it back in the page
   flow, above the live panel. (From 1097px up it is hidden by webrtc.css.) */
@media (max-width: 1096.98px) {
    html body:has(#meetingContainer.serverVodShopLayout) .g-top-left {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        order: -1 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 10px !important;
    }
}

/* Phones: the call toolbar did not fit (the "Meeting details" label wrapped on three
   lines and "Present" was cut off). Keep only the icons of the two side groups. */
@media (max-width: 575.98px) {
    .vodshop-call-toolbar {
        gap: 6px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        justify-content: space-between !important;
    }

    .vodshop-call-toolbar .bottom-left,
    .vodshop-call-toolbar .bottom-right {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 0 !important;
    }

    .vodshop-call-toolbar .bottom-right * {
        font-size: 0 !important;
    }

    .vodshop-call-toolbar .bottom-left .material-icons,
    .vodshop-call-toolbar .bottom-right .material-icons {
        font-size: 24px !important;
    }

    .vodshop-call-toolbar .bottom-middle {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        gap: 6px !important;
    }
}

/* Agent screen 992-1096px (small laptops): the "Ready for your next customer" card is
   absolutely positioned and covered the agent's own video tile. Keep it in the flow. */
@media (min-width: 992px) and (max-width: 1096.98px) {
    html body:has(#meetingContainer.serverVodShopLayout) .web-call-empty {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        width: auto !important;
        margin: 12px 0 0 !important;
    }
}

/* Customer live screen below 1097px (phones, tablets):
   - the agent's video comes first (the cart came first, so customers had to scroll to see the agent);
   - the empty grey bar above the panel collapses (it only holds content after payment);
   - the empty people/chat header box is hidden (webrtc.css forced it visible). */
@media (max-width: 1096.98px) {
    html body:has(#meetingContainer.nonVodShopLayout) .top-remote-video-show-wrap > #meetingContainer {
        order: -1 !important;
    }

    html body:has(.vodshop-customer-shell) .g-top-left {
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    html body:has(#meetingContainer.nonVodShopLayout) .g-right-details-wrap > .people-chat-wrap {
        display: none !important;
    }
}

/* Agent participant list: the cart / checkout icon stuck out past the card's right
   edge because the long customer name could not shrink. Let the name shrink with
   an ellipsis and keep the icon inside the card. */
.numbered-participant {
    gap: 8px !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
}

.numbered-participant .participant-img-name-wrap {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.numbered-participant .participant-img-name-wrap > :last-child {
    min-width: 0 !important;
    overflow: hidden !important;
}

.numbered-participant .participant-img-name-wrap * {
    text-overflow: ellipsis;
}

.numbered-participant .participant-action-wrap {
    flex: 0 0 auto !important;
    margin: 0 !important;
}

.numbered-participant .participant-action-pin {
    margin-right: 0 !important;
}
