/**
 * WooCommerce Sticky Bar – Styles (v1.5.0)
 * Compact design matching reference screenshot (~60px total bar height)
 * All icons: inline SVG (no dashicons font dependency)
 */

:root {
    --wsb-green      : #3BB54A;
    --wsb-green-dark : #2e9e3c;
    --wsb-green-glow : rgba(59,181,74,0.28);
    --wsb-black      : #111111;
    --wsb-gold       : #DC9814;
    --wsb-white      : #FFFFFF;
    --wsb-border     : #cccccc;
    --wsb-text       : #1a1a1a;
    --wsb-radius     : 6px;
    --wsb-h          : 44px;   /* button height */
    --wsb-transition : 0.15s ease;
}

/* ============================================================
   BAR WRAPPER  – centered compact box, like reference screenshot
   ============================================================ */

/* Outer fixed layer – full width, sits at bottom */
.wsb-footer-bar-wrap {
    position      : fixed;
    bottom        : 12px;
    left          : 0;
    right         : 0;
    z-index       : 99999;
    display       : flex;
    justify-content: center;
    pointer-events: none;   /* clicks pass through the transparent area */
}

/* Inner bar – centered box with max-width */
.wsb-footer-bar {
    pointer-events: all;
    display       : flex;
    align-items   : center;
    gap           : 5px;
    padding       : 6px 8px;
    background    : rgb(250,250,250) !important;
    border        : 2px solid var(--wsb-green) !important;
    border-top    : 3px solid var(--wsb-green) !important;
    border-radius : 10px;
    box-shadow    : 0 4px 20px rgba(0,0,0,0.18) !important;
    box-sizing    : border-box;
    width         : 100%;
    max-width     : 500px;   /* compact centered box */
    margin        : 0 12px;
}

/* ============================================================
   SHARED BUTTON BASE
   ============================================================ */
.wsb-footer-btn {
    display          : inline-flex;
    align-items      : center;
    justify-content  : center;
    height           : var(--wsb-h);
    border-radius    : var(--wsb-radius);
    cursor           : pointer;
    text-decoration  : none;
    border           : 1.5px solid var(--wsb-border);
    background       : var(--wsb-white);
    transition       : border-color var(--wsb-transition),
                       background var(--wsb-transition),
                       transform var(--wsb-transition);
    outline          : none;
    box-sizing       : border-box;
    -webkit-tap-highlight-color: transparent;
    user-select      : none;
    flex-shrink      : 0;
    padding          : 0;
}

.wsb-footer-btn:hover,
.wsb-footer-btn:focus-visible {
    border-color  : var(--wsb-green);
    transform     : translateY(-1px);
    text-decoration: none;
}

.wsb-footer-btn:active {
    transform     : none;
}

/* ============================================================
   TICKET & CHAT  – narrow fixed-width icon+label columns
   ============================================================ */
.wsb-footer-item {
    width          : 54px;
    flex-direction : column;
    gap            : 2px;
    color          : var(--wsb-text);
}

.wsb-icon {
    display        : flex;
    align-items    : center;
    justify-content: center;
    color          : var(--wsb-text);
    line-height    : 1;
}

.wsb-icon svg {
    display        : block;
    stroke         : currentColor;
}

.wsb-item-label {
    font-size      : 9px;
    font-weight    : 700;
    letter-spacing : 0.05em;
    text-transform : uppercase;
    color          : var(--wsb-text);
    line-height    : 1;
    white-space    : nowrap;
}

/* ============================================================
   ADD TO CART
   ============================================================ */
.wsb-add-to-cart {
    flex           : 1 1 0;
    min-width      : 0;
    gap            : 7px;
    padding        : 0 10px;
    border-color   : var(--wsb-green);
}

.wsb-add-to-cart:hover,
.wsb-add-to-cart:focus-visible {
    background     : #f4fef5;
}

/* ============================================================
   BUY NOW
   ============================================================ */
