/**
 * Smart J Quote
 * Frontend CSS
 */

/* =========================================================
   Add To Quote Button
   ========================================================= */

.sjq-add-to-quote {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 18px;

    border: 1px solid #222;
    border-radius: 2px;

    background: #222;
    color: #fff;

    font-size: 14px;
    line-height: 1.4;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        opacity 0.2s ease;
}

.sjq-add-to-quote:hover {
    opacity: 0.85;
}

.sjq-add-to-quote:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}


/* =========================================================
   Quote Cart Button
   ========================================================= */

.sjq-open-quote-cart {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 10px 16px;

    border: 1px solid #222;
    background: #222;
    color: #fff;

    cursor: pointer;
}

.sjq-quote-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 20px;
    height: 20px;

    padding: 0 5px;

    border-radius: 20px;

    background: #fff;
    color: #222;

    font-size: 12px;
}


/* =========================================================
   Popup - Dark Theme (matches design screenshot)
   ========================================================= */

.sjq-popup {
    position: fixed;
    inset: 0;

    z-index: 999999;

    display: none;
}

.sjq-popup.is-open {
    display: block;
}

body.sjq-popup-open {
    overflow: hidden;
}


/* Overlay */

.sjq-popup-overlay {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.65);
}


/* Container */

.sjq-popup-container {
    position: absolute;

    top: 50%;
    left: 50%;

    width: 560px;
    max-width: calc(100% - 30px);

    max-height: calc(100vh - 40px);

    transform: translate(-50%, -50%);

    display: flex;
    flex-direction: column;

    background: #1a1a1a;
    color: #e8e8e8;

    border-radius: 6px;

    overflow: hidden;

    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.45);
}


/* Header */

.sjq-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 16px 20px;

    border-bottom: 1px solid #2e2e2e;

    flex-shrink: 0;
}

.sjq-popup-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sjq-popup-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #f5c518;
}

.sjq-popup-header-icon svg {
    display: block;
}

.sjq-popup-header h2 {
    margin: 0;

    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;

    color: #f5c518;
}

.sjq-popup-close {
    width: 32px;
    height: 32px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #999;

    font-size: 26px;
    line-height: 1;

    cursor: pointer;

    transition: color 0.15s ease;
}

.sjq-popup-close:hover {
    color: #fff;
}


/* Notice - max 3 items */

.sjq-popup-notice {
    padding: 10px 20px;

    font-size: 13px;
    line-height: 1.4;

    color: #aaa;

    border-bottom: 1px solid #2e2e2e;

    flex-shrink: 0;
}

.sjq-popup-notice-star {
    color: #f5c518;
    margin-right: 2px;
}


/* Body */

.sjq-popup-body {
    position: relative;

    min-height: 120px;

    max-height: 50vh;

    overflow-y: auto;

    flex: 1 1 auto;
}


/* Items */

.sjq-quote-items {
    padding: 0 20px;
}


/* Single Item */

.sjq-quote-item {
    display: flex;
    align-items: flex-start;

    gap: 14px;

    padding: 16px 0;

    border-bottom: 1px solid #2e2e2e;
}

.sjq-quote-item:last-child {
    border-bottom: 0;
}


/* Product Image */

.sjq-quote-item-image {
    width: 72px;
    height: 72px;

    flex: 0 0 72px;

    overflow: hidden;

    background: #2a2a2a;

    border-radius: 4px;
}

.sjq-quote-item-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* Product Info */

.sjq-quote-item-info {
    flex: 1;
    min-width: 0;

    padding-top: 2px;
}

.sjq-quote-item-title {
    display: block;

    margin-bottom: 6px;

    color: #f0f0f0;

    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;

    text-decoration: none;

    word-break: break-word;
}

.sjq-quote-item-title:hover {
    color: #f5c518;
}

.sjq-quote-item-desc {
    margin: 0;

    font-size: 12px;
    line-height: 1.5;

    color: #888;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Remove - red circle style */

.sjq-quote-item-remove {
    flex: 0 0 auto;

    width: 28px;
    height: 28px;

    margin-top: 4px;
    padding: 0;

    border: 0;
    border-radius: 50%;

    background: #c0392b;

    color: #fff;

    font-size: 18px;
    line-height: 1;

    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition: background 0.15s ease, transform 0.1s ease;
}

.sjq-quote-item-remove:hover {
    background: #e74c3c;
}

.sjq-quote-item-remove:active {
    transform: scale(0.95);
}


/* Empty */

.sjq-quote-empty {
    display: none;

    padding: 48px 20px;

    text-align: center;

    color: #777;
}

.sjq-quote-empty p {
    margin: 0;
    font-size: 14px;
}

.sjq-popup.is-empty .sjq-quote-empty {
    display: block;
}

.sjq-popup.is-empty .sjq-quote-items {
    display: none;
}


/* Loading */

.sjq-quote-loading {
    padding: 40px 20px;

    text-align: center;

    color: #777;

    font-size: 14px;
}


/* Footer */

.sjq-popup-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;

    padding: 14px 20px;

    border-top: 1px solid #2e2e2e;

    background: #151515;

    flex-shrink: 0;
}

.sjq-popup-total {
    font-size: 14px;
    color: #ccc;
}

.sjq-popup-total-count {
    font-weight: 600;
    color: #f5c518;
}

.sjq-request-quote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 10px 18px;

    border: 0;
    border-radius: 4px;

    background: #f5c518;
    color: #1a1a1a;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: background 0.15s ease, opacity 0.15s ease;
}

.sjq-request-quote:hover {
    background: #ffd54f;
}

