﻿@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;800&display=swap');

:root {
    --miditaji-teal: #115c68;
    --miditaji-red: #ec0042;
    --miditaji-dark: #115c68;
    --miditaji-white: #ffffff;
    --miditaji-gray: #333333;
    --miditaji-glass: rgba(255, 255, 255, 0.05);
    --miditaji-glass-border: rgba(255, 255, 255, 0.1);
}

.miditaji-section {
    background-color: var(--miditaji-dark);
    color: var(--miditaji-white);
    font-family: 'Montserrat', sans-serif;
    padding: 60px 20px;
    border-radius: 20px;
    margin: 20px 0;
}

.miditaji-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Elementor/Theme safe width override: let content use broader row */
.miditaji-section .miditaji-container {
    max-width: 1400px !important;
    width: 100%;
}

.miditaji-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.miditaji-title-line {
    display: inline;
}

.miditaji-main-title {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    color: var(--miditaji-white);
}

.miditaji-intro-wrap {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 50px;
    padding: 0;
}

.miditaji-intro {
    text-align: center;
    max-width: none;
    margin: 0 auto;
    line-height: 1.6;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.miditaji-intro + .miditaji-intro {
    margin-top: 8px;
}

/* TIERS GRID */
.tiers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 60px;
    align-items: stretch;
}