.wsb-buy-now {
    flex           : 1.5 1 0;
    min-width      : 0;
    gap            : 5px;
    padding        : 0 10px;
    background     : var(--wsb-green);
    border-color   : var(--wsb-green);
    color          : var(--wsb-white);
    box-shadow     : 0 2px 8px var(--wsb-green-glow);
}

.wsb-buy-now:hover,
.wsb-buy-now:focus-visible {
    background     : var(--wsb-green-dark);
    border-color   : var(--wsb-green-dark);
    color          : var(--wsb-white);
}

.wsb-buy-now .wsb-btn-text,
.wsb-buy-now .wsb-price {
    color          : var(--wsb-white);
}

.wsb-star {
    font-size      : 10px;
    color          : rgba(255,255,255,0.75);
    flex-shrink    : 0;
    line-height    : 1;
}

/* ============================================================
   BUTTON CONTENT (text + price stack)
   ============================================================ */
.wsb-btn-content {
    display        : flex;
    flex-direction : column;
    align-items    : flex-start;
    gap            : 1px;
    min-width      : 0;
    overflow       : hidden;
}

.wsb-buy-now .wsb-btn-content {
    align-items    : center;
}

.wsb-btn-text {
    font-size      : 11px;
    font-weight    : 800;
    letter-spacing : 0.04em;
    text-transform : uppercase;
    color          : var(--wsb-text);
    line-height    : 1.2;
    white-space    : nowrap;
    overflow       : hidden;
    text-overflow  : ellipsis;
    max-width      : 100%;
}

.wsb-price {
    font-size      : 10px;
    font-weight    : 600;
    color          : var(--wsb-gold);
    line-height    : 1.2;
    white-space    : nowrap;
}

/* ============================================================
   MOBILE  ≤ 480px
   ============================================================ */
@media (max-width: 480px) {
    :root {
        --wsb-h      : 40px;
    }

    .wsb-footer-bar {
        gap     : 4px;
        padding : 6px 5px;
    }

    .wsb-footer-item {
        width   : 46px;
    }

    .wsb-icon svg {
        width   : 16px;
        height  : 16px;
    }

    .wsb-item-label {
        font-size : 8px;
    }

    .wsb-btn-text {
        font-size : 10px;
        letter-spacing: 0;
    }

    .wsb-price {
        font-size : 9px;
    }

    .wsb-add-to-cart,
    .wsb-buy-now {
        padding : 0 7px;
        gap     : 5px;
    }
}

/* ============================================================
   VERY SMALL  ≤ 360px – hide ATC text, show icon + price only
   ============================================================ */
@media (max-width: 360px) {
    .wsb-footer-item {
        width   : 40px;
    }

    .wsb-add-to-cart .wsb-btn-text {
        display : none;
    }

    .wsb-add-to-cart .wsb-btn-content {
        align-items : center;
    }

    .wsb-add-to-cart .wsb-price {
        font-size  : 10px;
        color      : var(--wsb-text);
        font-weight: 700;
    }
}

/* ============================================================
   BODY PADDING
   ============================================================ */
body.wsb-active {
    padding-bottom : 80px !important;
}

/* Mobile: allow bar to stretch a bit more */
@media (max-width: 600px) {
    .wsb-footer-bar-wrap {
        bottom  : 8px;
    }
    .wsb-footer-bar {
        margin  : 0 8px;
        max-width: 100%;
    }
}

/* ============================================================
   MODAL OVERLAY
   ============================================================ */
.wsb-modal-overlay {
    position       : fixed;
    inset          : 0;
    background     : rgba(0,0,0,0.52);
    z-index        : 100000;
    display        : flex;
    align-items    : center;
    justify-content: center;
    padding        : 16px;
    box-sizing     : border-box;
    backdrop-filter: blur(2px);
}

.wsb-modal-content {
    background     : var(--wsb-white);
    border-radius  : 10px;
    width          : 100%;
    max-width      : 460px;
    max-height     : 90vh;
    overflow-y     : auto;
    box-shadow     : 0 14px 40px rgba(0,0,0,0.20);
    animation      : wsbIn 0.18s ease;
}

