* {
    box-sizing: border-box;
}

.donate-page {
    font-family: 'Inter', sans-serif;
    color: #16332C;
    background: #f5f8f6;
    min-height: 100vh;
}

.donate-page-grid {
    display: grid;
    /* CHANGED: minmax() instead of a fixed 300px. A fixed px track can
       still get squeezed by browser layout quirks (as seen in testing,
       where the sidebar rendered far narrower than 300px). minmax()
       gives it a hard floor (240px) it can never shrink below, while
       still capping at 300px on wide screens. */
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    align-items: start;
    min-height: 100vh;
    gap: 0;
}

.cause-sidebar {
    padding: 1.5rem;
    width: 100%;
    min-width: 0; /* CHANGED: prevents the sidebar column from overflowing its
                     300px track when the image/tier text is wider than expected */
}

.cause-card-sidebar {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(31, 56, 50, 0.08);
    overflow: hidden;
    position: sticky;
    top: 1.5rem;
    width: 100%;
}

.cause-card-image {
    width: 100%;
    /* CHANGED: aspect-ratio instead of a fixed px height, so the image
       scales proportionally at every viewport width instead of staying
       200px tall even when the card itself has shrunk. */
    aspect-ratio: 16 / 10;
    height: auto;
    object-fit: cover;
    display: block;
}

.cause-card-body {
    padding: 1.4rem;
}

.cause-card-body h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #16332C;
    line-height: 1.35;
    margin: 0 0 0.7rem;
}

.cause-card-body .cause-desc {
    font-size: 0.85rem;
    line-height: 1.55;
    color: #6b7a73;
    margin: 0 0 1.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cause-tier-list {
    border-top: 1px solid #eef2ef;
    padding-top: 0.9rem;
    margin-bottom: 0.4rem;
}

.cause-tier-row {
    /* CHANGED: was a single-line flex row (label ... amount). At the
       sidebar's actual width, longer labels like "Food Donation x 10"
       don't fit next to "₹500" on one line — the row would wrap, but
       mid-word, causing the amount to visually collide with the
       wrapped label instead of moving cleanly to its own line.
       Stacking label/amount vertically removes the ambiguity entirely. */
   display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    font-size: 0.88rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}

.cause-tier-row:hover {
    background: #f5f8f6;
}

.cause-tier-row .tier-label {
    color: #44544d;
    line-height: 1.3;
}

.cause-tier-row .tier-amount {
    font-weight: 700;
    color: #16332C;
    font-size: 0.95rem;
}

.cause-more-options {
    font-size: 0.8rem;
    color: #9aa8a1;
    margin: 0.2rem 0 1.1rem;
    cursor: pointer;
}

.cause-more-options:hover {
    color: #1b5e20;
}

.choose-package-btn {
    display: block;
    width: 100%;
    background: #fff;
    color: #F5A623;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.8rem 0.5rem;
    border: 2px solid #F5A623;
    border-radius: 30px;
    cursor: pointer;
    white-space: nowrap; /* CHANGED: "Donate Now" wrapping onto two lines
                             inside a narrow container was what made the
                             pill collapse into a circle — this guarantees
                             it always renders on one line. */
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s, color 0.2s;
}

.choose-package-btn:hover {
    background: #F5A623;
    color: #fff;
}


.donate-main {
    min-height: 100vh;
    background: #fff;
    min-width: 0; /* CHANGED: grid children default to min-width:auto, which
                     can force the main column wider than its track and
                     silently break the whole grid's responsiveness */
}

.donate-main-hero {
    background: #16332C;
    padding: 2.6rem 4vw 2.2rem;
    text-align: center;
}

.donate-main-hero h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.4vw, 2.4rem);
    color: #fff;
    margin: 0 0 0.5rem;
}

.donate-main-hero p {
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.donate-form-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.6rem 4vw 4rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.6rem;
    margin-bottom: 1.4rem;
}

.form-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #16332C;
    margin-bottom: 0.5rem;
}

.form-field label .req {
    color: #c0392b;
}

.form-field input,
.form-field select {
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 0.94rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid #dde5e1;
    border-radius: 12px;
    background: #fff;
    color: #16332C;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #91b39a;
    box-shadow: 0 0 0 3px rgba(145, 179, 154, 0.2);
}

.form-field.full {
    margin-bottom: 1.4rem;
}

.field-divider {
    border: none;
    border-top: 1px solid #eef2ef;
    margin: 0.4rem 0 1.6rem;
}


.amount-section label.section-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #16332C;
    margin-bottom: 0.9rem;
}

.amount-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.amount-preset-btn {
    background: #fff;
    border: 1.5px solid #dde5e1;
    border-radius: 30px;
    padding: 0.85rem 0.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #16332C;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.amount-preset-btn:hover {
    border-color: #91b39a;
}

.amount-preset-btn.active {
    border-color: #F5A623;
    background: #fff8ec;
    color: #b97300;
}

.amount-stepper {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    gap: 0.7rem;
    margin-bottom: 0.5rem;
}

.stepper-btn {
    background: #fff;
    border: 1.5px solid #dde5e1;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #16332C;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.stepper-btn:hover {
    border-color: #91b39a;
    background: #f5f8f6;
}

.amount-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #dde5e1;
    border-radius: 12px;
    padding: 0 1rem;
}

.amount-input-wrap span {
    font-weight: 700;
    color: #9aa8a1;
    margin-right: 0.5rem;
}

.amount-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.85rem 0;
    color: #16332C;
    min-width: 0; /* CHANGED: prevents the number input from forcing the
                     stepper grid wider than its column on narrow screens */
}

