/**
 * WC Ponuda Generator - Frontend Styles
 * Designed to blend with WooCommerce theme styles.
 */

/* ─── Search ────────────────────────────────────────────── */
.wcqg-fe-search-wrap {
    margin-bottom: 20px;
    position: relative;
}

.wcqg-fe-search-wrap input {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.2s;
}

.wcqg-fe-search-wrap input:focus {
    border-color: #2c3e50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.wcqg-fe-search-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    display: block;
}

/* ─── Autocomplete Dropdown ─────────────────────────────── */
.wcqg-fe-autocomplete {
    max-height: 350px;
    overflow-y: auto;
    z-index: 10000 !important;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    background: #fff;
}

.wcqg-fe-autocomplete .ui-menu-item {
    padding: 0;
    border-bottom: 1px solid #f5f5f5;
}

.wcqg-fe-autocomplete .ui-menu-item:last-child {
    border-bottom: 0;
}

.wcqg-fe-autocomplete .ui-menu-item-wrapper {
    padding: 0;
}

.wcqg-fe-autocomplete .ui-state-active {
    background: #f8f9fa !important;
    border: none !important;
    color: inherit !important;
}

.wcqg-fe-ac-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.wcqg-fe-ac-item:hover {
    background: #f0f6fc;
}

.wcqg-fe-ac-img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.wcqg-fe-ac-info {
    flex: 1;
    min-width: 0;
}

.wcqg-fe-ac-info strong {
    display: block;
    font-size: 14px;
    line-height: 1.3;
}

.wcqg-fe-ac-info small {
    color: #999;
    font-size: 12px;
}

.wcqg-fe-ac-right {
    text-align: right;
    flex-shrink: 0;
}

.wcqg-fe-ac-price {
    font-weight: bold;
    font-size: 14px;
    color: #2c3e50;
    display: block;
}

.wcqg-fe-ac-price del {
    color: #999;
    font-weight: normal;
    font-size: 12px;
}

.wcqg-fe-ac-price ins {
    color: #e74c3c;
    text-decoration: none;
}

.wcqg-fe-ac-stock {
    font-size: 11px;
    display: block;
    margin-top: 2px;
}

.wcqg-fe-ac-stock.in { color: #28a745; }
.wcqg-fe-ac-stock.out { color: #dc3545; }

/* ─── Items Table ───────────────────────────────────────── */
.wcqg-fe-items-wrap {
    margin-bottom: 20px;
}

.wcqg-fe-items-table {
    border: 1px solid #e5e5e5;
}

.wcqg-fe-items-table thead th {
    background: #f8f9fa;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.wcqg-fe-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

.wcqg-fe-sku {
    color: #999;
    font-size: 12px;
}

.wcqg-fe-empty {
    text-align: center;
    padding: 40px 20px !important;
    color: #999;
    font-size: 15px;
}

/* ─── Quantity Controls ─────────────────────────────────── */
.wcqg-fe-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.wcqg-fe-qty-minus,
.wcqg-fe-qty-plus {
    width: 32px;
    height: 32px;
    border: none;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}

.wcqg-fe-qty-minus:hover,
.wcqg-fe-qty-plus:hover {
    background: #e9ecef;
}

.wcqg-fe-qty {
    width: 50px !important;
    height: 32px;
    text-align: center;
    border: none !important;
    border-left: 1px solid #ddd !important;
    border-right: 1px solid #ddd !important;
    font-size: 14px;
    font-weight: bold;
    padding: 0 !important;
    margin: 0 !important;
    -moz-appearance: textfield;
}

.wcqg-fe-qty::-webkit-outer-spin-button,
.wcqg-fe-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ─── Remove Button ─────────────────────────────────────── */
.wcqg-fe-remove {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    color: #dc3545;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}

.wcqg-fe-remove:hover {
    background: #dc3545;
    color: #fff;
}

/* ─── Totals ────────────────────────────────────────────── */
.wcqg-fe-totals {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
}

.wcqg-fe-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

.wcqg-fe-totals-row strong {
    font-size: 24px;
    color: #2c3e50;
}

.wcqg-fe-note-price {
    font-size: 12px;
    color: #999;
    margin: 10px 0 0;
    font-style: italic;
}

/* ─── Customer Section ──────────────────────────────────── */
.wcqg-fe-customer-section {
    border-top: 2px solid #e5e5e5;
    padding-top: 25px;
    margin-bottom: 25px;
}

.wcqg-fe-customer-section h3 {
    margin-bottom: 15px;
}

.wcqg-fe-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.wcqg-fe-field {
    margin-bottom: 10px;
}

.wcqg-fe-field-half {
    flex: 1 1 calc(50% - 15px);
    min-width: 200px;
}

.wcqg-fe-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.wcqg-fe-field input,
.wcqg-fe-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wcqg-fe-field input:focus,
.wcqg-fe-field textarea:focus {
    border-color: #2c3e50;
    outline: none;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

.wcqg-fe-field textarea {
    resize: vertical;
}

/* ─── Submit Section ────────────────────────────────────── */
.wcqg-fe-submit-section {
    text-align: center;
    border-top: 2px solid #e5e5e5;
    padding-top: 25px;
}

#wcqg-fe-submit-btn {
    font-size: 16px;
    padding: 14px 40px;
    border-radius: 6px;
    min-width: 300px;
}

#wcqg-fe-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wcqg-fe-submit-note {
    font-size: 13px;
    color: #999;
    margin-top: 12px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Messages ──────────────────────────────────────────── */
#wcqg-success-message {
    font-size: 15px;
}

/* ─── Responsive ────────────────────────────────────────── */
@media screen and (max-width: 768px) {
    .wcqg-fe-fields {
        flex-direction: column;
    }

    .wcqg-fe-field-half {
        flex: 1 1 100%;
    }

    #wcqg-fe-submit-btn {
        width: 100%;
        min-width: auto;
    }

    .wcqg-fe-items-table .product-thumbnail {
        display: none;
    }
}

/* ─── Product page quote link (wishlist style) ─────────── */
.wcqg-product-quote-link {
    margin-top: 8px;
}
.wcqg-product-quote-link a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.2s;
}
.wcqg-product-quote-link a:hover {
    color: #000;
    text-decoration: underline;
}
.wcqg-product-quote-link svg {
    flex-shrink: 0;
}
