/* AMT Product Add-ons — Frontend Styles */
:root {
    --amt-accent: #dc0000;
    --amt-accent-hover: #b00000;
    --amt-text: #222;
    --amt-text-secondary: #555;
    --amt-text-muted: #888;
    --amt-bg: #fff;
    --amt-bg-alt: #f8f8f6;
    --amt-border: #e5e5e5;
    --amt-input-border: #ddd;
    --amt-success: #4caf50;
    --amt-warning: #ffa000;
    --amt-error: #e74c3c;
}

/* ── Form layout ─────────────────────────────────── */
.amt-order-form {
    max-width: 600px;
    margin: 1.5em 0;
}

.amt-field-group {
    margin-bottom: 1.4em;
}

.amt-field-label {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--amt-text);
    margin: 0 0 0.5em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.amt-required {
    color: var(--amt-error);
}

.amt-field-hint {
    font-size: 0.82em;
    color: var(--amt-text-muted);
    margin: 0.3em 0 0;
}

.amt-info-text {
    font-size: 0.9em;
    color: var(--amt-text-secondary);
    line-height: 1.5;
    margin: 0;
    padding: 0.7em 1em;
    background: var(--amt-bg-alt);
    border-left: 3px solid var(--amt-accent);
    border-radius: 3px;
}

/* ── Add-on cards ────────────────────────────────── */
.amt-addon-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.amt-checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.75em 1em;
    background: var(--amt-bg);
    border: 1px solid var(--amt-border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.amt-checkbox-card:hover {
    border-color: var(--amt-accent);
}

.amt-checkbox-card input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--amt-accent);
    cursor: pointer;
}

.amt-checkbox-card input[type="checkbox"]:checked ~ .amt-card-body {
    color: var(--amt-text);
}

.amt-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.amt-card-title {
    font-size: 0.92em;
    font-weight: 500;
    color: var(--amt-text);
}

.amt-card-stats {
    font-weight: 400;
    font-size: 0.88em;
    color: var(--amt-text-muted);
}

.amt-card-price {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--amt-accent);
    white-space: nowrap;
    margin-left: 0.5em;
}

/* ── Radio group ─────────────────────────────────── */
.amt-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

.amt-radio-label {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.6em 0.8em;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.12s;
}

.amt-radio-label:hover {
    background: var(--amt-bg-alt);
}

.amt-radio-label input[type="radio"] {
    flex-shrink: 0;
    accent-color: var(--amt-accent);
    cursor: pointer;
}

.amt-radio-label span {
    font-size: 0.92em;
    color: var(--amt-text);
}

/* ── Button group (year selector) ────────────────── */
.amt-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
}

.amt-btn-option {
    padding: 0.45em 1em;
    font-size: 0.88em;
    font-weight: 500;
    color: var(--amt-text);
    background: var(--amt-bg);
    border: 1px solid var(--amt-border);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.amt-btn-option:hover {
    border-color: var(--amt-accent);
    color: var(--amt-accent);
}

.amt-btn-option.active {
    background: var(--amt-accent);
    border-color: var(--amt-accent);
    color: #fff;
}

/* ── Inputs ──────────────────────────────────────── */
.amt-input,
.amt-textarea {
    display: block;
    width: 100%;
    padding: 0.6em 0.8em;
    font-size: 0.92em;
    font-family: inherit;
    color: var(--amt-text);
    background: var(--amt-bg);
    border: 1px solid var(--amt-input-border);
    border-radius: 4px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.amt-input:focus,
.amt-textarea:focus {
    outline: none;
    border-color: var(--amt-accent);
    box-shadow: 0 0 0 2px rgba(220, 0, 0, 0.12);
}

.amt-input.amt-invalid,
.amt-textarea.amt-invalid {
    border-color: var(--amt-error);
}

.amt-textarea {
    resize: vertical;
    min-height: 3em;
}

/* ── Price summary ───────────────────────────────── */
.amt-price-summary {
    background: var(--amt-bg-alt);
    border: 1px solid var(--amt-border);
    border-radius: 6px;
    padding: 1em 1.2em;
    margin-bottom: 1.2em;
}

.amt-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35em 0;
    font-size: 0.92em;
    color: var(--amt-text-secondary);
}

.amt-price-row.amt-price-total {
    border-top: 1px solid var(--amt-border);
    margin-top: 0.4em;
    padding-top: 0.6em;
    font-size: 1.05em;
    font-weight: 700;
    color: var(--amt-text);
}

.amt-price-value {
    font-weight: 600;
}

.amt-price-total .amt-price-value {
    color: var(--amt-accent);
    font-size: 1.1em;
}

/* ── Submit button ───────────────────────────────── */
.amt-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    width: 100%;
    padding: 0.85em 1.5em;
    font-size: 1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    background: var(--amt-accent);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.amt-submit-btn:hover {
    background: var(--amt-accent-hover);
}

.amt-submit-btn:active {
    transform: scale(0.98);
}

.amt-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinner */
.amt-submit-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: amt-spin 0.6s linear infinite;
}

.amt-submit-btn.amt-loading .amt-submit-text {
    /* keep visible but show spinner too */
}

.amt-submit-btn.amt-loading .amt-submit-spinner {
    display: inline-block;
}

@keyframes amt-spin {
    to { transform: rotate(360deg); }
}

/* ── Form messages ───────────────────────────────── */
.amt-form-message {
    margin-top: 0.8em;
    padding: 0;
    font-size: 0.9em;
    border-radius: 4px;
    text-align: center;
    transition: opacity 0.2s;
}

.amt-form-message:empty {
    display: none;
}

.amt-form-message.amt-msg-success {
    display: block;
    padding: 0.7em 1em;
    background: rgba(76, 175, 80, 0.1);
    color: var(--amt-success);
    border: 1px solid var(--amt-success);
}

.amt-form-message.amt-msg-error {
    display: block;
    padding: 0.7em 1em;
    background: rgba(231, 76, 60, 0.1);
    color: var(--amt-error);
    border: 1px solid var(--amt-error);
}

/* ── Hide default WooCommerce add-to-cart ────────── */
.single-product .product .single_add_to_cart_button,
.single-product .product form.cart {
    display: none;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 480px) {
    .amt-order-form {
        max-width: 100%;
    }

    .amt-checkbox-card {
        padding: 0.6em 0.75em;
    }

    .amt-card-title {
        font-size: 0.86em;
    }

    .amt-card-price {
        font-size: 0.82em;
    }

    .amt-btn-option {
        padding: 0.4em 0.75em;
        font-size: 0.82em;
    }

    .amt-price-summary {
        padding: 0.8em 1em;
    }
}

/* ── Alert boxes (flash method) ──────────────────── */
.amt-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6em;
    padding: 0.8em 1em;
    border-radius: 4px;
    font-size: 0.88em;
    line-height: 1.5;
    margin-top: 0.5em;
}

.amt-alert-icon {
    flex-shrink: 0;
    font-size: 1.1em;
    line-height: 1.3;
}

.amt-alert-warning {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 4px solid var(--amt-warning);
    color: #6d4c00;
}

.amt-alert-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-left: 4px solid var(--amt-success);
    color: #2e7d32;
}

.amt-alert-info {
    background: #f0f7ff;
    border: 1px solid #cce0ff;
    border-left: 4px solid #2196F3;
    color: #1565c0;
}

.amt-text-muted {
    color: var(--amt-text-muted);
    font-weight: 400;
    font-size: 0.85em;
}

/* ── Optional label ──────────────────────────────── */
.amt-optional {
    color: var(--amt-text-muted);
    font-weight: 400;
    font-size: 0.85em;
}