.amount-helper {
    font-size: 0.78rem;
    color: #9aa8a1;
    margin: 0 0 2rem;
}

/* Submit */
.donate-submit {
    display: block;
    width: 100%;
    background: #91b39a;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 1rem;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, transform 0.2s;
}

.donate-submit:hover {
    background: #7da188;
    transform: translateY(-1px);
}

.donate-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.amount-warning {
    text-align: center;
    font-size: 0.84rem;
    color: #b97300;
    margin-top: 0.8rem;
}

.package-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 51, 44, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 1.5rem;
}

.package-modal-overlay.open {
    display: flex;
}

.package-modal {
    background: #fff;
    border-radius: 18px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.8rem;
}

.package-modal h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #16332C;
    margin: 0 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.package-modal h3 button {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #6b7a73;
    cursor: pointer;
}

.package-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0.9rem;
    border: 1.5px solid #eef2ef;
    border-radius: 12px;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.package-modal-row:hover {
    border-color: #F5A623;
    background: #fff8ec;
}

.package-modal-row .tier-label {
    font-size: 0.9rem;
    color: #16332C;
}

.package-modal-row .tier-amount {
    font-weight: 700;
    color: #16332C;
}

.highlight-active {
    border-color: #F5A623 !important;
    background-color: #fff8ec !important;
    font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* CHANGED: 2-per-row cause card grid (e.g. a "related causes" or
   causes-listing layout, distinct from the single sidebar .cause-card
   used on the donation form page above).

   IMPORTANT — this only produces exactly 2 equal columns if the
   PARENT container has:
     display: flex; flex-wrap: wrap; gap: 1.8rem;
   If your parent's actual gap differs, or uses margins instead of
   `gap`, change the "1.8rem" values below to match — otherwise the
   math silently drifts and rows will wrap early or overflow.
   ------------------------------------------------------------------ */
.cause-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.8rem;
}

.cause-grid .cause-card-sidebar {
    /* Desktop default: 3 per row (adjust the divisor/gap-count below
       if your design intends a different desktop column count) */
    flex: 0 0 calc((100% - 2 * 1.8rem) / 3);
    max-width: calc((100% - 2 * 1.8rem) / 3);
}

@media (max-width: 992px) {
    .cause-grid .cause-card-sidebar {
        /* CHANGED: 2 columns = 1 gap between them, not 2.
           (100% - 1.8rem) / 2 is only correct for exactly 2 items
           per row sharing exactly one 1.8rem gap. */
        flex: 0 0 calc((100% - 1.8rem) / 2);
        max-width: calc((100% - 1.8rem) / 2);
    }
}

@media (max-width: 560px) {
    .cause-grid .cause-card-sidebar {
        /* 1 per row on small phones — no gap math needed */
        flex: 0 0 100%;
        max-width: 100%;
    }
}


   The sidebar was cramped into a fixed 300px column all the way down
   to 900px, which is too narrow once padding + the image + tier text
   are all accounted for. Widen the breakpoint and give the sidebar
   image/card room to breathe before the layout stacks.
   ------------------------------------------------------------------ */
@media (max-width: 1024px) {
    .donate-page-grid {
        grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    }
}

/* ------------------------------------------------------------------ */
/* Stacked layout: sidebar goes on top, full width, no longer sticky
   (sticky only makes sense in a side-by-side layout).
   ------------------------------------------------------------------ */
@media (max-width: 900px) {
    .donate-page-grid {
        grid-template-columns: 1fr;
    }

    .cause-sidebar {
        padding: 1.25rem 1.25rem 0;
    }

    .cause-card-sidebar {
        position: static;
        max-width: 520px;   /* CHANGED: keeps the card/image from
                               stretching edge-to-edge and looking
                               oversized once it's a full-width block */
        margin: 0 auto;
    }

    /* CHANGED: the stacked (column) tier-row layout above exists to fix
       the narrow 260-300px desktop sidebar. Once the card goes full-width
       here, there's plenty of room for label + price on one line again —
       so restore the row layout at this breakpoint. */
    .cause-tier-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.5rem;
    }

    .cause-tier-row .tier-amount {
        white-space: nowrap;
    }

    .form-row,
    .amount-presets {
        grid-template-columns: 1fr 1fr;
    }
}

/* ------------------------------------------------------------------ */
/* CHANGED: New breakpoint for phones. Two-column name/email and the
   4-preset amount grid both get too tight below ~560px; drop to a
   single column so labels, inputs, and buttons all have full width.
   ------------------------------------------------------------------ */
@media (max-width: 560px) {
    .cause-sidebar {
        padding: 1rem 1rem 0;
    }

    .cause-card-sidebar {
        max-width: 100%;
        border-radius: 12px;
    }

    .cause-card-image {
        aspect-ratio: 16 / 9; /* CHANGED: slightly shorter crop reads
                                  better at phone widths than 16:10 */
        border-radius: 12px 12px 0 0;
    }

    .cause-card-body {
        padding: 1.1rem;
    }

    .form-row,
    .amount-presets {
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
    }

    .donate-main-hero {
        padding: 2.2rem 6vw 2rem;
    }

    .donate-form-wrap {
        padding: 2rem 6vw 3rem;
    }
}

/* ------------------------------------------------------------------ */
/* CHANGED: Extra-small phones (≤400px). Even the 2-column form-row
   and amount-presets get cramped here (e.g. small Android devices,
   split-screen view) — collapse to a single column entirely.
   ------------------------------------------------------------------ */
@media (max-width: 400px) {
    .form-row,
    .amount-presets {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .amount-stepper {
        grid-template-columns: 44px 1fr 44px;
        gap: 0.5rem;
    }
}
.donor-input{
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.94rem;
}