@keyframes wsbIn {
    from { opacity:0; transform:translateY(14px) scale(0.97); }
    to   { opacity:1; transform:translateY(0)    scale(1);    }
}

/* Modal header */
.wsb-modal-header {
    display        : flex;
    align-items    : center;
    justify-content: space-between;
    padding        : 13px 16px;
    background     : var(--wsb-black);
    border-radius  : 10px 10px 0 0;
    border-bottom  : 3px solid var(--wsb-green);
}

.wsb-modal-header h3 {
    margin         : 0;
    font-size      : 14px;
    font-weight    : 700;
    color          : var(--wsb-white);
    letter-spacing : 0.03em;
}

.wsb-modal-close {
    background     : transparent;
    border         : none;
    cursor         : pointer;
    padding        : 3px;
    border-radius  : 4px;
    display        : flex;
    align-items    : center;
    justify-content: center;
    transition     : background var(--wsb-transition);
    color          : var(--wsb-white);
    line-height    : 1;
}

.wsb-modal-close:hover {
    background     : var(--wsb-green);
}

.wsb-modal-close svg {
    display        : block;
    stroke         : var(--wsb-white);
}

/* Chat body */
.wsb-chat-body {
    padding        : 16px;
    display        : flex;
    flex-direction : column;
    gap            : 10px;
}

.wsb-chat-option {
    display        : flex;
    align-items    : center;
    gap            : 12px;
    padding        : 11px 14px;
    background     : #f8f8f8;
    border         : 1.5px solid var(--wsb-border);
    border-radius  : var(--wsb-radius);
    cursor         : pointer;
    transition     : border-color var(--wsb-transition),
                     background var(--wsb-transition),
                     transform var(--wsb-transition);
    width          : 100%;
    text-align     : left;
}

.wsb-chat-option:hover {
    border-color   : var(--wsb-green);
    background     : #f0fdf2;
    transform      : translateX(3px);
}

.wsb-chat-icon {
    width          : 34px;
    height         : 34px;
    border-radius  : 50%;
    background     : var(--wsb-green);
    display        : flex;
    align-items    : center;
    justify-content: center;
    flex-shrink    : 0;
    color          : var(--wsb-white);
}

.wsb-chat-icon svg {
    stroke         : var(--wsb-white);
}

.wsb-chat-label {
    flex           : 1;
    font-size      : 13px;
    font-weight    : 600;
    color          : var(--wsb-text);
}

.wsb-chat-arrow {
    color          : #aaa;
    font-size      : 14px;
    line-height    : 1;
}

.wsb-no-channels {
    text-align     : center;
    color          : #888;
    font-size      : 13px;
    padding        : 18px 0;
    margin         : 0;
}

/* Ticket body */
.wsb-ticket-content { max-width: 520px; }

.wsb-ticket-body { padding: 16px; }

.wsb-form-group { margin-bottom: 11px; }

.wsb-form-group label {
    display        : block;
    font-size      : 12px;
    font-weight    : 600;
    color          : var(--wsb-text);
    margin-bottom  : 4px;
}

.wsb-form-group input[type="text"],
.wsb-form-group input[type="email"],
.wsb-form-group select,
.wsb-form-group textarea {
    width          : 100%;
    padding        : 8px 10px;
    border         : 1.5px solid var(--wsb-border);
    border-radius  : 6px;
    font-size      : 13px;
    color          : var(--wsb-text);
    background     : #fafafa;
    box-sizing     : border-box;
    transition     : border-color var(--wsb-transition);
    outline        : none;
    font-family    : inherit;
}

.wsb-form-group input:focus,
.wsb-form-group select:focus,
.wsb-form-group textarea:focus {
    border-color   : var(--wsb-green);
    background     : var(--wsb-white);
}

.wsb-form-group textarea {
    resize         : vertical;
    min-height     : 75px;
}

.wsb-upload-area {
    border         : 1.5px dashed var(--wsb-border);
    border-radius  : 6px;
    padding        : 12px;
    text-align     : center;
    cursor         : pointer;
    background     : #fafafa;
    transition     : border-color var(--wsb-transition), background var(--wsb-transition);
}

