/* ==========================================================================
   SNAPCOD TEMPLATE: CLASSIC LIGHT (Releasit-inspired)
   Clean white background, icon-prefix fields, inline product cards.
   ========================================================================== */

/* --- Popup wrapper --- */
.snapcod-tpl-classic .qcl-popup {
    background: #fff;
    color: #1e1e1e;
    border-radius: 12px;
    max-width: 520px;
    width: 94vw;
    margin: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.qcl-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    padding: 4px;
}
.qcl-close:hover { color: #333; }

/* --- Header --- */
.qcl-header {
    text-align: center;
    padding: 20px 20px 0;
}

.qcl-title {
    font-size: 17px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0;
}

/* --- Product / Offer cards --- */
.qcl-product-section {
    padding: 16px 20px 0;
}

.qcl-offer-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    position: relative;
}

.qcl-offer-card:hover { border-color: #93C5FD; }

.qcl-offer-card.qcl-offer-selected {
    border-color: #3B82F6;
    background: #EFF6FF;
}

.qcl-offer-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.qcl-offer-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.qcl-offer-img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #E5E7EB;
}

.qcl-offer-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.qcl-offer-label {
    font-size: 14px;
    font-weight: 500;
    color: #1e1e1e;
}

.qcl-offer-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

.qcl-badge-save {
    background: #DBEAFE;
    color: #2563EB;
}

.qcl-badge-discount {
    background: #DBEAFE;
    color: #2563EB;
}

.qcl-offer-price {
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.qcl-offer-price .snapcod-price-current {
    font-size: 15px;
    font-weight: 700;
    color: #1e1e1e;
}

.qcl-price-old {
    font-size: 13px;
    color: #9CA3AF;
    text-decoration: line-through;
    display: block;
}

.qcl-price-new {
    font-size: 15px;
    font-weight: 700;
    color: #1e1e1e;
    display: block;
}

/* --- Variations inline --- */
.qcl-variations {
    padding: 10px 14px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.qcl-variations .snapcod-variation-group {
    flex: 1;
    min-width: 120px;
}

.qcl-variations .snapcod-variation-label {
    color: #6B7280;
    font-size: 12px;
}

.qcl-variations .snapcod-variation-select,
.qcl-variations select {
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    color: #1e1e1e;
    background: #fff;
    width: 100%;
}

/* --- Order summary --- */
.qcl-summary {
    padding: 14px 20px;
    border-top: 1px solid #F3F4F6;
    border-bottom: 1px solid #F3F4F6;
}

.qcl-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #6B7280;
    padding: 4px 0;
}

.qcl-summary-total {
    font-size: 16px;
    font-weight: 700;
    color: #1e1e1e;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid #E5E7EB;
}

/* --- Form fields with icon prefix --- */
.qcl-form-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 0;
}

.qcl-field {
    display: flex;
    align-items: center;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 10px;
    transition: border-color 0.2s;
    overflow: hidden;
    position: relative;
}

.qcl-field:focus-within {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.qcl-field-full {
    align-items: flex-start;
}

.qcl-field-full .qcl-field-icon {
    padding-top: 14px;
}

.qcl-field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    flex-shrink: 0;
    padding: 12px 0 12px 14px;
}

.qcl-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 14px 12px 6px;
    font-size: 14px;
    color: #1e1e1e;
    background: transparent;
    font-family: inherit;
    min-width: 0;
}

.qcl-input::placeholder {
    color: #9CA3AF;
}

textarea.qcl-input {
    resize: vertical;
    min-height: 44px;
}

.qcl-field .snapcod-field-error {
    position: absolute;
    bottom: -16px;
    left: 44px;
    font-size: 11px;
    color: #EF4444;
}

/* --- Upsells --- */
.qcl-upsells {
    padding: 0 20px 4px;
}

.qcl-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 12px 0 8px;
}

.qcl-upsell-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.qcl-upsell-card:hover { border-color: #93C5FD; }
.qcl-upsell-card input:checked ~ * { color: #3B82F6; }

.qcl-upsell-img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.qcl-upsell-info {
    flex: 1;
    min-width: 0;
}

.qcl-upsell-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1e1e1e;
}

.qcl-upsell-add {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #6B7280;
    flex-shrink: 0;
}

/* --- Gift option --- */
.qcl-gift-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 13px;
    color: #6B7280;
}

.qcl-gift-option label { cursor: pointer; }

/* --- Instructions --- */
.qcl-instructions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 20px;
    font-size: 13px;
    color: #6B7280;
    background: #EFF6FF;
    margin: 8px 20px;
    border-radius: 8px;
}

.qcl-instructions p { margin: 0; }

/* --- Submit CTA --- */
.qcl-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 40px);
    margin: 16px 20px;
    padding: 14px 20px;
    background: #16A34A;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.qcl-submit-btn:hover {
    background: #15803D;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.qcl-submit-btn:active {
    transform: translateY(0);
}

/* --- Trust badges --- */
.qcl-trust {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px 20px;
    font-size: 12px;
    color: #9CA3AF;
}

.qcl-trust span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Success --- */
.qcl-success {
    text-align: center;
    padding: 40px 20px;
}

.qcl-success h3 {
    font-size: 20px;
    color: #1e1e1e;
    margin: 12px 0 6px;
}

.qcl-success-link {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    background: #3B82F6;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

/* --- Embedded specific --- */
.qcl-embedded {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin: 16px 0;
    width: 100%;
    box-sizing: border-box;
}

.qcl-embedded-header {
    padding: 16px 20px;
    border-bottom: 1px solid #F3F4F6;
}

.qcl-embedded-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0;
}

