/* 183 Food Club — Frontend Order Form */

.fc-order-form {
    max-width: 800px;
    margin: 0 auto;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    padding: 0 16px;
}

/* ---------- Sections ---------- */

.fc-section {
    padding: 24px 0;
    margin-bottom: 32px;
    border-bottom: 1px solid #e5e7eb;
}

.fc-section h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #111;
}

.fc-order-form [hidden] {
    display: none !important;
}

.fc-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.fc-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.fc-field-grid label,
.fc-order-form label[for="fc-group-id"] {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
}

.fc-field-grid input,
.fc-order-form select,
.fc-order-form textarea,
#fc-item-search {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    border: 2px solid #c7cbd1;
    border-radius: 7px;
    padding: 10px 12px;
    background: #fff;
    color: #111;
    font: inherit;
}

.fc-field-grid input:focus,
.fc-order-form select:focus,
.fc-order-form textarea:focus,
#fc-item-search:focus {
    border-color: #0073aa;
    outline: 3px solid rgba(0, 115, 170, 0.18);
}

.fc-items-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.fc-items-toolbar h3 {
    margin: 0;
}

.fc-search-label {
    width: min(320px, 100%);
}

.fc-table-scroll {
    overflow-x: auto;
}

.fc-payment-options {
    display: grid;
    gap: 12px;
}

.fc-payment-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
}

.fc-payment-option:has(input:checked) {
    border-color: #0073aa;
    background: #eff6ff;
}

.fc-payment-option input,
.fc-acknowledgement input {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    flex: 0 0 auto;
}

.fc-payment-option span {
    display: grid;
    gap: 4px;
}

.fc-payment-option small {
    color: #555;
    font-size: 14px;
    white-space: normal;
}

.fc-acknowledgement {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    font-weight: 600;
}

.fc-submit-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr minmax(220px, 320px);
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #d8dce1;
    box-shadow: 0 -6px 24px rgba(0,0,0,.08);
    border-radius: 10px 10px 0 0;
}

.fc-submit-bar > div {
    display: flex;
    gap: 14px;
    align-items: baseline;
}

#fc-sticky-total {
    font-size: 22px;
}

/* ---------- Cycle Header ---------- */

.fc-cycle-header {
    text-align: center;
    padding: 32px 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.fc-cycle-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #111;
}

.fc-deadline {
    font-size: 17px;
    color: #dc2626;
    margin: 4px 0;
}

.fc-pickup-date {
    font-size: 17px;
    color: #333;
    margin: 4px 0;
}

.fc-cycle-message {
    background: #fef9c3;
    border-left: 4px solid #f59e0b;
    padding: 16px 20px;
    margin-top: 20px;
    border-radius: 4px;
    text-align: left;
    font-size: 16px;
}

/* ---------- Featured Section ---------- */

.fc-featured-section {
    background: #fffbeb;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 24px !important;
}

