/* =========================================================
   Zakat Calculator Widget - Frontend Styles
   ========================================================= */

.zcw-wrapper {
    --zcw-card-bg: #ffffff;
    --zcw-border: #e5e7eb;
    --zcw-border-soft: #eef0f3;
    --zcw-text: #111111;
    --zcw-label: #444444;
    --zcw-muted: #6b7280;
    --zcw-accent: #1d62b5;
    --zcw-input-bg: #ffffff;
    --zcw-placeholder: #b8bcc4;

    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    color: var(--zcw-text);
    line-height: 1.4;
}

.zcw-wrapper *,
.zcw-wrapper *::before,
.zcw-wrapper *::after {
    box-sizing: border-box;
}

/* ===== Card ===== */
.zcw-card {
    background: var(--zcw-card-bg);
    border-radius: 8px;
    padding: 28px 30px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.04);
    margin-bottom: 22px;
}

.zcw-card:last-child {
    margin-bottom: 0;
}

/* ===== Section ===== */
.zcw-section {
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--zcw-border-soft);
}

.zcw-section:last-child,
.zcw-section--last {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.zcw-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--zcw-text);
    margin: 0 0 18px 0;
    padding: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* ===== Grid ===== */
.zcw-grid {
    display: grid;
    gap: 16px 20px;
}

.zcw-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.zcw-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.zcw-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.zcw-field--full {
    grid-column: 1 / -1;
}

.zcw-field--span-2 {
    grid-column: span 2;
}

/* ===== Label ===== */
.zcw-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--zcw-label);
    margin-bottom: 8px;
    line-height: 1.3;
}

/* ===== Input ===== */
.zcw-input {
    width: 100%;
    height: 44px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--zcw-text);
    background-color: var(--zcw-input-bg);
    border: 1px solid var(--zcw-border);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    margin: 0;
}

.zcw-input::placeholder {
    color: var(--zcw-placeholder);
    opacity: 1;
}

.zcw-input:focus {
    border-color: var(--zcw-accent);
    box-shadow: 0 0 0 3px rgba(29, 98, 181, 0.15);
}

/* Hide native number spinners (we use type=text + inputmode for cleaner UX) */
.zcw-input::-webkit-outer-spin-button,
.zcw-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ===== Total card ===== */
.zcw-card--total {
    padding: 26px 30px 28px;
}

.zcw-total-title {
    margin-bottom: 18px;
}

.zcw-total-grid {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 4px 64px;
    margin-bottom: 22px;
}

.zcw-total-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.zcw-total-label {
    font-size: 12px;
    color: var(--zcw-muted);
    font-weight: 400;
    line-height: 1.3;
}

.zcw-total-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.zcw-total-value--worth {
    color: var(--zcw-text);
}

.zcw-total-value--payable {
    color: var(--zcw-accent);
}

/* ===== Button ===== */
.zcw-donate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 14px 28px;
    background-color: var(--zcw-accent);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 6px rgba(29, 98, 181, 0.2);
    line-height: 1.2;
}

.zcw-donate-btn:hover,
.zcw-donate-btn:focus {
    background-color: #154a8a;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(29, 98, 181, 0.28);
}

.zcw-donate-btn:active {
    transform: translateY(1px);
}

.zcw-donate-btn span {
    pointer-events: none;
}

/* =========================================================
   Responsive — Tablet
   ========================================================= */
@media (max-width: 1024px) {
    .zcw-card {
        padding: 24px 24px;
    }
    .zcw-card--total {
        padding: 22px 24px 26px;
    }
    .zcw-total-grid {
        gap: 4px 48px;
    }
    .zcw-total-value {
        font-size: 26px;
    }
}

/* =========================================================
   Responsive — Mobile (≤ 767px)
   Collapse all multi-column grids to a single column.
   ========================================================= */
@media (max-width: 767px) {
    .zcw-card {
        padding: 20px 18px;
        margin-bottom: 16px;
        border-radius: 8px;
    }

    .zcw-card--total {
        padding: 20px 18px 22px;
    }

    .zcw-section {
        padding-bottom: 18px;
        margin-bottom: 18px;
    }

    .zcw-section-title {
        font-size: 18px;
        margin-bottom: 14px;
    }

    .zcw-grid {
        gap: 14px;
    }

    .zcw-grid--2,
    .zcw-grid--3 {
        grid-template-columns: 1fr;
    }

    .zcw-field--span-2,
    .zcw-field--full {
        grid-column: 1 / -1;
    }

    .zcw-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .zcw-input {
        height: 46px;
        font-size: 15px; /* 16px-ish prevents iOS auto-zoom on focus */
    }

    .zcw-total-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px 20px;
        margin-bottom: 20px;
    }

    .zcw-total-label {
        font-size: 11px;
    }

    .zcw-total-value {
        font-size: 22px;
    }

    .zcw-donate-btn {
        font-size: 15px;
        min-height: 50px;
        padding: 13px 20px;
    }
}

/* =========================================================
   Responsive — Small Mobile (≤ 380px)
   ========================================================= */
@media (max-width: 380px) {
    .zcw-card,
    .zcw-card--total {
        padding: 18px 14px;
    }
    .zcw-total-value {
        font-size: 20px;
    }
    .zcw-section-title {
        font-size: 17px;
    }
}

/* =========================================================
   Editor preview tweaks (Elementor canvas)
   ========================================================= */
.elementor-editor-active .zcw-input {
    pointer-events: auto;
}
