/* ─── Buyback Frontend Styles ─── */

/* Spot Banner */
.fh-spot-banner {
    display: flex;
    gap: 0;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}
.fh-spot-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    flex: 1;
    min-width: 180px;
    border-right: 1px solid #e0e0e0;
    background: #fff;
    text-align: center;
    justify-content: center;
}
.fh-spot-card:last-child { border-right: none; }
.fh-spot-icon { font-size: 24px; }
.fh-spot-info { display: flex; flex-direction: column; }
.fh-spot-label { font-weight: 700; color: #333; font-size: 14px; }
.fh-spot-price { font-size: 18px; font-weight: 700; color: #1a1a2e; }

/* Metal Tabs */
.fh-metal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}
.fh-metal-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    border-right: 1px solid #e0e0e0;
    transition: background 0.2s, color 0.2s;
}
.fh-metal-tab:last-child { border-right: none; }
.fh-metal-tab:hover { background: #f5f5f5; }
.fh-metal-tab.active {
    background: #1a1a2e;
    color: #fff;
}

/* Search Bar */
.fh-search-bar {
    display: flex;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}
.fh-search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    font-size: 15px;
    outline: none;
}
.fh-search-btn {
    padding: 12px 20px;
    background: #4caf50;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}
.fh-search-btn:hover { background: #43a047; }

/* Listing Controls */
.fh-listing-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}
.fh-listing-controls label { font-weight: 600; margin-right: 5px; }
.fh-listing-controls select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Contact Notice */
.fh-contact-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
}
.fh-contact-notice p { margin: 0; }
.fh-scroll-to-form {
    color: #1a1a2e;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* Products Table */
.fh-products-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.fh-products-table thead th {
    background: #1a1a2e;
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}
.fh-products-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}
.fh-products-table tbody tr:hover { background: #f9f9f9; }
.fh-products-table td { padding: 12px 16px; vertical-align: middle; }

.fh-col-over { text-align: center; width: 150px; }
.fh-col-price { text-align: center; width: 140px; font-size: 16px; }
.fh-col-sell { text-align: center; width: 200px; }

.fh-product-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}
.fh-product-thumb {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #eee;
}

.fh-over-spot {
    font-weight: 700;
    font-size: 15px;
}
.fh-over-spot.negative { color: #d63638; }
.fh-over-spot.positive { color: #00a32a; }

/* Quantity Controls */
.fh-qty-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 8px;
}
.fh-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    transition: background 0.15s;
}
.fh-qty-btn:hover { background: #e0e0e0; }
.fh-qty-input {
    width: 40px;
    height: 30px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 14px;
    appearance: textfield;
    -moz-appearance: textfield;
}
.fh-qty-input::-webkit-outer-spin-button,
.fh-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fh-add-to-sell {
    padding: 6px 16px;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}
.fh-add-to-sell:hover { background: #43a047; }

.fh-no-products { text-align: center; padding: 40px; color: #999; }

/* Pagination */
.fh-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 20px 0;
}
.fh-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all 0.15s;
}
.fh-page-link:hover { background: #f5f5f5; }
.fh-page-link.active {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}
.fh-page-dots { padding: 0 8px; line-height: 36px; color: #999; }

/* Sell Cart */
.fh-sell-cart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    max-height: 400px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    overflow: hidden;
}
.fh-sell-cart h3 {
    margin: 0;
    padding: 15px 20px;
    background: #1a1a2e;
    color: #d4af37;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.fh-cart-toggle {
    background: none;
    border: none;
    color: #d4af37;
    cursor: pointer;
    font-size: 14px;
}
#fh-cart-items {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px 20px;
}
.fh-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}
.fh-cart-item:last-child { border-bottom: none; }
.fh-cart-item-name { flex: 1; }
.fh-cart-item-qty { color: #666; margin: 0 10px; }
.fh-cart-item-price { font-weight: 700; }
.fh-cart-item-remove {
    background: none;
    border: none;
    color: #d63638;
    cursor: pointer;
    font-size: 16px;
    margin-left: 8px;
    padding: 0 4px;
}
.fh-cart-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f8f9fa;
    font-size: 15px;
    border-top: 2px solid #1a1a2e;
}
#fh-proceed-sell {
    display: block;
    width: calc(100% - 40px);
    margin: 10px 20px 15px;
}

