
/* ==========================================
   BYDSHOP ONLINE CONSULTANT — DESIGN 0.3
   Responsive layout / Mobile / Desktop
   ========================================== */

#bydshop-oc-widget {
    position: fixed;
    right: -10px;
    bottom: 64px;
    z-index: 99999;
    font-family: inherit;
    color: #172536;
}

#bydshop-oc-widget *,
#bydshop-oc-widget *::before,
#bydshop-oc-widget *::after {
    box-sizing: border-box;
}

#bydshop-oc-widget [hidden] {
    display: none !important;
}

/* ===== BUTTON / MASCOT ===== */

.bydshop-oc-launcher {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 85px !important;
    height: 85px !important;
    min-width: 85px !important;
    min-height: 85px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50%;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: transform .2s ease;
}

.bydshop-oc-launcher img {
    display: block !important;
    width: 85px !important;
    height: 85px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
    filter: drop-shadow(0 5px 12px rgba(0,0,0,.25));
}

.bydshop-oc-launcher:hover {
    transform: translateY(-4px);
}

.bydshop-oc-launcher:focus-visible {
    outline: 3px solid #ed1c2e;
    outline-offset: 4px;
}

/* ===== CHAT WINDOW ===== */

.bydshop-oc-panel {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 110px));
    min-height: 350px;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    background: #f4f7fb;
    border: 1px solid #dce3eb;
    border-radius: 20px;

    box-shadow:
        0 16px 50px rgba(10, 32, 55, .22),
        0 3px 10px rgba(10, 32, 55, .08);
}

/* ===== HEADER ===== */

.bydshop-oc-header {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 19px 20px;
    background: linear-gradient(135deg, #173d66, #204f7c);
    color: #fff;
}

.bydshop-oc-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: #ed1c2e;
}

.bydshop-oc-header strong {
    display: block;
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -.3px;
}

.bydshop-oc-header span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
    opacity: .85;
}

.bydshop-oc-close {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: #fff;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}

.bydshop-oc-close:hover {
    background: #ed1c2e;
}

/* ===== MESSAGES ===== */

.bydshop-oc-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;

    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 18px 16px;
    background: #f4f7fb;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c5d0dd transparent;
}

.bydshop-oc-message {
    display: block;
    width: fit-content;
    max-width: 88%;
    min-width: 0;

    padding: 12px 15px;
    border-radius: 15px;

    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
}

.bydshop-oc-message--assistant {
    align-self: flex-start;
    background: #fff;
    color: #202c3a;
    border: 1px solid #e0e6ed;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 6px rgba(20,40,60,.04);
}

.bydshop-oc-message--visitor {
    align-self: flex-end;
    background: #e3effb;
    color: #173d66;
    border: 1px solid #cbdff3;
    border-bottom-right-radius: 5px;
}

/* ===== CONTACT FORM ===== */

.bydshop-oc-contact {
    flex: 0 0 auto;
    padding: 15px 16px;
    background: #fff;
    border-top: 1px solid #e3e8ef;
}

.bydshop-oc-contact p {
    margin: 0 0 12px;
    color: #45566a;
    font-size: 13px;
    line-height: 1.5;
}

.bydshop-oc-contact label {
    display: block;
    margin: 10px 0;
    color: #34465a;
    font-size: 12px;
    font-weight: 600;
}

.bydshop-oc-contact input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 5px;
    padding: 11px 12px;

    border: 1px solid #d0dae5;
    border-radius: 10px;
    background: #f9fbfd;
    font: inherit;
    font-size: 14px;
}

.bydshop-oc-contact input:focus,
.bydshop-oc-compose textarea:focus {
    outline: none;
    border-color: #2877b9;
    box-shadow: 0 0 0 3px rgba(40,119,185,.12);
}

.bydshop-oc-contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ===== BUTTONS ===== */

.bydshop-oc-contact-actions button,
.bydshop-oc-compose button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    background: #173d66;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: background .2s ease;
}

.bydshop-oc-contact-actions button:hover,
.bydshop-oc-compose button:hover {
    background: #ed1c2e;
}

.bydshop-oc-contact-actions button[type="button"] {
    background: #eef2f6;
    color: #34465a;
}

.bydshop-oc-contact-actions button[type="button"]:hover {
    background: #e0e7ef;
}

/* ===== MESSAGE INPUT ===== */

.bydshop-oc-compose {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 9px;

    width: 100%;
    min-width: 0;
    padding: 12px;

    background: #fff;
    border-top: 1px solid #e3e8ef;
}

.bydshop-oc-compose textarea {
    display: block;
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    max-height: 110px;
    resize: vertical;

    padding: 12px 13px;
    border: 1px solid #cbd5e0;
    border-radius: 12px;

    background: #fff;
    color: #202c3a;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.bydshop-oc-compose button {
    min-height: 44px;
    white-space: nowrap;
}

/* ===== STATUS / ERRORS ===== */

.bydshop-oc-error {
    flex: 0 0 auto;
    padding: 0 14px 10px;
    background: #fff;
    color: #a12622;
    font-size: 12px;
    line-height: 1.5;
}

/* ===== MOBILE ===== */

@media screen and (max-width: 600px) {

    #bydshop-oc-widget {
        right: 0px;
        bottom: 52px;
    }

    .bydshop-oc-launcher {
        width: 72px !important;
        height: 72px !important;
        min-width: 72px !important;
        min-height: 72px !important;
    }

    .bydshop-oc-launcher img {
        width: 72px !important;
        height: 72px !important;
    }

    .bydshop-oc-panel {
        position: fixed;

        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));

        width: auto;
        max-width: none;
        min-width: 0;

        height: min(620px, calc(100dvh - 24px - env(safe-area-inset-bottom)));
        max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
        min-height: 350px;

        border-radius: 18px;
    }

    .bydshop-oc-header {
        padding: 16px;
    }

    .bydshop-oc-messages {
        padding: 14px 12px;
    }

    .bydshop-oc-compose {
        gap: 8px;
        padding: 10px;
    }

    .bydshop-oc-compose textarea {
        font-size: 16px;
        min-height: 46px;
        padding: 11px;
    }

    .bydshop-oc-compose button {
        padding: 11px 13px;
        font-size: 13px;
    }

    .bydshop-oc-contact {
        padding: 12px;
    }
}

/* ===== VERY SMALL SCREENS ===== */

@media screen and (max-width: 360px) {

    .bydshop-oc-panel {
        left: 8px;
        right: 8px;
    }

    .bydshop-oc-compose {
        gap: 6px;
        padding: 8px;
    }

    .bydshop-oc-compose button {
        padding: 10px 9px;
        font-size: 12px;
    }

    .bydshop-oc-header strong {
        font-size: 19px;
    }
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
    .bydshop-oc-widget *,
    .bydshop-oc-widget *::before,
    .bydshop-oc-widget *::after {
        transition: none !important;
    }
}