.fc-featured-badge {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

/* ---------- Item Rows ---------- */

.fc-item-row {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
    gap: 12px;
}

.fc-item-row:last-child {
    border-bottom: none;
}

.fc-item-info {
    flex: 1;
    min-width: 0;
}

.fc-item-name {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #111;
}

.fc-item-details {
    display: block;
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

.fc-item-note {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #fff3cd;
    color: #7a4b00;
    font-size: 13px;
    font-weight: 700;
}

.fc-item-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.fc-item-price {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    min-width: 70px;
    text-align: right;
}

/* ---------- Quantity Controls ---------- */

.fc-qty-wrap {
    display: flex;
    align-items: center;
    gap: 0;
}

.fc-qty-btn {
    width: 40px;
    height: 44px;
    border: 2px solid #ccc;
    background: #f9fafb;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    padding: 0;
    line-height: 1;
}

.fc-qty-btn:hover {
    background: #e5e7eb;
    border-color: #999;
}

.fc-qty-btn:active {
    background: #d1d5db;
}

.fc-qty-minus {
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.fc-qty-plus {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.fc-qty-input {
    width: 56px;
    height: 44px;
    font-size: 18px;
    text-align: center;
    border: 2px solid #ccc;
    border-radius: 0;
    padding: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.fc-qty-input::-webkit-inner-spin-button,
.fc-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fc-qty-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
    z-index: 1;
    position: relative;
}

/* ---------- Category Headers ---------- */

.fc-category-header {
    font-size: 20px;
    font-weight: 700;
    margin: 32px 0 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #333;
    color: #111;
}

.fc-category-header:first-child {
    margin-top: 0;
}

/* ---------- Special Requests ---------- */

.fc-special-requests-section textarea {
    width: 100%;
    min-height: 100px;
    font-size: 16px;
    font-family: inherit;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 6px;
    resize: vertical;
    box-sizing: border-box;
}

.fc-special-requests-section textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.fc-helper-text {
    font-size: 14px;
    color: #666;
    margin-top: 6px;
}

/* ---------- Pickup Window ---------- */

.fc-required {
    color: #dc2626;
    font-weight: 700;
}

.fc-pickup-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fc-pickup-option {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 18px;
}

.fc-pickup-option:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.fc-pickup-option input[type="radio"] {
    width: 22px;
    height: 22px;
    margin: 0 14px 0 0;
    accent-color: #0073aa;
    cursor: pointer;
    flex-shrink: 0;
}

.fc-pickup-option input[type="radio"]:checked + .fc-pickup-label {
    font-weight: 600;
}

.fc-pickup-option:has(input:checked) {
    border-color: #0073aa;
    background: #eff6ff;
}

.fc-pickup-label {
    line-height: 1.3;
}

/* ---------- Order Summary ---------- */

.fc-summary-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 24px !important;
}

.fc-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.fc-summary-table th {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 2px solid #d1d5db;
    font-weight: 600;
    color: #555;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.fc-summary-table th:last-child,
.fc-summary-table td:last-child {
    text-align: right;
}

.fc-summary-table th:nth-child(2),
.fc-summary-table td:nth-child(2) {
    text-align: center;
}

.fc-summary-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e5e7eb;
}

.fc-subtotal-row td {
    font-size: 20px;
    font-weight: 700;
    padding-top: 14px;
    border-bottom: none;
    color: #111;
}

/* ---------- Buttons ---------- */

.fc-btn-primary {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    text-align: center;
    line-height: 1.3;
    font-family: inherit;
}

.fc-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.fc-btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.fc-btn-success {
    display: inline-block;
    background: #16a34a;
    color: #fff;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    text-align: center;
    line-height: 1.3;
    font-family: inherit;
}

.fc-btn-success:hover {
    background: #15803d;
    color: #fff;
}

.fc-btn-success:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.fc-btn-secondary {
    display: inline-block;
    background: #e5e7eb;
    color: #333;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    text-align: center;
    line-height: 1.3;
    font-family: inherit;
}

.fc-btn-secondary:hover {
    background: #d1d5db;
}

.fc-btn-lg {
    width: 100%;
    padding: 20px;
}

/* ---------- Form Error ---------- */

.fc-form-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 500;
}

/* ---------- Review Modal ---------- */

.fc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
}

.fc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.fc-modal-content {
    position: relative;
    background: #fff;
    max-width: 600px;
    margin: 40px auto;
    border-radius: 12px;
    padding: 32px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.fc-modal-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #111;
}

.fc-review-detail {
    font-size: 16px;
    margin: 12px 0;
    color: #333;
}

.fc-review-subtotal {
    font-size: 22px;
    font-weight: 700;
    margin: 20px 0;
    color: #111;
}

.fc-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

/* ---------- Confirmation ---------- */

.fc-confirmation-inner {
    text-align: center;
    padding: 40px 20px;
}

.fc-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 20px;
}

.fc-confirmation-inner h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #111;
}

.fc-order-number {
    font-size: 20px;
    margin: 8px 0 24px;
}

.fc-conf-detail {
    font-size: 16px;
    margin: 10px 0;
    text-align: center;
}

.fc-email-notice {
    margin-top: 32px;
    font-size: 16px;
    color: #555;
    font-style: italic;
}

.fc-existing-order .fc-summary-table {
    text-align: left;
    margin: 24px 0;
}

.fc-existing-order .fc-conf-detail {
    text-align: center;
    margin: 8px 0;
}

/* ---------- Login / No Cycle ---------- */

.fc-login-prompt,
.fc-no-cycle {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.fc-login-prompt h2,
.fc-no-cycle h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #111;
}

.fc-login-prompt p,
.fc-no-cycle p {
    font-size: 17px;
    color: #555;
    margin: 0 0 24px;
}

/* ---------- Loading Overlay ---------- */

.fc-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fc-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: fc-spin 0.8s linear infinite;
}

@keyframes fc-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Submit Section ---------- */

.fc-submit-section {
    border-bottom: none;
    padding-bottom: 40px;
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
    .fc-order-form {
        padding: 0 12px;
    }

    .fc-cycle-header h2 {
        font-size: 24px;
    }

    .fc-item-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .fc-field-grid {
        grid-template-columns: 1fr;
    }

    .fc-items-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .fc-submit-bar {
        grid-template-columns: 1fr;
    }

    .fc-item-actions {
        justify-content: space-between;
    }

    .fc-item-price {
        text-align: left;
    }

    .fc-qty-input {
        width: 48px;
    }

    .fc-modal-content {
        margin: 16px;
        padding: 24px 20px;
        border-radius: 8px;
    }

    .fc-summary-table th,
    .fc-summary-table td {
        padding: 8px 4px;
        font-size: 14px;
    }

    .fc-subtotal-row td {
        font-size: 18px;
    }

    .fc-btn-primary,
    .fc-btn-success,
    .fc-btn-secondary {
        width: 100%;
        text-align: center;
    }

    .fc-confirmation-inner {
        padding: 24px 12px;
    }
}