/* Form Section */
.fh-sell-form-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}
.fh-form-divider h2 {
    color: #1a1a2e;
    margin-bottom: 5px;
}
.fh-form-divider p { color: #666; margin-bottom: 20px; }

.fh-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}
.fh-form-full { grid-column: 1 / -1; }
.fh-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}
.fh-form-group label .required { color: #d63638; }
.fh-form-group input,
.fh-form-group textarea,
.fh-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.fh-form-group input:focus,
.fh-form-group textarea:focus {
    border-color: #1a1a2e;
    outline: none;
}
.fh-form-group input[readonly],
.fh-form-group textarea[readonly] {
    background: #f5f5f5;
    color: #666;
}

.fh-btn-primary {
    padding: 12px 30px;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.fh-btn-primary:hover { background: #43a047; }
.fh-btn-large { font-size: 16px; padding: 14px 40px; }

.fh-form-actions { text-align: center; }

.fh-form-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}
.fh-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.fh-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive — mobile grid layout */
@media (max-width: 768px) {
    .fh-spot-banner { flex-direction: column; }
    .fh-spot-card { border-right: none; border-bottom: 1px solid #e0e0e0; }
    .fh-metal-tabs { flex-wrap: wrap; }
    .fh-metal-tab { flex: none; width: 50%; }
    .fh-form-grid { grid-template-columns: 1fr; }
    .fh-sell-cart { width: calc(100% - 20px); right: 10px; bottom: 10px; }
    .fh-listing-controls { flex-direction: column; gap: 8px; }

    /* Hide table layout, show grid cards */
    .fh-products-table thead { display: none; }
    .fh-products-table,
    .fh-products-table tbody { display: block; width: 100%; }
    .fh-products-table tbody {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .fh-product-row {
        display: flex;
        flex-direction: column;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 12px;
        background: #fff;
    }
    .fh-product-row td { display: block; padding: 4px 0; border: none; }
    .fh-product-name-cell {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
    }
    .fh-product-thumb { width: 60px; height: 60px; }
    .fh-product-name-cell span { font-size: 12px; line-height: 1.3; }
    .fh-col-over { text-align: center; width: auto; font-size: 13px; }
    .fh-col-price { text-align: center; width: auto; font-size: 15px; }
    .fh-col-sell { text-align: center; width: auto; }
    .fh-qty-controls { margin-right: 0; margin-bottom: 6px; }
    .fh-add-to-sell { width: 100%; padding: 8px 0; font-size: 14px; }

    /* No-products row spans full grid */
    .fh-product-row:only-child,
    tr.fh-no-products-row {
        grid-column: 1 / -1;
    }
    .fh-no-products { text-align: center; }
}

/* ─── Hero Section ─── */
.fh-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 10px;
    padding: 40px 36px;
    margin-bottom: 24px;
    color: #fff;
}
.fh-hero-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.fh-hero-title {
    color: #d4af37;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.2;
}
.fh-hero-text {
    color: #ccc;
    font-size: 15px;
    line-height: 1.65;
    margin: 0 0 12px;
}
.fh-hero-text a { color: #d4af37; text-decoration: underline; }
.fh-hero-cta {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.fh-hero-phone-label { color: #999; font-size: 14px; }
.fh-hero-phone {
    display: inline-block;
    background: #d4af37;
    color: #1a1a2e;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.fh-hero-phone:hover { opacity: 0.9; }

/* ─── How It Works ─── */
.fh-hiw {
    margin-top: 48px;
    padding-top: 36px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
}
.fh-hiw-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 28px;
    letter-spacing: 1px;
}
.fh-hiw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.fh-hiw-step {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 28px 20px;
    position: relative;
}
.fh-hiw-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #1a1a2e;
    color: #d4af37;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 14px;
}
.fh-hiw-step h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}
.fh-hiw-step p {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* ─── Why Sell ─── */
.fh-why {
    margin-top: 40px;
    padding-top: 36px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    padding-bottom: 20px;
}
.fh-why-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 28px;
    letter-spacing: 1px;
}
.fh-why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.fh-why-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 24px 16px;
    transition: box-shadow 0.2s;
}
.fh-why-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.fh-why-icon { font-size: 32px; display: block; margin-bottom: 12px; }
.fh-why-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}
.fh-why-card p {
    font-size: 13px;
    color: #555;
    line-height: 1.55;
    margin: 0;
}

/* ─── Responsive: Hero + HIW + Why ─── */
@media (max-width: 768px) {
    .fh-hero { padding: 28px 20px; }
    .fh-hero-title { font-size: 22px; }
    .fh-hero-text { font-size: 14px; }
    .fh-hero-cta { flex-direction: column; }

    .fh-hiw-grid { grid-template-columns: 1fr; gap: 16px; }
    .fh-why-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .fh-why-card { padding: 18px 12px; }
}