.tier-card {
    background: var(--miditaji-glass);
    border: 1px solid var(--miditaji-glass-border);
    border-radius: 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    transition: transform 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden; /* Prevent text/button bleed outside rounded corners */
    min-width: 0;
    min-height: 0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.tier-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.tier-header {
    /* More breathing room from card edges */
    padding: 34px 30px 16px;
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.tier-header p {
    font-size: 0.78rem;
    text-transform: uppercase;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.7);
}

.tier-header p strong {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 800;
    color: var(--miditaji-white);
}

.tier-header h3 {
    font-size: clamp(1.6rem, 2.4vw, 2.2rem);
    font-weight: 800;
    margin: 8px 0 14px;
    line-height: 0.95;
    color: var(--miditaji-white);
}

.tier-benefits {
    list-style: disc;
    /* Balanced inner spacing on all sides */
    padding: 0 30px 28px 50px;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.28;
    flex-grow: 1;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.tier-benefits li {
    margin-bottom: 14px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tier-benefits strong {
    display: block;
    font-size: 0.86rem;
    line-height: 1.15;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tier-benefit-sub {
    display: block;
    font-size: 0.76rem;
    line-height: 1.24;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.82);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tier-icon {
    position: absolute;
    bottom: 18px;
    right: -14px;
    width: 190px;
    height: 190px;
    opacity: 0.28;
    pointer-events: none;
    z-index: 0;
}

.tier-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tier-footer-badge {
    background: rgba(255, 255, 255, 0.8);
    width: 100%;
    box-sizing: border-box;
    color: var(--miditaji-red);
    padding: 15px 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* HIGHLIGHT TIERS */
.tier-card.highlight {
    border-color: rgba(0, 128, 128, 0.3);
}

/* FORM STYLES */
.miditaji-form {
    background: #ffffff;
    border: none;
    padding: 44px 64px;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: #115c68;
    box-sizing: border-box;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.miditaji-section .miditaji-form {
    width: 100%;
    max-width: 1400px !important;
}

.miditaji-form .miditaji-title {
    color: #115c68;
    font-size: 1.9rem;
    text-transform: uppercase;
    margin-bottom: 20px;
    text-align: center;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row input, .form-row select {
    flex: 1;
    box-sizing: border-box;
    width: 100%;
    background: #ffffff;
    border: 2px solid var(--miditaji-red);
    border-radius: 25px;
    padding: 15px 20px;
    color: #115c68;
    font-size: 0.95rem;
    font-weight: 600;
}

.form-row select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 48px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23115c68' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px;
}

.form-row select:invalid {
    color: #9aa3ab;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-row select option {
    color: #115c68;
    background: #ffffff;
}

.form-row input::placeholder {
    color: #9aa3ab;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-row input:focus,
.form-row select:focus,
.form-row input:active,
.form-row select:active {
    outline: none;
    border-color: #115c68;
}

.form-checkbox {
    margin: 8px 0 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
    color: #115c68;
}

.amount-selection {
    margin: 6px 0 14px;
}

.amount-label {
    font-weight: 800;
    font-size: clamp(1.5rem, 2.8vw, 2.3rem);
    line-height: 1;
    margin-bottom: 12px;
    color: #115c68;
}

.amount-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.amount-buttons .custom-amount {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
}

.amount-buttons .submit-btn {
    flex: 1 1 100%;
    width: 100%;
}

.contacts-label {
    margin: 14px 0 12px;
    font-size: clamp(1.4rem, 2.5vw, 2.1rem);
    font-weight: 800;
    color: #115c68;
    line-height: 1;
}

.amount-btn {
    flex: 1;
    background: #ffffff;
    border: 2px solid var(--miditaji-teal);
    color: #115c68;
    border-radius: 25px;
    padding: 15px;
    font-weight: 800;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
}

.amount-btn span {
    font-size: 1rem;
    font-weight: 800;
    color: #115c68;
}

.amount-btn.active {
    background: var(--miditaji-teal);
    border-color: var(--miditaji-teal);
    color: white;
}

.amount-btn.active span {
    color: white;
}

.amount-btn:hover {
    background: rgba(17, 92, 104, 0.08);
    color: #115c68;
    border-color: var(--miditaji-teal);
}

.amount-btn:hover span {
    color: #115c68;
}

.custom-amount {
    flex: 1;
    display: flex;
    min-width: 150px;
    position: relative;
}

.custom-amount input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: #ffffff;
    border: 2px solid #115c68;
    color: #115c68;
    padding: 14px 8px;
    border-radius: 25px;
    text-align: center;
    font-weight: 800;
    font-size: clamp(1.15rem, 2.2vw, 2.05rem);
    text-transform: none;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1;
    min-height: 68px;
}

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

.custom-amount input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.custom-amount input::placeholder {
    color: #b0b0b0;
    font-weight: 800;
    font-size: clamp(0.72rem, 1.15vw, 0.95rem);
}

.custom-amount-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #b0b0b0;
    font-weight: 800;
    font-size: clamp(0.66rem, 0.98vw, 0.88rem);
    line-height: 1.05;
    letter-spacing: 0.02em;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.amount-presets {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.amount-preset-btn {
    border: 2px solid #115c68;
    background: #ffffff;
    color: #115c68;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    min-height: 32px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.amount-preset-btn:hover {
    background: rgba(17, 92, 104, 0.08);
}

.amount-preset-btn.active {
    background: #115c68;
    border-color: #115c68;
    color: #fff;
}

/* Force preset pills to stay green in WP/Elementor context */
.miditaji-section .amount-preset-btn {
    border-color: #115c68 !important;
    color: #115c68 !important;
    background: #ffffff !important;
}

.miditaji-section .amount-preset-btn:hover {
    border-color: #115c68 !important;
    color: #115c68 !important;
    background: rgba(17, 92, 104, 0.08) !important;
}

.miditaji-section .amount-preset-btn.active,
.miditaji-section .amount-preset-btn[aria-pressed="true"] {
    border-color: #115c68 !important;
    background: #115c68 !important;
    color: #ffffff !important;
}

.elementor .miditaji-section .amount-preset-btn,
.elementor-page .miditaji-section .amount-preset-btn {
    border-color: #115c68 !important;
    color: #115c68 !important;
    background: #ffffff !important;
}

.elementor .miditaji-section .amount-preset-btn:hover,
.elementor-page .miditaji-section .amount-preset-btn:hover {
    border-color: #115c68 !important;
    color: #115c68 !important;
    background: rgba(17, 92, 104, 0.08) !important;
}

.elementor .miditaji-section .amount-preset-btn.active,
.elementor-page .miditaji-section .amount-preset-btn.active,
.elementor .miditaji-section .amount-preset-btn[aria-pressed="true"],
.elementor-page .miditaji-section .amount-preset-btn[aria-pressed="true"] {
    border-color: #115c68 !important;
    background: #115c68 !important;
    color: #ffffff !important;
}

.custom-amount input:focus + .custom-amount-label,
.custom-amount input:not(:placeholder-shown) + .custom-amount-label {
    opacity: 0;
}

.custom-amount input:focus,
.custom-amount input:active {
    outline: none;
    border-color: #115c68;
}

@media (max-width: 900px) {
    .custom-amount input,
    .custom-amount input::placeholder {
        font-size: clamp(0.75rem, 2.8vw, 1.2rem);
        line-height: 1.15;
    }
    .custom-amount-label {
        font-size: clamp(0.58rem, 2vw, 0.72rem);
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .custom-amount input {
        font-size: clamp(0.92rem, 1.45vw, 1.2rem);
    }
    .custom-amount input::placeholder {
        font-size: clamp(0.68rem, 1.05vw, 0.88rem);
    }
}

.submit-btn {
    background: var(--miditaji-red);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 20px 40px;
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
    flex: 1.5;
    width: 100%;
    margin-top: 4px;
}

.submit-btn:hover {
    background: #ec0042;
    transform: scale(1.02);
}

.form-footer {
    text-align: center;
    color: #115c68;
    margin-top: 20px;
    text-transform: uppercase;
}

.form-footer-top {
    display: block !important;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.35;
}

.form-footer-bottom {
    display: block !important;
    margin-top: 8px;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.2;
}

.elementor .miditaji-section .form-footer br,
.elementor-page .miditaji-section .form-footer br {
    display: block !important;
    content: "" !important;
}

.payment-section {
    margin-top: 14px;
    border-top: 1px solid rgba(17, 92, 104, 0.25);
    padding-top: 16px;
    color: #115c68;
}

.payment-title {
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.payment-total {
    margin: 0 0 10px;
    font-weight: 700;
    font-size: 1.05rem;
}

.payment-bank-requirement {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(17, 92, 104, 0.25);
    background: rgba(17, 92, 104, 0.06);
    color: #115c68;
    font-size: 0.84rem;
    line-height: 1.45;
}

.payment-bank-requirement strong {
    font-weight: 700;
}

.payment-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.35;
    margin: 10px 0;
    color: #115c68;
}

.payment-check input[type="checkbox"] {
    margin-top: 0.18em;
}

.payment-check .payment-check-text {
    min-width: auto;
    overflow-wrap: normal;
    word-break: normal;
    white-space: normal;
}

.form-checkbox label,
.payment-check {
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.35;
}

.payment-check a {
    color: #115c68;
    font-weight: 700;
    font-size: 0.84rem;
    text-decoration: underline;
    white-space: normal;
    overflow-wrap: normal;
}

@media (max-width: 768px) {
    .payment-check {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        width: 100%;
        box-sizing: border-box;
        align-items: start;
    }

    .payment-check .payment-check-text {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
        white-space: normal;
    }

    .payment-check a {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        display: inline;
    }
}

.payment-methods {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.payment-method-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(17, 92, 104, 0.35);
    border-radius: 12px;
    background: rgba(17, 92, 104, 0.08);
    padding: 11px 14px;
    font-size: 1.05rem;
    font-weight: 700;
}

.payment-method-row input[type="radio"] {
    width: 16px;
    height: 16px;
}

.payment-method-icon {
    width: 31px;
    height: 31px;
    max-width: 31px;
    max-height: 31px;
    min-width: 31px;
    min-height: 31px;
    object-fit: contain;
    flex: 0 0 31px;
    display: block;
}

.payment-method-label {
    display: inline-block;
    line-height: 1.2;
}

/* MAP STYLES */
.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    flex-wrap: wrap;
    gap: 15px;
}

/* New Header Progress Bar */
.top-progress-bar-wrapper {
    width: 100%;
    order: 3; /* Position below the text labels but within the flex container if needed, or separate */
    margin-top: 10px;
}

.top-progress-bar {
    position: relative;
    height: 38px;
    background: #1e252b; /* Dark background as in image */
    border: 3px solid #ec0042; /* Glowing red border */
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(236, 0, 66, 0.4);
    display: flex;
    align-items: center;
}

.top-progress-dashed {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    transform: translateY(-50%);
    background-image: linear-gradient(to right, #666 50%, transparent 50%);
    background-size: 30px 4px; /* Dash size */
    z-index: 1;
}

.top-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #115c68 0%, #ec0042 100%); /* Teal to Red-Pink */
    width: 0%; /* Dynamic */
    z-index: 2;
    transition: none;
    border-radius: 16px;
}
.miditaji-map-section.is-in-view .top-progress-fill {
    transition: width 2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.top-progress-gear-container {
    position: absolute;
    top: 50%;
    left: 0%; /* Dynamic */
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    transition: none;
}
.miditaji-map-section.is-in-view .top-progress-gear-container {
    transition: left 2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.top-progress-gear-container img {
    width: 100%;
    height: 100%;
    animation: miditaji-spin 12s linear infinite;
    animation-play-state: paused;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}
.miditaji-map-section.is-in-view .top-progress-gear-container img {
    animation-play-state: running;
}

@keyframes miditaji-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.amount-accumulated {
    color: var(--miditaji-white);
    font-size: 1rem;
    font-weight: 800;
}

.amount-accumulated #current-goal-amount {
    font-size: 2rem;
    font-weight: 800;
}

.amount-accumulated .amount-unit {
    font-size: 1rem;
    font-weight: 800;
}

.goal-target {
    font-size: 2rem;
    font-weight: 800;
}

.goal-target .goal-number {
    font-size: 2rem;
    font-weight: 800;
}

.goal-target .goal-unit {
    font-size: 1rem;
    font-weight: 800;
}

.map-container {
    position: relative;
    background: #dddddd; 
    height: 736px;
    border-radius: 20px;
    border: 1px solid var(--miditaji-glass-border);
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.1);
    z-index: 1;
    margin-top: 20px;
}


/* Grayscale filter for Leaflet tiles */
.leaflet-tile-pane {
    filter: grayscale(100%) brightness(0.95) contrast(1.1);
}

.map-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.map-background-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.map-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* The actual path drawn by donors */
.route-path {
    fill: none;
    stroke: var(--miditaji-red);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke-dashoffset 1s ease-out;
}

/* The underlying grey path showing the total route */
.route-path-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.2);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gear-indicator {
    position: absolute;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%); /* Center the gear on the coordinate */
    opacity: 0;
    transition: opacity 0.45s ease-out !important;
    transition-property: opacity !important;
    z-index: 1000;
    pointer-events: none;
}

.gear-indicator.is-visible {
    opacity: 1;
}

.gear-indicator img {
    width: 100%;
    animation: rotateGear 5s linear infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

@keyframes rotateGear {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.km-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--miditaji-red);
    padding: 10px 40px;
    border-radius: 50px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(230, 25, 75, 0.4);
    z-index: 1000;
}

.km-counter p {
    margin: 0;
    font-size: 1rem;
    text-transform: uppercase;
    color: white;
}

.km-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
}

/* SUPPORTERS STYLES */
.supporters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.supporter-name {
    background: #ffffff;
    border: 1px solid #dbe3e7;
    padding: 20px;
    text-align: center;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    color: #115c68;
    transition: background 0.3s ease;
}

.supporter-name:hover {
    background: #f4f7f9;
}

/* Modal and Shirt Button */
.miditaji-btn-outline {
    background: #ffffff;
    border: 2px solid var(--miditaji-teal);
    color: var(--miditaji-red);
    padding: 8px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.65rem;
    text-transform: uppercase;
    margin-top: 14px;
    transition: all 0.3s ease;
    display: inline-block;
}
.miditaji-btn-outline:hover {
    background: var(--miditaji-red);
    color: white;
}

/* Keep "Cita summa" ring green even if theme/Elementor styles override defaults */
.miditaji-section .custom-amount input {
    border-color: var(--miditaji-teal) !important;
}

.miditaji-section .custom-amount input:hover {
    border-color: var(--miditaji-teal) !important;
    background: rgba(17, 92, 104, 0.04);
}

.miditaji-section .tier-benefits .miditaji-btn-outline {
    display: inline-flex;
    align-items: center;   /* vertical centering */
    justify-content: center; /* horizontal centering */
    width: fit-content;
    min-width: 200px;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
    min-height: 42px;
}

/* Dedicated CTA row so button is centered and doesn't touch card edges */
.miditaji-section .tier-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 12px;
    padding: 0 8px;
    box-sizing: border-box;
    min-height: 56px;
}

/* Strong override for Elementor/theme button defaults */
.miditaji-section .tier-cta .miditaji-btn-outline {
    align-self: center;
    text-align: center;
}

/* Final high-specificity safety rules against Elementor overrides */
.elementor .miditaji-section .tier-card,
.elementor-page .miditaji-section .tier-card {
    min-width: 0 !important;
}

.elementor .miditaji-section .tier-benefits,
.elementor-page .miditaji-section .tier-benefits {
    display: flex !important;
    flex-direction: column !important;
}

.elementor .miditaji-section .tier-cta .miditaji-btn-outline,
.elementor-page .miditaji-section .tier-cta .miditaji-btn-outline {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.miditaji-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}
.miditaji-modal-content {
    background-color: #fff;
    color: #115c68;
    margin: 5vh auto;
    padding: 28px;
    border-radius: 20px;
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}
.miditaji-modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #115c68;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.miditaji-modal-close:hover {
    opacity: 0.85;
    transform: scale(1.05);
}
.miditaji-modal-close:focus-visible {
    outline: 2px solid #ec0042;
    outline-offset: 3px;
}
.shirt-designs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}
.shirt-card {
    background: #f4f6f7;
    border: 1px solid rgba(17, 92, 104, 0.18);
    border-radius: 16px;
    overflow: hidden;
}
.shirt-card-image-wrap {
    position: relative;
}
.shirt-card-image {
    display: block;
    width: 100%;
    height: 210px;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center;
    background: transparent;
    cursor: zoom-in;
}
.shirt-zoom-btn {
    position: absolute;
    top: auto;
    left: 2%;
    bottom: 2%;
    right: auto;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 2px solid rgba(17, 92, 104, 0.22);
    background: rgba(255, 255, 255, 0.92);
    color: #115c68;
    cursor: pointer;
    box-shadow: none;
    text-shadow: none;
    backdrop-filter: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    transform: none;
    z-index: 3;
}

.shirt-zoom-icon {
    width: 30px;
    height: 30px;
    display: block;
}

.shirt-zoom-icon path {
    stroke: #115c68 !important;
}
.shirt-card-body {
    padding: 30px 12px 12px;
}
.shirt-card-title {
    margin: 0 0 10px;
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 800;
    color: #115c68;
}
.shirt-mode-toggle {
    display: inline-flex;
    border: 2px solid #115c68;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
    max-width: 100%;
}
.shirt-mode-btn {
    border: 0;
    background: #fff;
    color: #115c68;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 8px 16px;
    min-height: 38px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.shirt-mode-btn + .shirt-mode-btn {
    border-left: 1px solid rgba(17, 92, 104, 0.25);
}

.shirt-mode-btn:first-child {
    border-radius: 999px 0 0 999px;
}

.shirt-mode-btn:last-child {
    border-radius: 0 999px 999px 0;
}
.shirt-mode-btn.active {
    background: #115c68;
    color: #fff;
}
.shirt-viewer-modal {
    z-index: 100001;
}
.shirt-viewer-open {
    overflow: hidden;
}
.shirt-viewer-content {
    width: min(98vw, 1600px);
    max-width: 98vw;
    margin: 2vh auto;
    max-height: 96vh;
    background: #111;
    padding: 10px;
}
#shirt-viewer-image {
    display: block;
    width: 100%;
    max-height: calc(96vh - 20px);
    object-fit: contain;
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    transform: translateZ(0);
}
.shirt-viewer-content .miditaji-modal-close {
    color: #fff;
    top: 3%;
    right: 3%;
    cursor: pointer;
    pointer-events: auto;
    z-index: 2147483647;
}
#shirt-viewer-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    z-index: 2147483647;
    line-height: 1;
    font-size: 2.2rem;
}
#shirt-viewer-close:hover {
    background: rgba(0, 0, 0, 0.62);
}
#shirt-viewer-image {
    pointer-events: none;
}
.shirt-viewer-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2147483646;
    font-size: 1.5rem;
    line-height: 1;
    user-select: none;
}
.shirt-viewer-prev {
    left: 14px;
}
.shirt-viewer-next {
    right: 14px;
}
.shirt-viewer-nav:hover {
    background: rgba(0, 0, 0, 0.62);
}
.shirt-viewer-side-label {
    position: fixed;
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    border-radius: 999px;
    padding: 8px 12px;
    white-space: nowrap;
    z-index: 2147483646;
}

