/* ==========================================================================
   WC Gift Card Page — giftcard.css
   ========================================================================== */

/* ── Reset / scope ─────────────────────────────────────────────────────────── */
.wcgcp-wrap *,
.wcgcp-wrap *::before,
.wcgcp-wrap *::after {
    box-sizing: border-box;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.wcgcp-wrap {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    font-family: inherit;
    color: #1a1a1a;
}

@media (min-width: 768px) {
    .wcgcp-wrap {
        flex-direction: row;
        align-items: flex-start;
        gap: 48px;
        padding: 40px 24px 64px;
    }
}

/* ── Preview column ─────────────────────────────────────────────────────────── */
.wcgcp-preview-col {
    width: 100%;
    position: sticky;
    top: 100px;
}

@media (min-width: 768px) {
    .wcgcp-preview-col {
        width: 340px;
        flex-shrink: 0;
    }
}

.wcgcp-card-preview {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
}

/* ── Gift card visual ───────────────────────────────────────────────────────── */
.wcgcp-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1.586 / 1;   /* standard credit-card ratio */
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    transition: background 0.35s ease;
}

.wcgcp-card-label {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.25);
    line-height: 1.2;
    display: block;
}

.wcgcp-card-amount {
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    margin-top: 4px;
    display: block;
    min-height: 1.4em;
}

/* ── Design colour swatches ─────────────────────────────────────────────────── */
.gc-design--with-love       { background: linear-gradient(135deg, #d4a0c0 0%, #9b6b8a 100%); }
.gc-design--thinking        { background: linear-gradient(135deg, #a8c5da 0%, #6b9ab8 100%); }
.gc-design--thank-you       { background: linear-gradient(135deg, #c8d8a8 0%, #8aaa68 100%); }
.gc-design--just-because    { background: linear-gradient(135deg, #e8c8a0 0%, #c89860 100%); }
.gc-design--birthday        { background: linear-gradient(135deg, #f0d080 0%, #d0a030 100%); }
.gc-design--gift-card       { background: linear-gradient(135deg, #b8d0b8 0%, #78a878 100%); }
.gc-design--congrats        { background: linear-gradient(135deg, #e8b8a0 0%, #c07850 100%); }
.gc-design--celebrate       { background: linear-gradient(135deg, #c8a8d8 0%, #9868b8 100%); }
.gc-design--floral-warm     { background: linear-gradient(135deg, #e8c8b0 0%, #c09070 100%); }
.gc-design--marble          { background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #3a3a3a 100%); }
.gc-design--smoke           { background: linear-gradient(135deg, #888 0%, #444 100%); }
.gc-design--rose            { background: linear-gradient(135deg, #f0a0a0 0%, #c05060 100%); }
.gc-design--blue-floral     { background: linear-gradient(135deg, #a0b8e0 0%, #5070b0 100%); }
.gc-design--candle          { background: linear-gradient(135deg, #7060a0 0%, #3a2060 100%); }

/* ── Form column ────────────────────────────────────────────────────────────── */
.wcgcp-form-col {
    flex: 1;
    min-width: 0;
}

/* ── Page title ─────────────────────────────────────────────────────────────── */
.wcgcp-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin: 0 0 28px;
    line-height: 1.2;
    color: #1a1a1a;
}

/* ── Section ────────────────────────────────────────────────────────────────── */
.wcgcp-section {
    margin-bottom: 28px;
}

.wcgcp-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #555;
    margin: 0 0 12px;
}

/* ── Pill buttons ───────────────────────────────────────────────────────────── */
.wcgcp-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcgcp-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1.5px solid #d0d0d0;
    background: #fff;
    color: #1a1a1a;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    line-height: 1;
}

.wcgcp-pill:hover {
    border-color: #1a1a1a;
}

.wcgcp-pill.is-active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* ── Design grid ────────────────────────────────────────────────────────────── */
.wcgcp-design-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (max-width: 480px) {
    .wcgcp-design-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.wcgcp-design-thumb {
    position: relative;
    aspect-ratio: 1.586 / 1;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcgcp-design-thumb:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.wcgcp-design-thumb.is-active {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.15);
}

.wcgcp-design-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    text-align: center;
    padding: 2px 4px;
    line-height: 1.2;
    pointer-events: none;
}

/* ── Custom amount ──────────────────────────────────────────────────────────── */
.wcgcp-custom-amount-wrap {
    margin-top: 12px;
}

.wcgcp-custom-amount-wrap .wcgcp-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 6px;
}

/* ── Inputs ─────────────────────────────────────────────────────────────────── */
.wcgcp-field {
    position: relative;
    margin-bottom: 12px;
}

.wcgcp-field:last-child {
    margin-bottom: 0;
}

.wcgcp-field-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wcgcp-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #d8d8d8;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.wcgcp-input:focus {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.08);
}

/* Floating label inputs */
.wcgcp-input--floating {
    padding-top: 20px;
    padding-bottom: 8px;
}

.wcgcp-floating-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: #999;
    pointer-events: none;
    transition: top 0.15s, font-size 0.15s, color 0.15s, transform 0.15s;
}

/* When the input has content or is focused, float the label up */
.wcgcp-input--floating:focus + .wcgcp-floating-label,
.wcgcp-input--floating:not(:placeholder-shown) + .wcgcp-floating-label {
    top: 10px;
    transform: none;
    font-size: 0.72rem;
    color: #666;
}

/* Textarea */
.wcgcp-textarea {
    resize: vertical;
    min-height: 96px;
    padding-top: 14px;
}

/* Date input — ensure consistent look */
.wcgcp-input[type="date"] {
    padding-top: 20px;
    padding-bottom: 8px;
    cursor: pointer;
}

.wcgcp-input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.5;
    cursor: pointer;
}

/* ── Helper text ────────────────────────────────────────────────────────────── */
.wcgcp-helper-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #888;
    margin: 8px 0 0;
}

.wcgcp-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #888;
}

/* ── Optional label ─────────────────────────────────────────────────────────── */
.wcgcp-optional {
    font-weight: 400;
    color: #aaa;
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Submit section ─────────────────────────────────────────────────────────── */
.wcgcp-section--submit {
    margin-top: 8px;
}

.wcgcp-btn-add {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    text-align: center;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.wcgcp-btn-add:hover {
    background: #333;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.wcgcp-btn-add:active {
    transform: scale(0.98);
}

.wcgcp-btn-add:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Final note ─────────────────────────────────────────────────────────────── */
.wcgcp-final-note {
    text-align: center;
    font-size: 0.78rem;
    color: #aaa;
    margin: 10px 0 0;
}

/* ── Error message ──────────────────────────────────────────────────────────── */
.wcgcp-error-msg {
    background: #fff0f0;
    border: 1.5px solid #f0a0a0;
    border-radius: 8px;
    color: #c03030;
    font-size: 0.88rem;
    padding: 10px 14px;
    margin-bottom: 12px;
}

/* ── Success notice ─────────────────────────────────────────────────────────── */
.wcgcp-success-msg {
    background: #f0fff4;
    border: 1.5px solid #80c880;
    border-radius: 8px;
    color: #207020;
    font-size: 0.88rem;
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Transition helper ──────────────────────────────────────────────────────── */
.wcgcp-fade-out {
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* ── Responsive tweaks ──────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .wcgcp-preview-col {
        position: static;
    }

    .wcgcp-card-preview {
        max-width: 280px;
    }
}