.wsb-upload-area:hover {
    border-color   : var(--wsb-green);
    background     : #f0fdf2;
}

.wsb-upload-area svg {
    display        : block;
    margin         : 0 auto 5px;
    stroke         : var(--wsb-green);
}

.wsb-upload-area p {
    margin         : 0;
    font-size      : 12px;
    color          : #888;
}

.wsb-upload-area input[type="file"] { display: none; }

.wsb-image-preview {
    display        : flex;
    flex-wrap      : wrap;
    gap            : 6px;
    margin-top     : 8px;
}

.wsb-preview-item {
    position       : relative;
    width          : 60px;
    height         : 60px;
    border-radius  : 6px;
    overflow       : hidden;
    border         : 1.5px solid var(--wsb-border);
}

.wsb-preview-item img {
    width          : 100%;
    height         : 100%;
    object-fit     : cover;
    display        : block;
}

.wsb-preview-remove {
    position       : absolute;
    top            : 2px;
    right          : 2px;
    background     : rgba(0,0,0,0.55);
    color          : var(--wsb-white);
    border         : none;
    border-radius  : 50%;
    width          : 15px;
    height         : 15px;
    font-size      : 10px;
    cursor         : pointer;
    display        : flex;
    align-items    : center;
    justify-content: center;
    padding        : 0;
    transition     : background var(--wsb-transition);
}