.miditaji-policy-modal {
    z-index: 100002;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

.miditaji-policy-content {
    width: min(96vw, 1100px);
    height: min(88vh, 900px);
    max-height: 88vh;
    margin: 0;
    padding: 16px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    box-sizing: border-box;
}

#miditaji-policy-title {
    margin: 4px 42px 12px 4px;
    color: #115c68;
    font-size: clamp(1.05rem, 2.2vw, 1.45rem);
    font-weight: 800;
    line-height: 1.2;
}

#miditaji-policy-body {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 1px solid rgba(17, 92, 104, 0.25);
    border-radius: 12px;
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    color: #115c68;
    line-height: 1.5;
    font-size: 0.98rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    pointer-events: auto;
}

#miditaji-policy-body h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 800;
}

#miditaji-policy-body p {
    margin: 0 0 10px;
}

#miditaji-policy-close {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #115c68;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#shirt-modal h2 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 900;
}

.shirt-zoom-btn:hover {
    background: transparent;
    color: #0f6f57;
}
.shirt-mode-btn:hover {
    background: #e9f1f3;
}
.shirt-mode-btn.active:hover {
    background: #115c68;
}
.shirt-zoom-btn:focus-visible,
.shirt-mode-btn:focus-visible {
    outline: 2px solid #ec0042;
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .shirt-designs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .miditaji-modal-content {
        width: 94%;
        padding: 16px;
        border-radius: 14px;
    }
    #shirt-modal h2 {
        font-size: 1.25rem;
        padding-right: 26px;
    }
    .shirt-designs-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .shirt-card-image {
        height: 190px;
        aspect-ratio: auto;
        object-fit: cover;
    }
    .shirt-zoom-btn {
        width: 36px;
        height: 36px;
        font-size: 1.6rem;
    }
    .shirt-mode-toggle {
        width: 100%;
    }
    .shirt-mode-btn {
        flex: 1 1 50%;
        text-align: center;
    }
    .shirt-viewer-modal {
        position: fixed;
        inset: 0;
        padding: 0;
        backdrop-filter: blur(2px);
        overflow: hidden;
    }
    .shirt-viewer-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        margin: 0;
        padding: 0;
        border-radius: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000;
        overflow: hidden;
    }
    #shirt-viewer-image {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        user-select: none;
        -webkit-user-drag: none;
    }
    .shirt-viewer-content .miditaji-modal-close {
        position: fixed;
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        font-size: 2.4rem;
        z-index: 4;
        line-height: 1;
    }
    .shirt-viewer-nav {
        width: 48px;
        height: 48px;
        font-size: 1.6rem;
    }
    .shirt-viewer-prev {
        left: max(10px, env(safe-area-inset-left));
    }
    .shirt-viewer-next {
        right: max(10px, env(safe-area-inset-right));
    }
    .shirt-viewer-side-label {
        font-size: 0.82rem;
        padding: 7px 11px;
    }
    .miditaji-policy-content {
        width: 95%;
        height: 90vh;
        max-height: 90vh;
        margin: 0;
        padding: 12px;
    }
    #miditaji-policy-title {
        margin: 4px 40px 10px 4px;
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shirt-zoom-btn,
    .shirt-mode-btn {
        transition: none;
    }
}

