/* ======================================================
   FREIGHT REQUEST – Frontend CSS
   Theme: Mangelberger — Poppins, Orange #e74e11, Blue #016b9f
   ====================================================== */

:root {
    --fr-orange:      #e74e11;
    --fr-orange-dark: #c43d0a;
    --fr-blue:        #016b9f;
    --fr-black:       #051C2C;
    --fr-white:       #ffffff;
    --fr-gray-50:     #f8f9fa;
    --fr-gray-100:    #f1f3f4;
    --fr-gray-200:    #e8eaed;
    --fr-gray-400:    #9aa0a6;
    --fr-gray-600:    #5f6368;
    --fr-radius-btn:  32px;
    --fr-radius-card: 12px;
    --fr-radius-inp:  12px;
    --fr-shadow:      0 2px 12px rgba(5,28,44,.08);
    --fr-shadow-md:   0 4px 24px rgba(5,28,44,.12);
    --fr-font:        'Poppins', sans-serif;
    --fr-ease:        .2s ease;
}

/* ── Preis auf Anfrage ──────────────────────────────── */
.fr-price-request {
    font-weight: 600;
    color: var(--fr-blue);
    font-size: .95em;
}

/* ── Status-Badges ──────────────────────────────────── */
.fr-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.fr-status--pending  { background:#fff8e1; color:#b8860b; }
.fr-status--quoted   { background:#e3f2fd; color:var(--fr-blue); }
.fr-status--accepted { background:#e8f5e9; color:#2e7d32; }
.fr-status--ordered  { background:#e8f5e9; color:#1b5e20; }
.fr-status--declined { background:#fce4ec; color:#c62828; }

/* ── Account Badge ──────────────────────────────────── */
.fr-account-badge,
.fr-has-badge > a::after {
    content: attr(data-badge);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--fr-orange);
    color: var(--fr-white);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    min-width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-left: 5px;
    line-height: 1;
}
.fr-account-badge { content: none; }

/* ── Anfrage-Button auf Produktseite ────────────────── */
.fr-add-wrap { margin-top: 1.5rem; }
.fr-view-cart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: .75rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--fr-blue);
    text-decoration: none;
    transition: color var(--fr-ease);
}
.fr-view-cart:hover { color: var(--fr-orange); }

/* ── Cart Icon ──────────────────────────────────────── */
.fr-cart-icon { position: relative; display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.fr-cart-count {
    position: absolute; top: -6px; right: -8px;
    background: var(--fr-orange); color: #fff;
    font-size: 10px; font-weight: 700;
    border-radius: 10px; padding: 1px 5px;
    min-width: 18px; text-align: center; line-height: 16px;
}

/* ======================================================
   NOTICE
   ====================================================== */
.fr-notice {
    border-radius: var(--fr-radius-card);
    padding: 14px 18px;
    font-size: .9rem;
    margin-bottom: 1.5rem;
}
.fr-notice--success { background:#e8f5e9; color:#2e7d32; border:1px solid #a5d6a7; }
.fr-notice--error   { background:#fce4ec; color:#c62828; border:1px solid #ef9a9a; }

/* ======================================================
   ANFRAGE-LISTE  (/anfrage/)
   ====================================================== */
.fr-cart-page { padding: 2rem 0 4rem; }

.fr-cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--fr-gray-50);
    border-radius: var(--fr-radius-card);
    border: 1px solid var(--fr-gray-200);
}
.fr-cart-empty p { font-size: 1.1rem; color: var(--fr-gray-600); margin-bottom: 1.5rem; }

.fr-cart-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
.fr-cart-table thead th {
    padding: 12px 16px;
    font-size: 11px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--fr-gray-600);
    border-bottom: 2px solid var(--fr-gray-200);
    text-align: left;
}
.fr-cart-table tbody tr { border-bottom: 1px solid var(--fr-gray-200); transition: background var(--fr-ease); }
.fr-cart-table tbody tr:hover { background: var(--fr-gray-50); }
.fr-cart-table td { padding: 16px; vertical-align: middle; }

.fr-col-img { width: 80px; }
.fr-col-img img { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; border: 1px solid var(--fr-gray-200); }
.fr-col-name a { font-weight: 600; color: var(--fr-black); text-decoration: none; transition: color var(--fr-ease); display: block; margin-bottom: 3px; }
.fr-col-name a:hover { color: var(--fr-orange); }
.fr-sku { display: block; font-size: .8rem; color: var(--fr-gray-600); margin-top: 2px; }
.fr-col-price { font-weight: 600; color: var(--fr-black); white-space: nowrap; }
.fr-col-qty { width: 140px; }
.fr-col-remove { width: 48px; text-align: center; }

/* Qty — Theme-Klassen global (außerhalb .cart-form) */
.cd-qty {
    display: inline-flex;
    width: auto;
    min-width: 130px;
    max-width: 160px;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: visible;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
.cd-qty__btn {
    flex: 0 0 36px;
    width: 36px;
    min-width: 36px;
    background: #fff;
    color: var(--fr-black) !important;
    font-size: 18px !important;
    line-height: 1 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: all .2s ease;
    flex-shrink: 0;
    overflow: visible;
}
.cd-qty__btn::before,
.cd-qty__btn::after { display: none !important; content: none !important; }
.cd-qty__btn--plus,
.cd-qty__btn--minus {
    color: var(--fr-black) !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.cd-qty__btn--minus { border-radius: 8px 0 0 8px; border-right: 1px solid #ccc; }
.cd-qty__btn--plus  { border-radius: 0 8px 8px 0; border-left:  1px solid #ccc; }
.cd-qty__btn:hover,
.cd-qty__btn--plus:hover,
.cd-qty__btn--minus:hover {
    background: var(--fr-blue) !important;
    color: #fff !important;
}
.cd-qty__input {
    flex: 1;
    min-width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    padding: 8px 4px;
    outline: none;
    font-family: var(--fr-font);
    -moz-appearance: textfield;
}
.cd-qty__input::-webkit-inner-spin-button,
.cd-qty__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cd-qty__input {
    flex: 1;
    text-align: center;
    border: none;
    background: transparent;
    padding: 8px 6px;
    outline: none;
    font-family: var(--fr-font);
    -moz-appearance: textfield;
}
.cd-qty__input::-webkit-inner-spin-button,
.cd-qty__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.fr-remove-btn {
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid var(--fr-gray-200); background: transparent;
    color: var(--fr-gray-400); font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--fr-ease); line-height: 1; margin: 0 auto;
}
.fr-remove-btn:hover { background: #fce4ec; border-color: #ef9a9a; color: #c62828; }

.fr-cart-actions {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding-top: 1.5rem;
    border-top: 1px solid var(--fr-gray-200); flex-wrap: wrap;
}

/* ======================================================
   CHECKOUT  (/anfrage-abschicken/)
   ====================================================== */
.fr-checkout-page { padding: 2rem 0 4rem; }
.fr-checkout-grid {
    display: grid; grid-template-columns: 1fr 420px; gap: 2rem; align-items: start;
}
@media (max-width: 900px) {
    .fr-checkout-grid { grid-template-columns: 1fr; }
    .fr-checkout-summary { order: -1; }
}

.fr-login-hint {
    background: #e3f2fd; border-radius: var(--fr-radius-card);
    padding: 12px 16px; margin-bottom: 1.5rem; font-size: .9rem;
}
.fr-login-hint a { color: var(--fr-blue); font-weight: 600; }

.fr-checkout-form-wrap h3 { margin-bottom: 1.5rem; font-size: 1.2rem; color: var(--fr-black); }

.fr-form-row { margin-bottom: 1.25rem; }
.fr-form-row label { display: block; font-size: .85rem; font-weight: 600; color: var(--fr-black); margin-bottom: .4rem; letter-spacing: .02em; }
.fr-form-row .req { color: var(--fr-orange); }
.fr-form-row input,
.fr-form-row textarea {
    width: 100%; padding: 11px 16px;
    border: 1px solid var(--fr-gray-200); border-radius: var(--fr-radius-inp);
    font-family: var(--fr-font); font-size: .95rem; color: var(--fr-black);
    background: var(--fr-white); transition: border-color var(--fr-ease), box-shadow var(--fr-ease);
    box-sizing: border-box; outline: none;
}
.fr-form-row input:focus,
.fr-form-row textarea:focus { border-color: var(--fr-orange); box-shadow: 0 0 0 3px rgba(231,78,17,.1); }
.fr-form-row textarea { resize: vertical; min-height: 80px; }

.fr-form-submit { margin-top: 2rem; }
.fr-submit-btn {
    width: 100%; padding: 14px 28px;
    background: var(--fr-orange); color: #fff; border: none;
    border-radius: var(--fr-radius-btn); font-family: var(--fr-font);
    font-size: .95rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    cursor: pointer; transition: background var(--fr-ease), transform var(--fr-ease);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.fr-submit-btn:hover:not(:disabled) { background: var(--fr-black); transform: translateY(-1px); }
.fr-submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.fr-submit-note { text-align: center; font-size: .8rem; color: var(--fr-gray-600); margin-top: .75rem; }

.fr-btn-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: fr-spin .7s linear infinite;
}
@keyframes fr-spin { to { transform: rotate(360deg); } }

/* Summary */
.fr-checkout-summary {
    background: var(--fr-gray-50); border: 1px solid var(--fr-gray-200);
    border-radius: var(--fr-radius-card); padding: 1.5rem;
    position: sticky; top: 120px;
}
.fr-checkout-summary h3 {
    font-size: .95rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--fr-black);
    margin-bottom: 1rem; padding-bottom: .75rem;
    border-bottom: 2px solid var(--fr-gray-200);
}
.fr-summary-table { width: 100%; border-collapse: collapse; }
.fr-summary-table tr { border-bottom: 1px solid var(--fr-gray-200); }
.fr-summary-table td { padding: 10px 4px; font-size: .9rem; vertical-align: middle; }
.fr-sum-name { color: var(--fr-black); font-weight: 500; width: 55%; }
.fr-sum-name small { color: var(--fr-gray-600); font-size: .78rem; }
.fr-sum-qty { text-align: center; color: var(--fr-gray-600); font-size: .85rem; }
.fr-sum-price { text-align: right; font-weight: 600; white-space: nowrap; }
.fr-sum-freight td { font-size: .85rem; color: var(--fr-gray-600); padding-top: 12px; }
.fr-sum-note { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--fr-gray-200); }
.fr-sum-note a { font-size: .85rem; color: var(--fr-blue); text-decoration: none; font-weight: 600; }
.fr-sum-note a:hover { color: var(--fr-orange); }

/* ======================================================
   ACCOUNT – Anfragen-Liste
   ====================================================== */
.fr-account-list { padding-top: .5rem; }

@media (min-width: 681px) {
    .fr-account-table { width: 100%; border-collapse: collapse; }
    .fr-account-table thead th {
        padding: 10px 14px; font-size: 11px; font-weight: 700;
        text-transform: uppercase; letter-spacing: .07em; color: var(--fr-gray-600);
        border-bottom: 2px solid var(--fr-gray-200); text-align: left;
    }
    .fr-account-table tbody tr { border-bottom: 1px solid var(--fr-gray-200); transition: background var(--fr-ease); }
    .fr-account-table tbody tr:hover { background: var(--fr-gray-50); }
    .fr-account-table td { padding: 14px; vertical-align: middle; font-size: .9rem; }
}

@media (max-width: 680px) {
    .fr-account-table thead { display: none; }
    .fr-account-table,
    .fr-account-table tbody,
    .fr-account-table tr,
    .fr-account-table td { display: block; width: 100%; }
    .fr-account-table tr {
        border: 1px solid var(--fr-gray-200); border-radius: var(--fr-radius-card);
        margin-bottom: 1rem; padding: 1rem; box-sizing: border-box;
    }
    .fr-account-table td { padding: 4px 0; border: none; font-size: .9rem; }
    .fr-account-table td::before {
        content: attr(data-label) ': ';
        font-weight: 700; font-size: .75rem; text-transform: uppercase;
        letter-spacing: .05em; color: var(--fr-gray-600);
        display: inline-block; margin-right: 6px;
    }
}

.fr-id-link { font-weight: 700; color: var(--fr-orange); text-decoration: none; font-size: 1rem; }
.fr-id-link:hover { color: var(--fr-black); }
.fr-action-cell { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ======================================================
   ACCOUNT – Anfrage-Detail
   ====================================================== */
.fr-account-detail { padding-top: .5rem; }
.fr-back-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .875rem; font-weight: 600; color: var(--fr-blue);
    text-decoration: none; margin-bottom: 1.5rem; transition: color var(--fr-ease);
}
.fr-back-link:hover { color: var(--fr-orange); }

.fr-detail-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.fr-detail-header h3 { font-size: 1.5rem; margin: 0; color: var(--fr-black); }

.fr-detail-meta {
    width: 100%; border-collapse: collapse; margin-bottom: 2rem;
    background: var(--fr-gray-50); border: 1px solid var(--fr-gray-200);
    border-radius: var(--fr-radius-card); overflow: hidden;
}
.fr-detail-meta tr { border-bottom: 1px solid var(--fr-gray-200); }
.fr-detail-meta tr:last-child { border-bottom: none; }
.fr-detail-meta th {
    padding: 12px 20px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em; color: var(--fr-gray-600);
    background: var(--fr-gray-100); width: 160px; vertical-align: top;
}
.fr-detail-meta td { padding: 12px 20px; font-size: .9rem; color: var(--fr-black); }

.fr-account-detail h4 {
    font-size: .85rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--fr-black); margin: 0 0 1rem;
}
.fr-detail-items {
    width: 100%; border-collapse: collapse;
    border: 1px solid var(--fr-gray-200); border-radius: var(--fr-radius-card);
    overflow: hidden; margin-bottom: 2rem;
}
.fr-detail-items thead th {
    padding: 10px 16px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em; color: var(--fr-gray-600);
    background: var(--fr-gray-100); border-bottom: 1px solid var(--fr-gray-200); text-align: left;
}
.fr-detail-items tbody td {
    padding: 14px 16px; border-bottom: 1px solid var(--fr-gray-200);
    font-size: .9rem; vertical-align: middle;
}
.fr-detail-items tbody tr:last-child td { border-bottom: none; }
.fr-detail-items tfoot th,
.fr-detail-items tfoot td {
    padding: 12px 16px; background: var(--fr-gray-50);
    border-top: 2px solid var(--fr-gray-200); font-weight: 700; font-size: .95rem;
}
.fr-total-row td { text-align: right; color: var(--fr-orange); }

.fr-accept-offer {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fff9f1 0%, #f4e4d2 52%, #e7c6a2 100%);
    border: 1px solid #e5bf97;
    border-radius: var(--fr-radius-card);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 18px 40px rgba(114, 68, 27, 0.10);
}
.fr-accept-offer::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(180deg, #f28c28 0%, #c96a16 100%);
}
.fr-accept-offer p {
    margin-bottom: 1rem;
    font-size: .95rem;
    color: var(--fr-black);
    max-width: 680px;
}
.fr-accept-offer .button.button--filled.button--secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 24px;
    border-radius: 999px;
    border: 0;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(201, 106, 22, 0.18);
}

/* Mobile cart table */
@media (max-width: 680px) {
    .fr-cart-table thead { display: none; }
    .fr-cart-table, .fr-cart-table tbody, .fr-cart-table tr { display: block; }
    .fr-cart-table tr {
        display: flex; flex-wrap: wrap; align-items: center;
        gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--fr-gray-200);
    }
    .fr-cart-table td { padding: 0; border: none; }
    .fr-col-name { flex: 1 1 60%; }
    .fr-col-price { flex: 1 1 auto; font-size: .85rem; }
    .fr-col-qty { flex: 0 0 auto; }
    .fr-col-remove { flex: 0 0 auto; }
    .fr-cart-actions { flex-direction: column; align-items: stretch; }
    .fr-cart-actions .button { text-align: center; width: 100%; box-sizing: border-box; }
}

/* ── FR Quote: Versandmethoden-Fehlermeldung ausblenden ─── */
.fr-quote-active .woocommerce-shipping-destination,
.fr-quote-active .woocommerce-no-shipping-available-html,
.fr-quote-active p.woocommerce-shipping-contents span {
    display: none !important;
}
.fr-quote-active .shipping ul#shipping_method {
    display: none !important;
}

/* ── Checkout Pflichtfeld-Validierung ────────────────────── */
.fr-input-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}
.fr-field-error {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #dc3545;
    font-weight: 500;
}

/* Hinweistext über dem Anfrage-Button */
.fr-hint-text {
    margin-bottom: 0.75rem;
    font-size: 0.9em;
    color: #555;
    line-height: 1.5;
}