.wsb-preview-remove:hover { background: #e53e3e; }

.wsb-submit-btn {
    width          : 100%;
    padding        : 10px;
    background     : var(--wsb-green);
    color          : var(--wsb-white);
    border         : none;
    border-radius  : var(--wsb-radius);
    font-size      : 13px;
    font-weight    : 700;
    letter-spacing : 0.05em;
    text-transform : uppercase;
    cursor         : pointer;
    transition     : background var(--wsb-transition), transform var(--wsb-transition);
    margin-top     : 4px;
    box-shadow     : 0 3px 8px var(--wsb-green-glow);
}

.wsb-submit-btn:hover {
    background     : var(--wsb-green-dark);
    transform      : translateY(-1px);
}

.wsb-submit-btn:disabled {
    opacity        : 0.6;
    cursor         : not-allowed;
    transform      : none;
}

.wsb-progress-wrap {
    height         : 3px;
    background     : #eee;
    border-radius  : 2px;
    overflow       : hidden;
    margin-bottom  : 10px;
    display        : none;
}

.wsb-progress-bar {
    height         : 100%;
    background     : linear-gradient(90deg, var(--wsb-green), var(--wsb-green-dark));
    border-radius  : 2px;
    transition     : width 0.3s ease;
    width          : 0%;
}

.wsb-success-msg,
.wsb-error-msg {
    padding        : 9px 13px;
    border-radius  : 6px;
    font-size      : 13px;
    font-weight    : 500;
    margin-bottom  : 10px;
    display        : none;
}

.wsb-success-msg {
    background     : #f0fdf4;
    border         : 1px solid #86efac;
    color          : #166534;
}

.wsb-error-msg {
    background     : #fef2f2;
    border         : 1px solid #fca5a5;
    color          : #991b1b;
}

/* ============================================================
   TICKET MODAL ACTIONS – normalize theme-overridden buttons
   ============================================================ */
.wsb-modal-body {
    padding        : 16px;
    box-sizing     : border-box;
}

.wsb-ticket-content .wsb-form-group {
    margin-bottom  : 12px;
}

.wsb-photo-upload {
    display        : flex;
    align-items    : center;
    gap            : 10px;
    width          : 100%;
    padding        : 10px 12px;
    border         : 1.5px dashed var(--wsb-border);
    border-radius  : 6px;
    background     : #fafafa;
    box-sizing     : border-box;
}

.wsb-photo-text {
    flex           : 1;
    min-width      : 0;
    font-size      : 13px;
    color          : #555;
}

.wsb-photo-btn {
    display        : inline-flex;
    align-items    : center;
    justify-content: center;
    min-height     : 34px;
    padding        : 0 14px;
    border         : 1.5px solid var(--wsb-green) !important;
    border-radius  : var(--wsb-radius) !important;
    background     : var(--wsb-white) !important;
    color          : var(--wsb-green-dark) !important;
    font-size      : 13px !important;
    font-weight    : 700 !important;
    line-height    : 1 !important;
    text-decoration: none !important;
    cursor         : pointer;
    box-shadow     : none !important;
}

.wsb-photo-btn:hover,
.wsb-photo-btn:focus-visible {
    background     : #f0fdf2 !important;
    border-color   : var(--wsb-green-dark) !important;
}

.wsb-photo-preview {
    display        : flex;
    flex-wrap      : wrap;
    gap            : 6px;
    margin-top     : 8px;
}

.wsb-photo-item {
    position       : relative;
    width          : 58px;
    height         : 58px;
    border-radius  : 6px;
    overflow       : hidden;
    border         : 1.5px solid var(--wsb-border);
    background     : #f5f5f5;
}

.wsb-photo-item img {
    width          : 100%;
    height         : 100%;
    object-fit     : cover;
    display        : block;
}

.wsb-photo-remove {
    position       : absolute;
    top            : 3px;
    right          : 3px;
    width          : 18px;
    height         : 18px;
    display        : flex;
    align-items    : center;
    justify-content: center;
    padding        : 0 !important;
    border         : none !important;
    border-radius  : 50% !important;
    background     : rgba(0,0,0,0.58) !important;
    color          : var(--wsb-white) !important;
    font-size      : 12px !important;
    line-height    : 1 !important;
    cursor         : pointer;
}

.wsb-photo-remove:hover {
    background     : #e53e3e !important;
}

.wsb-form-actions {
    display        : flex;
    justify-content: flex-end;
    align-items    : center;
    gap            : 10px;
    margin-top     : 14px;
    padding-top    : 12px;
    border-top     : 1px solid #eeeeee;
}

.wsb-form-actions .wsb-btn {
    display        : inline-flex;
    align-items    : center;
    justify-content: center;
    min-width      : 112px;
    min-height     : 38px;
    padding        : 0 16px !important;
    border-radius  : var(--wsb-radius) !important;
    font-size      : 13px !important;
    font-weight    : 700 !important;
    line-height    : 1 !important;
    text-decoration: none !important;
    cursor         : pointer;
    transition     : background var(--wsb-transition), border-color var(--wsb-transition), color var(--wsb-transition), transform var(--wsb-transition);
    box-shadow     : none !important;
    appearance     : none;
    -webkit-appearance: none;
}

.wsb-form-actions .wsb-btn-cancel {
    background     : var(--wsb-white) !important;
    color          : #444 !important;
    border         : 1.5px solid var(--wsb-border) !important;
}

.wsb-form-actions .wsb-btn-cancel:hover,
.wsb-form-actions .wsb-btn-cancel:focus-visible {
    background     : #f5f5f5 !important;
    border-color   : #999 !important;
    color          : #111 !important;
}

.wsb-form-actions .wsb-btn-submit {
    background     : var(--wsb-green) !important;
    color          : var(--wsb-white) !important;
    border         : 1.5px solid var(--wsb-green) !important;
    box-shadow     : 0 3px 8px var(--wsb-green-glow) !important;
}

.wsb-form-actions .wsb-btn-submit:hover,
.wsb-form-actions .wsb-btn-submit:focus-visible {
    background     : var(--wsb-green-dark) !important;
    border-color   : var(--wsb-green-dark) !important;
    color          : var(--wsb-white) !important;
    transform      : translateY(-1px);
}

.wsb-form-actions .wsb-btn:disabled {
    opacity        : 0.6;
    cursor         : not-allowed;
    transform      : none !important;
}

@media (max-width: 480px) {
    .wsb-form-actions {
        flex-direction : column-reverse;
        align-items    : stretch;
    }

    .wsb-form-actions .wsb-btn {
        width          : 100%;
    }

    .wsb-photo-upload {
        align-items    : stretch;
        flex-direction : column;
    }
}
