/**
 * NW Gift Cards — Frontend Styles
 * Woodmart design tokens: Geologica font, var(--nwgc-accent, #eb7505) primary, var(--nwgc-dark, #1d1d1d) secondary.
 */

.nwgc-fields {
    max-width: 520px;
    margin: 0 0 24px;
    font-family: var(--nwgc-font, 'Geologica', 'Segoe UI', Arial, sans-serif);
}

.nwgc-fields > div {
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 18px 20px;
}

.nwgc-fields > .nwgc-selected-amount {
    border: 2px solid var(--nwgc-accent, #eb7505);
}

/* Hide stock/availability for gift cards */
.nwgc-no-availability,
.single-product-page .stock.ud-availability {
    display: none !important;
}
body.postid-17369 .stock.ud-availability,
body.postid-17369 .wd-stock-status {
    display: none !important;
}

/* Labels */
.nwgc-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--nwgc-dark, #1d1d1d);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Amount Buttons */
.nwgc-amount-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nwgc-amount-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: var(--nwgc-dark, #1d1d1d);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    user-select: none;
}

.nwgc-amount-btn:hover {
    border-color: var(--nwgc-accent, #eb7505);
    color: var(--nwgc-accent, #eb7505);
    box-shadow: 0 2px 8px rgba(235,117,5,0.15);
    transform: translateY(-1px);
}

.nwgc-amount-btn.active {
    background-color: var(--nwgc-accent, #eb7505);
    border-color: var(--nwgc-accent, #eb7505);
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(235,117,5,0.3);
    transform: translateY(-1px);
    border-radius: 10px;
}

.nwgc-amount-btn.active span,
.nwgc-amount-btn.active .woocommerce-Price-amount,
.nwgc-amount-btn.active .woocommerce-Price-currencySymbol {
    color: #fff !important;
}

.nwgc-amount-btn.active:hover {
    background-color: #d46800;
    border-color: #d46800;
    color: #fff !important;
}

/* Custom Amount */
.nwgc-custom-amount {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.nwgc-currency {
    font-size: 16px;
    font-weight: 600;
    color: var(--nwgc-dark, #1d1d1d);
}

.nwgc-custom-amount input[type="number"] {
    width: 150px;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.nwgc-custom-amount input[type="number"]:focus {
    outline: none;
    border-color: var(--nwgc-accent, #eb7505);
    box-shadow: 0 0 0 3px rgba(235,117,5,0.1);
}

/* Selected Amount Display */
.nwgc-selected-amount {
    background: #faf6f1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nwgc-selected-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.nwgc-selected-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--nwgc-accent, #eb7505);
}

/* Recipient Inputs */
.nwgc-recipient-section input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.nwgc-recipient-section input:focus {
    outline: none;
    border-color: var(--nwgc-accent, #eb7505);
    box-shadow: 0 0 0 3px rgba(235,117,5,0.1);
}

/* Message Textarea */
.nwgc-message-section textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.nwgc-message-section textarea:focus {
    outline: none;
    border-color: var(--nwgc-accent, #eb7505);
    box-shadow: 0 0 0 3px rgba(235,117,5,0.1);
}

/* Schedule Toggle */
.nwgc-schedule-toggle {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.nwgc-schedule-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #444;
    cursor: pointer;
}

.nwgc-schedule-toggle input[type="radio"] {
    accent-color: var(--nwgc-accent, #eb7505);
    width: 16px;
    height: 16px;
}

/* Schedule Box */
.nwgc-schedule-box {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.nwgc-schedule-field {
    flex: 1;
}

.nwgc-schedule-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.nwgc-schedule-field input[type="date"],
.nwgc-schedule-field input[type="time"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.nwgc-schedule-field input:focus {
    outline: none;
    border-color: var(--nwgc-accent, #eb7505);
    box-shadow: 0 0 0 3px rgba(235,117,5,0.1);
}

/* Responsive */
@media (max-width: 480px) {
    .nwgc-amount-buttons {
        gap: 8px;
    }

    .nwgc-amount-btn {
        min-width: 75px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .nwgc-schedule-box {
        flex-direction: column;
        gap: 12px;
    }

    .nwgc-schedule-toggle {
        flex-direction: column;
        gap: 10px;
    }
}

/* Design picker */
.nwgc-designs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.nwgc-design {
    position: relative;
    display: block;
    margin: 0;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nwgc-design input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.nwgc-design img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.nwgc-design-name {
    display: block;
    padding: 6px 8px;
    font-size: 12px;
    text-align: center;
    color: var(--nwgc-dark, #1d1d1d);
    background: #fafafa;
}
.nwgc-design:hover {
    border-color: var(--nwgc-accent, #eb7505);
}
.nwgc-design.active,
.nwgc-design:has(input:checked) {
    border-color: var(--nwgc-accent, #eb7505);
    box-shadow: 0 0 0 2px var(--nwgc-accent, #eb7505);
}
.nwgc-design input:focus-visible + img {
    outline: 2px solid var(--nwgc-accent, #eb7505);
    outline-offset: -4px;
}

/* For me / gift toggle */
.nwgc-mode-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.nwgc-mode-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 14px;
    cursor: pointer;
}
.nwgc-self-note {
    margin: 10px 0 0;
    font-size: 13px;
    color: #666;
}
.nwgc-fields > .nwgc-gift-only {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}
.nwgc-gift-only > div {
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 18px 20px;
}

/* Validation notice */
.nwgc-notice {
    margin-bottom: 15px;
    padding: 12px 16px;
    background: #fef0f0;
    border-left: 4px solid #e2401c;
    border-radius: 4px;
    color: #c02b0a;
    font-size: 14px;
}

@media (max-width: 480px) {
    .nwgc-designs {
        grid-template-columns: repeat(2, 1fr);
    }
    .nwgc-fields > div,
    .nwgc-gift-only > div {
        padding: 14px;
    }
}

/* Themes that reset form fields (e.g. Bridge) — keep inputs visible */
.nwgc-fields input[type="text"],
.nwgc-fields input[type="email"],
.nwgc-fields input[type="tel"],
.nwgc-fields input[type="number"],
.nwgc-fields input[type="date"],
.nwgc-fields input[type="time"],
.nwgc-fields textarea {
    border: 1px solid #cfcfcf !important;
    background: #fff !important;
    color: #222;
}
.nwgc-fields input:focus,
.nwgc-fields textarea:focus {
    border-color: var(--nwgc-accent, #eb7505) !important;
}
