/* Assure Fuel Core - Complete & Responsive Styles */

:root {
    --primary-blue: #001F3F;       /* Navy */
    --secondary-blue: #4169E1;     /* Royal Blue */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --border-gray: #e0e0e0;
    --text-dark: #333333;
    --text-muted: #718096;
    --success: #27ae60;
    --error: #e74c3c;
}

/* =========================================
   1. GLOBAL CONTAINERS
   ========================================= */
.assure-container, .af-order-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

/* =========================================
   2. MODERN DIESEL ORDER FORM (The New Design)
   ========================================= */

/* Main Card */
.af-order-card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-gray);
    margin-bottom: 30px;
}

/* Header Section */
.af-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--light-gray);
}

.af-header-icon {
    font-size: 26px;
    background: #eff2ff;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--secondary-blue);
}

.af-header-text h2 {
    margin: 0;
    font-size: 20px;
    color: var(--primary-blue);
    font-weight: 700;
}

.af-header-text span {
    font-size: 13px;
    color: var(--text-muted);
}

/* Grid System */
.af-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Form Elements */
.af-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

/* Crucial: Allows Delivery Notes to span full width */
.af-form-group.full-width {
    grid-column: span 2;
}

.af-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.af-label .required { color: var(--error); margin-left: 2px; }

.af-select-wrapper, .af-input-box { position: relative; }

/* Unified Input Styling (Text, Date, Time, Select, Textarea) */
.af-select-wrapper select, 
.af-input-box input,
.af-input-box textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid var(--border-gray);
    background: #fff;
    font-size: 15px;
    color: var(--text-dark);
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.af-input-box textarea {
    resize: vertical;
    min-height: 80px;
}

.af-select-wrapper select:focus, 
.af-input-box input:focus,
.af-input-box textarea:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

/* Icons & Helpers */
.af-select-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-muted);
    pointer-events: none;
}

.af-tiny-link {
    font-size: 12px;
    color: var(--secondary-blue);
    text-decoration: none;
    margin-top: 5px;
    text-align: right;
    display: block;
    font-weight: 500;
}
.af-tiny-link:hover { text-decoration: underline; }

/* Tabs (Quantity Type) */
.af-toggle-container { margin-bottom: 25px; }

.af-segmented-control {
    background: var(--light-gray);
    padding: 5px;
    border-radius: 10px;
    display: flex;
}

.af-segment {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.af-segment.active {
    background: var(--white);
    color: var(--secondary-blue);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Big Input Highlight (Quantity) */
.af-input-highlight-wrapper { margin-bottom: 25px; }

.af-input-box input.highlight-input {
    padding-right: 50px;
    font-size: 20px;
    font-weight: 700;
    border-color: var(--secondary-blue);
    background: #fcfdff;
}

.af-input-suffix {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}

/* Receipt / Summary Box */
.af-receipt-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.af-receipt-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.af-receipt-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 12px 0;
}

.af-receipt-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-blue);
}

.af-receipt-total span:last-child {
    color: var(--secondary-blue);
    font-size: 20px;
}

/* Buttons */
.af-submit-btn {
    width: 100%;
    background: var(--secondary-blue);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(65, 105, 225, 0.2);
}

.af-submit-btn:hover {
    background: #3b36b3;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(65, 105, 225, 0.3);
}

.af-submit-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =========================================
   3. UTILITIES & LEGACY SUPPORT
   ========================================= */

/* Messages */
.assure-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    line-height: 1.5;
}
.assure-message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.assure-message.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Spinner */
.assure-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Hide WC Defaults */
.product-type-variable .variations,
.product-type-variable .quantity {
    display: none !important;
}

/* =========================================
   4. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 600px) {
    .assure-container, .af-order-container {
        padding: 15px;
    }

    .af-order-card {
        padding: 20px;
    }

    /* Stack grid items vertically on mobile */
    .af-grid-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .af-form-group.full-width {
        grid-column: span 1;
    }

    .af-card-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}