/* === CSS Variables === */
:root {
    --md-border-color: #e5e7eb;
    --md-border-hover: #d1d5db;
    --md-border-radius: 0.75rem;
    --md-border-radius-sm: 0.5rem;
    --md-spacing: 1.5rem;
    --md-spacing-sm: 1rem;
    --md-text-primary: #111827;
    --md-text-secondary: #374151;
    --md-text-muted: #6b7280;
    --md-text-light: #9ca3af;
    --md-bg-primary: white;
    --md-bg-secondary: #f9fafb;
    --md-green: #059669;
    --md-green-dark: #047857;
    --md-cyan: #06b6d4;
    --md-font-size-base: 0.9375rem;
    --md-font-size-sm: 0.875rem;
    --md-font-size-lg: 1.2rem;
    --md-font-size-xl: 1.5rem;
    --md-font-size-2xl: 2.0rem;
    --md-font-size-3xl: 2.5rem;
}

/* === Container === */
.md-donation-wrapper {
    min-height: 100vh;
}

.md-donation-container {
    margin: 0 auto;
    background: var(--md-bg-primary);
    border-radius: var(--md-border-radius-sm);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--md-border-color);
}

/* === Header === */
.md-header {
    border-bottom: 1px solid var(--md-border-color);
    padding: var(--md-spacing) var(--md-spacing) 1.25rem;
}

.md-header h1 {
    font-size: var(--md-font-size-3xl);
    font-weight: 600;
    color: var(--md-text-primary);
    margin: 0 0 0.25rem 0;
}

.md-header p {
    font-size: var(--md-font-size-sm);
    color: var(--md-text-muted);
    margin: 0;
}

/* === Items Grid === */
.md-items-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.md-item-card {
    border: 1px solid var(--md-border-color);
    border-radius: var(--md-border-radius-sm);
    padding: var(--md-spacing-sm);
    transition: border-color 0.2s;
}

.md-item-card:hover {
    border-color: var(--md-border-hover);
}

.md-item-header {
    margin-bottom: 0.75rem;
}

.md-item-info {
    width: 100%;
}

.md-item-info h3 {
    font-size: var(--md-font-size-xl);
    font-weight: 500;
    color: var(--md-text-primary);
    margin: 0 0 0.125rem 0;
}

.md-item-info p {
    font-size: var(--md-font-size-lg);
    color: var(--md-text-muted);
    margin: 0;
}

.md-item-price {
    font-size: var(--md-font-size-2xl);
    font-weight: 700;
    color: var(--md-green);
    white-space: nowrap;
    margin-left: auto;
}

/* === Controls === */
.md-item-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.md-qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #1A1A1A;
    border-radius: 30%;
    background-color: transparent;
    color: #3B3B3B;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 300ms cubic-bezier(.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 !important;
    margin: 0 !important;
}

.md-qty-btn:hover:not(:disabled) {
    color: white;
    background-color: #1A1A1A;
    box-shadow: rgba(0, 0, 0, 0.25) 0 8px 15px;
    transform: translateY(-2px);
}

.md-qty-btn:active:not(:disabled) {
    box-shadow: none;
    transform: translateY(0);
}

.md-qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #ccc;
}

.md-qty-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 22px;
}

/* === Summary === */
.md-summary-section {
    border-top: 1px solid var(--md-border-color);
    padding: var(--md-spacing);
    background: var(--md-bg-secondary);
}

.md-receipt {
    background: var(--md-bg-primary);
    border-radius: var(--md-border-radius-sm);
    border: 1px solid var(--md-border-color);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.md-receipt-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-size: var(--md-font-size-lg);
}

.md-receipt-item .label {
    color: var(--md-text-secondary);
}

.md-receipt-item .amount {
    font-weight: 500;
    color: var(--md-text-primary);
}

.md-receipt-item.total {
    border-top: 2px solid var(--md-border-color);
    padding-top: var(--md-spacing-sm);
    margin-top: 0.5rem;
}

.md-receipt-item.total .label {
    font-weight: 600;
    color: var(--md-text-primary);
}

.md-receipt-item.total .amount {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--md-green);
}