/* --- Classic responsive --- */
@media (max-width: 480px) {
    .qcl-popup { border-radius: 12px 12px 0 0; margin-top: auto; }
    .qcl-offer-left { gap: 8px; }
    .qcl-offer-img { width: 44px; height: 44px; }
    .qcl-offer-label { font-size: 13px; }
    .qcl-trust { gap: 10px; font-size: 11px; }
}


/* ==========================================================================
   SNAPCOD TEMPLATE: MINIMAL
   Ultra-clean, single-column, distraction-free design.
   ========================================================================== */

.snapcod-tpl-minimal .qcm-popup {
    background: #FAFAFA;
    color: #1e1e1e;
    border-radius: 16px;
    max-width: 400px;
    width: 92vw;
    margin: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

.qcm-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
}
.qcm-close:hover { color: #4B5563; }

/* --- Product row --- */
.qcm-product {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.qcm-product-img {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
}

.qcm-product-details {
    flex: 1;
    min-width: 0;
}

.qcm-product-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qcm-product-price {
    margin-top: 2px;
}

.qcm-product-price del {
    font-size: 13px;
    color: #9CA3AF;
    margin-right: 6px;
}

.qcm-product-price strong {
    font-size: 16px;
    color: #111827;
}

/* --- Qty pills --- */
.qcm-qty-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.qcm-pill {
    flex: 1;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 8px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    position: relative;
    text-align: center;
}

.qcm-pill input { position: absolute; opacity: 0; }

.qcm-pill span {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.qcm-pill small {
    font-size: 12px;
    color: #6B7280;
}

.qcm-pill-badge {
    position: absolute;
    top: -8px;
    right: -4px;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    font-style: normal;
}

.qcm-pill:hover { border-color: #93C5FD; }

.qcm-pill.qcm-pill-active,
.qcm-pill:has(input:checked) {
    border-color: #3B82F6;
    background: #EFF6FF;
}

/* --- Fields --- */
.qcm-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.qcm-field { position: relative; }

.qcm-input {
    width: 100%;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.qcm-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.qcm-input::placeholder {
    color: #9CA3AF;
}

textarea.qcm-input {
    resize: vertical;
    min-height: 50px;
}

/* --- Total line --- */
.qcm-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 12px;
    border-top: 1px solid #E5E7EB;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

/* --- Submit --- */
.qcm-submit {
    width: 100%;
    padding: 14px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.qcm-submit:hover {
    background: #1F2937;
    transform: translateY(-1px);
}

/* --- Minimal success --- */
.qcm-success {
    text-align: center;
    padding: 30px 0;
}

.qcm-success h3 {
    font-size: 18px;
    color: #111827;
    margin: 10px 0 4px;
}

.qcm-success-link {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 20px;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
}

/* --- Minimal variations --- */
.qcm-variations {
    margin-bottom: 14px;
}

.qcm-variations .snapcod-variation-group {
    margin-bottom: 8px;
}

.qcm-variations .snapcod-variation-label {
    color: #6B7280;
    font-size: 12px;
}

/* --- Minimal responsive --- */
@media (max-width: 480px) {
    .snapcod-tpl-minimal .qcm-popup {
        border-radius: 16px 16px 0 0;
        margin-top: auto;
        padding: 20px;
    }
    .qcm-pill { min-width: 50px; padding: 8px 4px; }
    .qcm-pill span { font-size: 14px; }
}


/* ==========================================================================
   SHARED — Offer card click behavior (JS adds .qcl-offer-selected)
   ========================================================================== */
.qcl-offer-card { cursor: pointer; }
.qcl-offer-card input[type="radio"] { display: none; }


/* ==========================================================================
   SHARED — Thank You / Success State (all templates)
   ========================================================================== */
.snapcod-ty-summary {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 16px auto;
    max-width: 320px;
}

.snapcod-tpl-dark .snapcod-ty-summary,
.snapcod-popup-dark .snapcod-ty-summary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.snapcod-ty-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    color: #6B7280;
}

.snapcod-tpl-dark .snapcod-ty-row,
.snapcod-popup-dark .snapcod-ty-row {
    color: rgba(255, 255, 255, 0.6);
}

.snapcod-ty-row + .snapcod-ty-row {
    border-top: 1px solid #F3F4F6;
}

.snapcod-tpl-dark .snapcod-ty-row + .snapcod-ty-row,
.snapcod-popup-dark .snapcod-ty-row + .snapcod-ty-row {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.snapcod-ty-row strong {
    color: #111827;
    font-weight: 600;
}

.snapcod-tpl-dark .snapcod-ty-row strong,
.snapcod-popup-dark .snapcod-ty-row strong {
    color: #fff;
}

.snapcod-ty-custom {
    text-align: center;
    font-size: 14px;
    color: #6B7280;
    margin: 12px 0 0;
    line-height: 1.5;
}

.snapcod-tpl-dark .snapcod-ty-custom,
.snapcod-popup-dark .snapcod-ty-custom {
    color: rgba(255, 255, 255, 0.6);
}

/* Ensure success state looks clean in all templates */
.snapcod-success,
.qcl-success,
.qcm-success {
    text-align: center;
    padding: 40px 24px;
}

.snapcod-success h3,
.qcl-success h3,
.qcm-success h3 {
    font-size: 20px;
    margin: 12px 0 6px;
}

.snapcod-success p,
.qcl-success p,
.qcm-success p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}
