/* Hilltown Light Checkout — v2.0 styles */

.hilltown-light-checkout {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1a1a1a;
    max-width: 520px;
    margin: 0 auto;
}

.htc-summary {
    background: #fff8e7;
    border: 1px solid #f4c430;
    border-radius: 4px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}
.htc-summary-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}
.htc-summary-name {
    font-weight: 600;
    font-size: 0.95rem;
}
.htc-summary-price {
    font-family: 'Lora', Georgia, serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #c72d1e;
    white-space: nowrap;
}

.htc-form { display: flex; flex-direction: column; gap: 1rem; }

.htc-row      { display: flex; gap: 0.75rem; }
.htc-row-2    { flex-wrap: wrap; }
.htc-row-2 .htc-field { flex: 1 1 calc(50% - 0.375rem); min-width: 140px; }

.htc-field { display: flex; flex-direction: column; gap: 0.35rem; }
.htc-label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #444;
}
.htc-hint { font-size: 0.78rem; color: #666; margin-top: 0.25rem; }

.htc-field input[type="text"],
.htc-field input[type="email"] {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.15s ease;
}
.htc-field input:focus {
    outline: none;
    border-color: #c72d1e;
    box-shadow: 0 0 0 2px rgba(199, 45, 30, 0.15);
}

/* Stripe Card Element mount.
   min-height MUST match the Card Element iframe's rendered height or we
   get CLS when the iframe replaces this empty div. Stripe's card element
   is ~44px tall with 12px of internal padding; we give 48px + our own
   12px padding = 72px total so the layout is stable before AND after
   Stripe mounts its iframe. */
.htc-card-mount {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    min-height: 48px;
    /* Also reserve height via box-sizing so child iframe can't expand parent */
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}
.htc-card-mount.StripeElement--focus { border-color: #c72d1e; box-shadow: 0 0 0 2px rgba(199, 45, 30, 0.15); }
.htc-card-mount.StripeElement--invalid { border-color: #c72d1e; }

/* While Stripe is still loading (before .is-ready is set on the container)
   show a subtle placeholder so users see the field is there but not yet
   active. Prevents a "nothing visible" moment during the lazy-load delay. */
.hilltown-light-checkout:not(.is-ready) .htc-card-mount::before {
    content: 'Card details load as you scroll…';
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
}
.hilltown-light-checkout.is-ready .htc-card-mount::before { display: none; }

/* Error display */
.htc-error {
    display: none;
    padding: 0.75rem 1rem;
    background: #fdecea;
    border: 1px solid #c72d1e;
    border-radius: 4px;
    color: #a01e12;
    font-size: 0.9rem;
    line-height: 1.4;
}
.htc-error.is-visible { display: block; }

/* Submit button */
.htc-submit {
    position: relative;
    display: block;
    width: 100%;
    background: #c72d1e;
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 4px;
    box-shadow: 4px 4px 0 #1a1a1a;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    margin-top: 0.5rem;
}
.htc-submit:hover:not(:disabled) {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 #1a1a1a;
}
.htc-submit:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #1a1a1a;
}
.htc-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.htc-submit-spinner { display: none; }
.is-submitting .htc-submit-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: htc-spin 0.7s linear infinite;
    vertical-align: middle;
}
@keyframes htc-spin { to { transform: rotate(360deg); } }

.is-submitting .htc-submit-label::after { content: '…'; }

.htc-trust {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: #666;
    margin: 0.75rem 0 0;
    text-align: center;
    flex-wrap: wrap;
}
.htc-trust span::before { content: '✓ '; color: #4a7a3a; }

@media (max-width: 500px) {
    .htc-row-2 .htc-field { flex: 1 1 100%; }
    .htc-submit { font-size: 1rem; padding: 0.9rem 1rem; }
    .htc-trust { gap: 0.75rem; font-size: 0.75rem; }
}