.md-empty {
    text-align: center;
    color: var(--md-text-light);
    font-size: var(--md-font-size-sm);
    padding: 2rem 1.25rem;
    margin-bottom: 1.25rem;
}

/* === Form === */
.md-form {
    display: flex;
    flex-direction: column;
    gap: var(--md-spacing-sm);
}

.md-form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--md-text-secondary);
    font-size: var(--md-font-size-base);
}

.md-form-group input,
.md-form-group textarea,
.md-open-amount {
    width: 100%;
    padding: 0.625rem 0.75rem !important;
    margin: 0 !important;
    border: 2px solid var(--md-border-color);
    border-radius: var(--md-border-radius) !important;
    font-size: var(--md-font-size-base);
    transition: all 0.2s;
}

.md-form-group input:focus,
.md-form-group textarea:focus {
    outline: none;
    border-color: var(--md-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.md-form-group input.invalid,
.md-form-group textarea.invalid {
    border-color: #ef4444;
}

.md-form-group input.invalid:focus,
.md-form-group textarea.invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.md-open-amount {
    text-align: center;
    font-size: var(--md-font-size-2xl);
    font-weight: 600;
}

.md-open-amount:focus {
    outline: none;
    border-color: var(--md-green);
}

.md-open-amount::-webkit-inner-spin-button,
.md-open-amount::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.md-form-group textarea {
    font-family: inherit;
    resize: vertical;
}

.md-submit-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--md-green);
    color: white;
    border: none;
    border-radius: var(--md-border-radius);
    font-size: var(--md-font-size-2xl);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 0.25rem;
}

.md-submit-btn:hover:not(:disabled) {
    background: var(--md-green-dark);
}

.md-submit-btn:disabled,
.md-submit-btn.loading {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Responsive === */
@media (max-width: 640px) {
    .md-form-group input {
        font-size: 16px;
    }
}

@media (min-width: 768px) {
    .md-item-card {
        display: flex;
        align-items: center;
        gap: var(--md-spacing);
    }
    
    .md-item-header {
        flex: 1;
        margin-bottom: 0;
    }
    
    .md-item-controls {
        flex-shrink: 0;
        width: 320px;
    }
    
    .md-open-amount {
        width: 320px;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 8px !important;
    }

    .md-header-with-image {
        display: flex;
        gap: 1.5rem;
        align-items: flex-start;
    }
    .md-header-content { flex: 1; min-width: 0; }
    .md-header-image { flex-shrink: 0; width: 180px; }
    .md-header-image img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        border-radius: 0.75rem;
        display: block;
    }
}