.shirt-card,
.shirt-card * {
    box-sizing: border-box;
}

.shirt-zoom-btn,
.shirt-mode-btn {
    font-family: inherit;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.shirt-card-image-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.08), rgba(0,0,0,0));
}
.shirt-card-image-wrap > * {
    position: relative;
    z-index: 1;
}
.shirt-card-image-wrap .shirt-zoom-btn {
    z-index: 2;
}

@media (max-height: 740px) {
    .miditaji-modal-content {
        margin-top: 2vh;
        margin-bottom: 2vh;
    }
}

/* old placeholder class kept for backwards compatibility, not used by new JS */
.shirt-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .amount-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    .submit-btn {
        grid-column: span 2;
    }
    .tiers-grid {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
    .tier-card {
        min-height: 0;
    }
    .tier-header {
        padding: 28px 24px 14px;
    }
    .tier-benefits {
        padding: 0 24px 24px 42px;
    }
    .miditaji-section .tier-benefits .miditaji-btn-outline {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .miditaji-section .progress-info {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        align-items: end !important;
        column-gap: 12px;
        row-gap: 10px;
    }

    .miditaji-section .amount-accumulated {
        justify-self: start;
        white-space: nowrap;
    }

    .miditaji-section .goal-target {
        justify-self: end;
        white-space: nowrap;
    }

    .miditaji-section .amount-accumulated #current-goal-amount,
    .miditaji-section .goal-target .goal-number {
        font-size: 1.55rem;
    }

    .miditaji-section .amount-accumulated .amount-unit,
    .miditaji-section .goal-target .goal-unit {
        font-size: 0.78rem;
    }

    .miditaji-section .top-progress-bar-wrapper {
        grid-column: 1 / -1;
        order: initial;
        margin-top: 2px;
    }

    .miditaji-form .miditaji-title {
        font-size: clamp(1.15rem, 5vw, 1.45rem);
        line-height: 1.18;
        max-width: none;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        text-wrap: normal;
    }

    .miditaji-form .miditaji-title .miditaji-title-line {
        display: block;
        white-space: nowrap;
    }

    @media (max-width: 480px) {
        .miditaji-form .miditaji-title {
            font-size: 1.2rem;
            line-height: 1.15;
        }
        .miditaji-form .miditaji-title .miditaji-title-line {
            white-space: normal;
        }
    }

    .form-row {
        flex-direction: column;
    }
    .miditaji-title {
        font-size: 1.5rem;
    }
    .amount-label {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }
    .contacts-label {
        font-size: 1.4rem;
        margin: 10px 0 10px;
    }
    .amount-buttons {
        grid-template-columns: 1fr 1fr;
    }
    .submit-btn {
        grid-column: span 2;
    }
    .tiers-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .tier-header {
        padding: 24px 20px 12px;
    }
    .tier-benefits {
        padding: 0 20px 20px 36px;
    }
    .tier-benefits strong {
        font-size: 0.82rem;
    }
    .tier-benefit-sub {
        font-size: 0.72rem;
    }

    .miditaji-section .km-counter {
        left: 16px;
        right: 16px;
        transform: none;
        width: auto;
        min-width: 0;
        bottom: 16px;
        padding: 12px 20px;
        border-radius: 28px;
    }

    .miditaji-form .amount-buttons {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .miditaji-form .amount-buttons .custom-amount,
    .miditaji-form .amount-buttons .amount-presets,
    .miditaji-form .amount-buttons .submit-btn {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .miditaji-form .amount-buttons .custom-amount input,
    .miditaji-form .amount-buttons .submit-btn {
        min-height: 72px !important;
        height: 72px !important;
        border-radius: 18px !important;
        box-sizing: border-box !important;
    }

    .miditaji-form .amount-buttons .amount-presets {
        display: flex !important;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: -2px;
    }
}

@media (max-width: 1024px) {
    .miditaji-section .map-container .km-counter {
        left: 16px !important;
        right: 16px !important;
        width: calc(100% - 32px) !important;
        max-width: none !important;
        min-width: 0 !important;
        transform: none !important;
        bottom: 16px !important;
        border-radius: 28px !important;
        padding: 12px 20px !important;
        box-sizing: border-box !important;
    }
}

/* Amount input only: keep centered, hide legacy preset buttons if cached HTML appears */
.miditaji-form .amount-buttons {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

.miditaji-form .amount-buttons .custom-amount {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

@media (min-width: 769px) {
    .miditaji-form .amount-buttons .custom-amount {
        width: 30% !important;
        max-width: 30% !important;
        flex: 0 0 30% !important;
    }
}

.miditaji-form .amount-buttons .amount-presets {
    display: none !important;
}

.miditaji-form .amount-buttons .submit-btn {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

/* Mobile phones: wider form area + ~1.3x smaller typography inside donation form */
@media (max-width: 768px) {
    .miditaji-section {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .miditaji-section .miditaji-container {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .miditaji-section .miditaji-form {
        width: min(360px, calc(100vw - 14px)) !important;
        max-width: min(360px, calc(100vw - 14px)) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 18px 17px !important;
    }

    .miditaji-section .miditaji-form .miditaji-title {
        font-size: 1.1rem !important;
        line-height: 1.15 !important;
    }

    .miditaji-section .miditaji-form .amount-label,
    .miditaji-section .miditaji-form .contacts-label {
        font-size: 1.08rem !important;
        line-height: 1.15 !important;
    }

    .miditaji-section .miditaji-form .form-row input,
    .miditaji-section .miditaji-form .form-row select,
    .miditaji-section .miditaji-form .form-row input::placeholder,
    .miditaji-section .miditaji-form .form-row select:invalid {
        font-size: 0.73rem !important;
    }

    .miditaji-section .miditaji-form .custom-amount input {
        font-size: 1.1rem !important;
    }

    .miditaji-section .miditaji-form .custom-amount-label {
        font-size: 0.62rem !important;
    }

    .miditaji-section .miditaji-form .amount-preset-btn {
        font-size: 0.7rem !important;
    }

    .miditaji-section .miditaji-form .form-checkbox label,
    .miditaji-section .miditaji-form .payment-check {
        font-size: 0.77rem !important;
        line-height: 1.35 !important;
    }

    .miditaji-section .miditaji-form .submit-btn {
        font-size: 1rem !important;
    }

    .miditaji-section .miditaji-form .form-footer-top {
        font-size: 0.78rem !important;
    }

    .miditaji-section .miditaji-form .form-footer-bottom {
        font-size: 1.1rem !important;
    }
}
