/* ==========================================================
   Custom Name Stickers for WooCommerce — Frontend Styles
   ========================================================== */

/* ── Wrapper ── */
.cns-customization-wrap {
    margin: 20px 0;
    font-family: inherit;
}

/* ── Live Preview ── */
.cns-preview-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 340px;
    min-height: 110px;
    border-radius: 12px;
    margin: 0 auto 22px;
    box-shadow: 0 4px 18px rgba(0,0,0,.13);
    overflow: hidden;
    border: 2px dashed rgba(0,0,0,.08);
    transition: box-shadow .25s;
}

.cns-preview-wrap:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
}

/* Diagonal "cut" corners to mimic a sticker */
.cns-preview-wrap::before,
.cns-preview-wrap::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
}
.cns-preview-wrap::before {
    top: 0; left: 0;
    border-top: 18px solid rgba(0,0,0,.06);
    border-right: 18px solid transparent;
}
.cns-preview-wrap::after {
    bottom: 0; right: 0;
    border-bottom: 18px solid rgba(0,0,0,.06);
    border-left: 18px solid transparent;
}

.cns-preview-sticker {
    text-align: center;
    padding: 20px 28px;
    width: 100%;
    line-height: 1.4;
    word-break: break-word;
    transition: all .2s ease;
}

.cns-preview-line {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: .04em;
    min-height: 1.4em;
    opacity: .35;               /* dim until user types */
    transition: opacity .2s;
}

.cns-preview-line.cns-has-value {
    opacity: 1;
}

.cns-preview-line + .cns-preview-line {
    margin-top: 4px;
    font-size: 18px;
    font-weight: 400;
}

.cns-preview-label {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .4;
    font-family: sans-serif;
}

/* ── Fields ── */
.cns-fields {
    width: 100%;
}

.cns-field-row {
    margin: 0 0 14px !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cns-field-row label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cns-field-row label .required {
    color: #e2401c;
}

.cns-name-input {
    width: 100% !important;
    padding: 10px 14px !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    transition: border-color .2s, box-shadow .2s !important;
    background: #fff !important;
    box-sizing: border-box !important;
}

.cns-name-input:focus {
    border-color: #96588a !important;
    box-shadow: 0 0 0 3px rgba(150, 88, 138, .12) !important;
    outline: none !important;
}

.cns-name-input.cns-error {
    border-color: #e2401c !important;
    box-shadow: 0 0 0 3px rgba(226, 64, 28, .10) !important;
}

/* ── Character counter ── */
.cns-char-count {
    font-size: 12px;
    color: #999;
    text-align: right;
    display: block;
}

.cns-char-count.cns-near-limit {
    color: #e2401c;
    font-weight: 600;
}

/* ── Hint text ── */
.cns-hint-text {
    font-size: 13px;
    color: #777;
    margin-top: -6px !important;
    margin-bottom: 10px !important;
    padding-left: 2px;
}

/* ── Responsive ── */
@media ( max-width: 600px ) {
    .cns-preview-wrap {
        max-width: 100%;
    }
    .cns-preview-line {
        font-size: 22px;
    }
}
