/**
 * Quote Request Styles
 */

/* =========================================================
   Floating Quote-List Badge (bottom-right, all pages)
   ========================================================= */

.wc-api-sync-quote-badge {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9990;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    /* Panel uses position:absolute relative to this container */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.wc-api-sync-quote-badge.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Toggle button (replaces the old <a> link) */
.wc-api-sync-quote-badge__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0073aa;
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 50px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s, box-shadow 0.2s;
}

.wc-api-sync-quote-badge__toggle:hover,
.wc-api-sync-quote-badge__toggle:focus {
    background: #005a87;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    outline: none;
}

/* =========================================================
   Mini-panel (slides up above the badge)
   ========================================================= */

.wc-api-sync-quote-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    width: 290px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    /* Hidden state */
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 10;
}

.wc-api-sync-quote-panel.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.wc-api-sync-quote-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #0073aa;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.wc-api-sync-quote-panel__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.wc-api-sync-quote-panel__close:hover { opacity: 1; }

.wc-api-sync-quote-panel__list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    max-height: 240px;
    overflow-y: auto;
}

.wc-api-sync-quote-panel__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    line-height: 1.4;
}
.wc-api-sync-quote-panel__item:last-child { border-bottom: none; }

.wc-api-sync-quote-panel__item-name {
    flex: 1;
    color: #333;
    margin-right: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wc-api-sync-quote-panel__item-qty {
    flex-shrink: 0;
    background: #f0f4f8;
    color: #0073aa;
    font-weight: 700;
    font-size: 12px;
    border-radius: 20px;
    padding: 2px 8px;
}

.wc-api-sync-quote-panel__empty {
    padding: 16px 14px;
    color: #888;
    font-size: 13px;
    text-align: center;
}

.wc-api-sync-quote-panel__footer {
    padding: 10px 14px;
    border-top: 1px solid #eee;
    text-align: right;
}

.wc-api-sync-quote-panel__view-all {
    color: #0073aa;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.wc-api-sync-quote-panel__view-all:hover { text-decoration: underline; }

.wc-api-sync-quote-badge__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.wc-api-sync-quote-badge__count {
    background: #fff;
    color: #0073aa;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

/* =========================================================
   "Add to Quote" button wrapper & inline feedback
   ========================================================= */

.wc-api-sync-quote-request-button-wrapper {
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.wc-api-sync-add-to-quote-feedback {
    font-size: 14px;
    line-height: 1.4;
}

.wc-api-sync-add-to-quote-feedback.is-success {
    color: #155724;
}

.wc-api-sync-add-to-quote-feedback.is-error {
    color: #721c24;
}

.wc-api-sync-add-to-quote-feedback a {
    color: inherit;
    font-weight: 600;
}

/* =========================================================
   [wc_quote_cart] header shortcode icon
   ========================================================= */

.wc-api-sync-quote-header-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    text-decoration: none;
    color: inherit;
    vertical-align: middle;
}

.wc-api-sync-quote-header-icon__svg {
    width: 22px;
    height: 22px;
}

.wc-api-sync-quote-header-icon__label {
    font-size: 14px;
    font-weight: 600;
}

.wc-api-sync-quote-header-icon__count {
    display: none;
    background: #0073aa;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.wc-api-sync-quote-header-icon__count.is-visible {
    display: inline-flex;
}

/* Modal Overlay */
.wc-api-sync-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

/* Modal Container */
.wc-api-sync-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Modal Content */
.wc-api-sync-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.wc-api-sync-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.wc-api-sync-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

/* Modal Close Button */
.wc-api-sync-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.wc-api-sync-modal-close:hover {
    color: #333;
}

/* Quote Form */
.wc-api-sync-quote-form {
    padding: 20px;
}

/* Form Group */
.wc-api-sync-form-group {
    margin-bottom: 20px;
}

.wc-api-sync-form-group:last-of-type {
    margin-bottom: 0;
}

/* Form Labels */
.wc-api-sync-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.wc-api-sync-form-group label .required {
    color: #dc3545;
}

/* Form Controls */
.wc-api-sync-form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.wc-api-sync-form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.wc-api-sync-form-control:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.wc-api-sync-form-control[readonly] {
    background-color: #f5f5f5;
    color: #666;
}

/* Textarea */
textarea.wc-api-sync-form-control {
    resize: vertical;
    min-height: 120px;
}

/* Form Buttons */
.wc-api-sync-quote-submit,
.wc-api-sync-quote-cancel {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    margin-right: 10px;
}

.wc-api-sync-quote-submit {
    background-color: #0073aa;
    color: white;
}

.wc-api-sync-quote-submit:hover:not(:disabled) {
    background-color: #005a87;
}

.wc-api-sync-quote-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wc-api-sync-quote-cancel {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.wc-api-sync-quote-cancel:hover {
    background-color: #efefef;
}

/* Form Message */
.wc-api-sync-form-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.wc-api-sync-form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wc-api-sync-form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 600px) {
    .wc-api-sync-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .wc-api-sync-modal-header {
        padding: 15px;
    }

    .wc-api-sync-modal-header h2 {
        font-size: 20px;
    }

    .wc-api-sync-quote-form {
        padding: 15px;
    }

    .wc-api-sync-form-group {
        margin-bottom: 15px;
    }

    .wc-api-sync-quote-submit,
    .wc-api-sync-quote-cancel {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .wc-api-sync-quote-cancel {
        margin-bottom: 0;
    }
}

/* Accessibility */
.wc-api-sync-form-control:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Loading State */
.wc-api-sync-quote-submit.loading {
    position: relative;
    color: transparent;
}

.wc-api-sync-quote-submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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