/* === HEADER TEKST === */
.md-header-text { font-size: 0.9rem; color: #374151; line-height: 1.6; }
.md-header-text p { margin: 0 0 0.75rem; }
.md-header-text p:last-child { margin-bottom: 0; }

@media (max-width: 560px) {
    .md-header-with-image { flex-direction: column; }
    .md-header-image { width: 100%; }
    .md-header-image img { height: 200px; }
}

/* === AANDELEN CARD === */
.md-shares-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.md-shares-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.md-shares-card-title { font-weight: 700; font-size: 1rem; color: #111827; }
.md-shares-card-price { font-size: 0.875rem; color: #6b7280; }

.md-shares-picker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.md-shares-btn {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: white;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #374151;
    flex-shrink: 0;
}
.md-shares-btn:hover:not(:disabled) {
    border-color: #059669;
    color: #059669;
    background: #f0fdf4;
}
.md-shares-btn:disabled { opacity: 0.35; cursor: default; }

#md-shares-input {
    width: 4rem;
    height: 2.75rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #111827;
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 0 !important;
}
#md-shares-input::-webkit-outer-spin-button,
#md-shares-input::-webkit-inner-spin-button { -webkit-appearance: none; }
#md-shares-input:focus { outline: none; border-color: #059669; }

.md-shares-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #374151;
}
.md-shares-total-row strong { font-size: 1.25rem; color: #059669; }

.md-shares-availability { margin-top: 0.75rem; }
.md-shares-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.md-shares-bar-fill { height: 100%; background: #059669; border-radius: 999px; }
.md-shares-availability span { font-size: 0.8rem; color: #6b7280; }

@media (max-width: 480px) {
    .md-shares-card { padding: 1rem; }
    .md-shares-picker { gap: 0.5rem; }
    .md-shares-btn { width: 2.25rem; height: 2.25rem; font-size: 1.1rem; }
    #md-shares-input { width: 3.5rem; font-size: 1.25rem; }
}

/* === FORM SECTION === */
.md-form-section { margin-bottom: 0.5rem; }
.md-optional { font-size: 0.75rem; color: #9ca3af; font-weight: 400; margin-left: 0.25rem; }

/* === OPT-INS === */
.md-optins-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.25rem 1rem;
    margin-bottom: 1.25rem;
}
.md-optin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.md-optin-row:last-of-type { border-bottom: none; }
.md-optin-expertise { flex-wrap: wrap; }
.md-optin-text { display: flex; flex-direction: column; gap: 0.15rem; padding-right: 1rem; }
.md-optin-label { font-size: 0.9rem; font-weight: 600; color: #111827; }
.md-optin-desc { font-size: 0.78rem; color: #6b7280; }

@media (max-width: 480px) {
    .md-optin-row { align-items: flex-start; gap: 0.5rem; }
    .md-optin-text { padding-right: 0.5rem; }
}

/* Toggle switch */
.md-toggle { position: relative; display: inline-block; width: 2.75rem; height: 1.5rem; flex-shrink: 0; }
.md-toggle input { opacity: 0; width: 0; height: 0; }
.md-toggle-slider {
    position: absolute; inset: 0;
    background: #d1d5db;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s;
}
.md-toggle-slider:before {
    content: '';
    position: absolute;
    width: 1.1rem; height: 1.1rem;
    left: 0.2rem; top: 0.2rem;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.md-toggle input:checked + .md-toggle-slider { background: #059669; }
.md-toggle input:checked + .md-toggle-slider:before { transform: translateX(1.25rem); }


/* === TABS === */
.md-shares-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    background: #f1f5f9;
    border-radius: 0.5rem;
    padding: 0.25rem;
}
.md-shares-tab {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}
.md-shares-tab small { font-weight: 400; font-size: 0.75rem; }
.md-shares-tab.active { background: white; color: #111827; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* === VRIJ BEDRAG === */
.md-free-amount-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.md-free-euro {
    padding: 0.75rem 0.875rem;
    background: #f8fafc;
    border-right: 2px solid #e2e8f0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
}
#md-free-input {
    flex: 1;
    border: none;
    padding: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    -moz-appearance: textfield;
    appearance: textfield;
}
#md-free-input::-webkit-outer-spin-button,
#md-free-input::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; }
#md-free-input:focus { outline: none; }
.md-free-amount-wrapper:focus-within { border-color: #059669; }
.md-free-hint { font-size: 0.8rem; margin: 0; min-height: 1.2rem; }

/* Vrij bedrag inline */
.md-shares-section-label { font-size: 0.82rem; font-weight: 600; color: #6b7280; margin-bottom: 0.5rem; }
.md-shares-section-label small { font-weight: 400; }
.md-shares-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0; color: #9ca3af; font-size: 0.8rem; }
.md-shares-divider::before, .md-shares-divider::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }
.md-free-section { margin-top: 0; }
.md-shares-btn-five { background: #f3f4f6; color: #374151; font-size: 0.85rem; }
.md-shares-btn-five:hover:not(:disabled) { background: #e5e7eb; }

/* === CAMPAIGN OVERVIEW === */
/* === CAMPAIGN OVERVIEW === */
.md-overview-wrap {
    max-width: 820px;
    margin: 0 auto;
}

.md-overview-section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--md-text-muted);
    margin: 1.5rem 0 0.75rem;
}

.md-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 4px;
}

@media (max-width: 540px) {
    .md-overview-grid { grid-template-columns: 1fr; }
}

/* Cards */
.md-overview-card {
    background: white;
    border: 1.5px solid var(--md-border-color);
    border-radius: var(--md-border-radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: border-color .2s, transform .15s;
    position: relative;
}

.md-overview-card:hover {
    border-color: var(--md-border-hover);
    transform: translateY(-2px);
}

.md-overview-card.selected {
    border: 2px solid #E07020;
}

.md-overview-card--featured.selected,
.md-overview-card.selected {
    border: 2px solid #E07020;
}

.md-overview-badge {
    display: inline-block;
    background: #FFF0E0;
    color: #994D00;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.md-overview-icon {
    display: block;
    font-size: 22px;
    margin-bottom: 6px;
}

.md-overview-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--md-text-primary);
    margin: 0 0 4px;
}

.md-overview-desc {
    font-size: 13px;
    color: var(--md-text-muted);
    line-height: 1.5;
    margin: 0 0 10px;
}

/* Wide cards (regulier / algemeen) */
.md-overview-grid--wide .md-overview-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.md-overview-grid--wide .md-overview-desc {
    margin-bottom: 0;
}

/* Progress */
.md-overview-progress-track {
    background: var(--md-bg-secondary);
    border-radius: 4px;
    height: 5px;
    margin-bottom: 5px;
}

.md-overview-progress-fill {
    background: #E07020;
    border-radius: 4px;
    height: 5px;
}

.md-overview-progress-label {
    font-size: 12px;
    color: var(--md-text-muted);
    margin: 0;
}

.md-overview-progress-label strong {
    color: #E07020;
}

/* Preset bedragen */
.md-preset-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}

.md-preset-btn {
    padding: 8px 16px;
    border: 1.5px solid var(--md-border-color);
    border-radius: var(--md-border-radius-sm);
    background: var(--md-bg-secondary);
    color: var(--md-text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all .15s;
}

.md-preset-btn:hover {
    border-color: #E07020;
    color: #E07020;
}

.md-preset-btn.active {
    border-color: #E07020;
    background: #FFF8F2;
    color: #E07020;
    font-weight: 500;
}

.md-overview-back {
    margin-bottom: 1rem;
}
.md-overview-back a {
    font-size: 14px;
    color: var(--md-text-muted);
    text-decoration: none;
}
.md-overview-back a:hover {
    color: var(--md-text-primary);
}

/* === KURBAN NAMEN === */
.md-kurban-section {
    background: var(--md-bg-primary);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem 1.25rem 1.25rem;
    margin-bottom: 0.5rem;
}

.md-kurban-section-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--md-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.875rem;
}

.md-kurban-name-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.md-kurban-name-row:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.md-kurban-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--md-text-muted);
}

.md-kurban-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.md-kurban-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--md-border-color);
    border-radius: var(--md-border-radius-sm);
    font-size: var(--md-font-size-base);
    transition: border-color 0.2s;
    color: var(--md-text-primary);
    min-width: 0;
}

.md-kurban-input:focus {
    outline: none;
    border-color: var(--md-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.md-kurban-input[readonly] {
    background: var(--md-bg-secondary);
    color: var(--md-text-secondary);
    border-color: var(--md-border-color);
}

.md-kurban-toggles {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

.md-kurban-toggle {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: 2px solid var(--md-border-color);
    border-radius: 50px;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--md-text-muted);
    white-space: nowrap;
}

.md-kurban-toggle:hover {
    border-color: var(--md-text-secondary);
    color: var(--md-text-secondary);
}

.md-kurban-toggle.active {
    background: var(--md-text-primary);
    border-color: var(--md-text-primary);
    color: white;
}

.md-kurban-add-btn {
    margin-top: 0.875rem;
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--md-border-color);
    border-radius: 50px;
    background: white;
    color: var(--md-text-secondary);
    font-size: var(--md-font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-block;
}

.md-kurban-add-btn:hover:not(:disabled) {
    border-color: var(--md-text-primary);
    color: var(--md-text-primary);
}

.md-kurban-add-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

@media (max-width: 560px) {
    .md-kurban-input-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .md-kurban-toggles {
        width: 100%;
    }

    .md-kurban-toggle {
        flex: 1;
        text-align: center;
    }
}