.sjq-request-quote:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sjq-request-quote-icon {
    display: inline-flex;
    align-items: center;
}

.sjq-request-quote-icon svg {
    display: block;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {

    .sjq-popup-container {
        width: calc(100% - 16px);

        max-height: calc(100vh - 16px);
    }

    .sjq-popup-header {
        padding: 14px 16px;
    }

    .sjq-popup-notice {
        padding: 8px 16px;
    }

    .sjq-popup-body {
        max-height: 55vh;
    }

    .sjq-quote-items {
        padding-left: 16px;
        padding-right: 16px;
    }

    .sjq-popup-footer {
        padding: 12px 16px;
        gap: 12px;
    }

    .sjq-quote-item-image {
        width: 60px;
        height: 60px;

        flex-basis: 60px;
    }

    .sjq-quote-item-title {
        font-size: 14px;
    }

    .sjq-request-quote {
        padding: 9px 14px;
        font-size: 13px;
    }
}



/* =========================================================
   Inquiry Form (dark panel, ANKO-style)
   ========================================================= */

.sjq-inquiry-form-wrapper {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 12px 40px;
    box-sizing: border-box;
}

.sjq-inquiry-panel {
    background: #2b2b2b;
    color: #e8e8e8;
    padding: 36px 40px 32px;
    border-radius: 2px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.sjq-inquiry-title {
    margin: 0 0 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid #444;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
}

.sjq-inquiry-intro {
    margin: 18px 0 28px;
    font-size: 13px;
    line-height: 1.6;
    color: #bbb;
}

.sjq-inquiry-form .sjq-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
}

.sjq-inquiry-form .sjq-field-label {
    font-size: 13px;
    font-weight: 500;
    color: #ddd;
}

.sjq-inquiry-form .sjq-field-label .req {
    color: #e74c3c;
    margin-left: 2px;
}

.sjq-inquiry-form .sjq-hint {
    color: #888;
    font-weight: 400;
    font-size: 12px;
}

.sjq-inquiry-form input[type="text"],
.sjq-inquiry-form input[type="email"],
.sjq-inquiry-form input[type="url"],
.sjq-inquiry-form input[type="number"],
.sjq-inquiry-form input[type="tel"],
.sjq-inquiry-form select,
.sjq-inquiry-form textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #555;
    border-radius: 2px;
    background: #f5f5f5;
    color: #222;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
}

.sjq-inquiry-form input:focus,
.sjq-inquiry-form select:focus,
.sjq-inquiry-form textarea:focus {
    outline: none;
    border-color: #f5c518;
    box-shadow: 0 0 0 1px rgba(245, 197, 24, 0.35);
}

.sjq-inquiry-form input[type="file"] {
    color: #ccc;
    font-size: 13px;
    max-width: 100%;
}

.sjq-inquiry-form .sjq-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sjq-inquiry-form .sjq-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #ccc;
    cursor: pointer;
    font-weight: 400;
}

.sjq-inquiry-form .sjq-radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: #f5c518;
}

.sjq-form-divider {
    border: 0;
    border-top: 1px solid #444;
    margin: 28px 0 20px;
}

.sjq-form-note {
    margin: 0 0 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #aaa;
    text-transform: uppercase;
}

.sjq-product-readonly {
    background: #8a8a8a !important;
    color: #c0392b !important;
    font-weight: 600;
    cursor: default;
    resize: none;
    border-color: #666 !important;
}

.sjq-section-title {
    margin: 0 0 20px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
}

.sjq-name-row {
    display: flex;
    gap: 12px;
}

.sjq-name-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sjq-sub-label {
    font-size: 11px;
    color: #888;
}

.sjq-captcha-prompt {
    color: #f5c518;
}

.sjq-captcha-input {
    max-width: 120px !important;
}

.sjq-inquiry-form .sjq-submit-quote {
    display: inline-block;
    width: auto;
    min-width: 120px;
    margin-top: 8px;
    padding: 12px 28px;
    border: 0;
    border-radius: 2px;
    background: #f5c518;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sjq-inquiry-form .sjq-submit-quote:hover {
    background: #ffd54f;
}

.sjq-consent {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid #444;
}

.sjq-consent-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #ccc;
}

.sjq-consent-text {
    margin: 0;
    font-size: 11px;
    line-height: 1.55;
    color: #888;
}

.sjq-quote-form-error {
    margin-bottom: 20px;
    padding: 12px 15px;
    border: 1px solid #c0392b;
    background: rgba(192, 57, 43, 0.15);
    color: #ff8a80;
    font-size: 13px;
    border-radius: 2px;
}

.sjq-quote-success {
    padding: 48px 24px;
    text-align: center;
    background: #2b2b2b;
    color: #e8e8e8;
    border-radius: 2px;
}

.sjq-quote-success h2 {
    margin: 0 0 12px;
    color: #f5c518;
}

.sjq-quote-success p {
    margin: 0;
    color: #bbb;
}

/* Legacy form classes (fallback) */
.sjq-quote-form-wrapper {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.sjq-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.sjq-status-new {
    background: #fff3cd;
    color: #856404;
}

.sjq-status-read {
    background: #e2e3e5;
    color: #383d41;
}

.sjq-status-replied {
    background: #d4edda;
    color: #155724;
}

.sjq-delete-quote {
    color: #b32d2e;
}

@media (max-width: 600px) {
    .sjq-inquiry-panel {
        padding: 24px 18px 28px;
    }

    .sjq-name-row {
        flex-direction: column;
        gap: 16px;
    }

    .sjq-inquiry-title {
        font-size: 19px;
    }
}
