/* SnapCod — Design 1 (popup + embedded). Colours: --sd1-btn, --sd1-btn-text, --sd1-offer. */

.sd1, .sd1 * { box-sizing: border-box; }
.sd1 {
    --sd1-border: #d3d3d3;
    --sd1-soft: #f9f9f9;
    --sd1-icon-bg: #e8e8e8;
    color: #000;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-align: start;
}

/* ---- Containers ---- */
.sd1-overlay.snapcod-overlay { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding: 15px 13px; align-items: flex-start; overflow-y: auto; }
.sd1.snapcod-popup {
    background: #fff;
    color: #000;
    border: 0;
    border-radius: 20px;
    padding: 10px 18px 18px;
    width: 100%;
    max-width: 480px;
    max-height: none;
    margin: auto;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .9);
    font-family: inherit;
    overflow: visible;
}
.sd1.sd1-embedded {
    clear: both;
    flex: 0 0 100%;
    width: 100%;
    border: 0;
    color: #000;
    font-family: inherit;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px 18px;
    margin: 16px 0;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .15);
}

/* ---- Header ---- */
.sd1-header { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; border-bottom: 1px solid #e5e5e5; }
.sd1-title { flex: 1; font-size: 13px; font-weight: 700; }
.sd1-close { background: none; border: 0; padding: 4px; margin: 0; cursor: pointer; color: #000; line-height: 0; }

/* ---- Product line ---- */
.sd1-line { display: flex; align-items: center; gap: 16px; padding: 15px 8px 12px; border-bottom: 1px solid #e5e5e5; margin-bottom: 16px; }
.sd1-line-img { position: relative; width: 60px; height: 60px; flex: 0 0 60px; }
.sd1-line-img img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; display: block; }
.sd1-qty-badge {
    position: absolute; top: 0; inset-inline-end: 0; transform: translate(50%, -50%);
    min-width: 21px; height: 21px; padding: 0 5px; border-radius: 21px;
    background: #7c7c7c; color: #fff; font-size: 12px; line-height: 21px; text-align: center;
}
[dir="rtl"] .sd1-qty-badge { transform: translate(-50%, -50%); }
.sd1-line-info { flex: 1; min-width: 0; }
.sd1-line-name { font-weight: 700; font-size: 14px; }
.sd1-line-variant { display: block; font-size: 12.25px; font-weight: 400; margin-top: 2px; }
.sd1-line-price { font-weight: 700; white-space: nowrap; }

/* ---- Offers (cards) ---- */
.sd1-offers { display: grid; gap: 10px; margin-bottom: 16px; }
.sd1-offers:empty { display: none; }
.sd1 .snapcod-offer-card.sd1-offer {
    position: relative; display: block; padding: 10px 12px; cursor: pointer;
    border: 1px solid #c9c9c9; border-radius: 8px; background: #fff;
    transition: border-color .15s, background-color .15s;
}
.sd1-offer > input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.sd1 .snapcod-offer-card.sd1-offer.snapcod-offer-selected {
    border: 2px solid var(--sd1-offer);
    background: color-mix(in srgb, var(--sd1-offer) 12%, #fff);
    padding: 9px 11px;
}
.sd1-offer-row { display: flex; align-items: center; gap: 12px; }
.sd1-offer-img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; flex: 0 0 52px; }
.sd1-offer-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.sd1-offer-title { font-weight: 700; font-size: 15px; line-height: 1.25; }
.sd1-offer-badge {
    display: inline-block; padding: 3px 8px; border-radius: 4px;
    background: var(--sd1-offer); color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.sd1-offer-price { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.sd1-offer-was { font-size: 13px; opacity: .6; }
.sd1-offer-now { font-size: 16px; font-weight: 700; }
.sd1-offer-slot:empty { display: none; }
.sd1-offer-slot { margin-top: 12px; cursor: default; }

/* Bundles inherit the offer look. */
.sd1 .snapcod-bundles { display: grid; gap: 10px; margin: 0; }
.sd1 .snapcod-bundle-card { border: 1px solid #c9c9c9; border-radius: 8px; color: #000; }
.sd1 .snapcod-bundle-card.snapcod-bundle-selected { border: 2px solid var(--sd1-offer); background: color-mix(in srgb, var(--sd1-offer) 12%, #fff); }
.sd1 .snapcod-bundle-card.snapcod-bundle-selected::before { border-color: var(--sd1-offer); background: var(--sd1-offer); }
.sd1 .snapcod-bundle-save, .sd1 .snapcod-bundle-free { background: var(--sd1-offer); border-radius: 4px; }

/* ---- Variant picker ---- */
.sd1-variants { display: grid; gap: 12px; }
.sd1-offers ~ .sd1-variants { margin-bottom: 16px; }
.sd1-attr-label { display: flex; justify-content: center; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.sd1-attr-value { font-style: normal; background: #f1f1f1; border-radius: 20px; padding: 2px 10px; }
.sd1-attr-value:empty { display: none; }
.sd1-attr-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sd1-opt {
    position: relative; margin: 0; cursor: pointer; font: inherit; color: #000; background: #fff;
    border: 1px solid #d5d5d5; border-radius: 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.is-buttons .sd1-opt { min-width: 42px; height: 36px; padding: 0 10px; font-size: 13px; font-weight: 700; }
.is-images .sd1-opt { width: 72px; height: 72px; padding: 4px; border-radius: 10px; }
.is-images .sd1-opt img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; display: block; }
.sd1-opt:hover { border-color: #000; }
.is-buttons .sd1-opt.is-active { background: #000; color: #fff; border-color: #000; }
.is-images .sd1-opt.is-active { border: 3px solid #000; padding: 2px; }
.is-images .sd1-opt.is-active::after {
    content: ""; position: absolute; inset: 0; border-radius: 7px;
    background: rgba(0, 0, 0, .35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 24px no-repeat;
}
.sd1-opt.is-unavailable { opacity: .35; text-decoration: line-through; }

/* ---- Upsells ---- */
.sd1-upsells { margin-bottom: 16px; }
.sd1-section-title { font-weight: 700; margin-bottom: 8px; }
.sd1-upsell { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px dashed #c9c9c9; border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.sd1-upsell.snapcod-upsell-selected { border-style: solid; border-color: var(--sd1-offer); background: color-mix(in srgb, var(--sd1-offer) 8%, #fff); }
.sd1-upsell img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.sd1-upsell-name { flex: 1; font-weight: 600; }
.sd1-upsell-price s { opacity: .55; font-size: 12px; }

/* ---- Summary ---- */
.sd1-summary { background: var(--sd1-soft); border: 1px solid var(--sd1-border); border-radius: 5px; padding: 4px 12px; margin-bottom: 16px; }
.sd1-sum-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.sd1-sum-row span { font-weight: 400; }
.sd1-sum-row b { font-size: 16px; font-weight: 900; }
.sd1-sum-total { border-top: 1px solid var(--sd1-border); margin-top: 4px; padding: 6px 0 4px; }
.sd1-sum-total span { font-weight: 700; }
.sd1 .sd1-sum-total b, .sd1 .snapcod-total-amount { font-size: 20px; font-weight: 700; color: #000 !important; }

/* ---- Fields ---- */
.sd1-fields { display: grid; gap: 14px; }
.sd1 .snapcod-field.sd1-field { flex-direction: row; }
.sd1 .sd1-field .snapcod-field-error:not(:empty) { display: block; }
.sd1-field { position: relative; display: flex; align-items: stretch; min-height: 46px; border: 1px solid #c4c4c4; border-radius: 8px; background: #fff; }
.sd1-field:focus-within { border-color: #000; box-shadow: 0 0 0 1px #000; }
.sd1-field:has(.snapcod-input-error) { border-color: #dc2626; }
.sd1-field-icon { display: flex; align-items: center; justify-content: center; width: 44px; flex: 0 0 44px; background: var(--sd1-icon-bg); color: #111; border-start-start-radius: 7px; border-end-start-radius: 7px; }
.sd1-field input, .sd1-field select, .sd1-field textarea {
    flex: 1; min-width: 0; width: 100%; border: 0 !important; outline: 0; box-shadow: none !important; background: transparent;
    padding: 0 14px; font: inherit; font-size: 14px; font-weight: 400; color: #000; min-height: 44px; margin: 0;
}
.sd1-field textarea { padding: 12px 14px; resize: vertical; }
.sd1-field input::placeholder, .sd1-field textarea::placeholder { color: #6f6f6f; }
.sd1-field .snapcod-field-error { position: absolute; top: 100%; inset-inline-start: 2px; font-size: 11px; color: #dc2626; }

/* ---- Message ---- */
.sd1-message { display: flex; align-items: center; gap: 10px; margin: 22px 4px 4px; font-size: 15px; font-weight: 600; }
.sd1-message svg { flex: 0 0 auto; color: #d6336c; }
.sd1-message p { margin: 0; }

/* ---- Buttons ---- */
.sd1-cta {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 50px; margin: 22px 0 0; padding: 12px 18px;
    border: 0; border-radius: 30px; cursor: pointer;
    background: var(--sd1-btn); color: var(--sd1-btn-text);
    font: inherit; font-size: 14px; font-weight: 600; text-transform: uppercase;
    box-shadow: 0 6px 10px -2px rgba(0, 0, 0, .45);
    animation: sd1-shake 3.5s ease-in-out infinite;
}
.sd1-cta:hover { filter: brightness(1.15); }
.sd1-cta:disabled { opacity: .7; cursor: wait; animation: none; }
@keyframes sd1-shake { 0%, 88%, 100% { transform: translateX(0); } 90% { transform: translateX(-3px); } 92% { transform: translateX(3px); } 94% { transform: translateX(-2px); } 96% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) { .sd1-cta { animation: none; } }
.sd1-whatsapp {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; margin-top: 12px; border-radius: 30px; text-decoration: none;
    background: #3fc35a; color: #fff !important; font-weight: 700; font-size: 15px;
}

/* ---- Success ---- */
.sd1-success { text-align: center; padding: 30px 10px; }
.sd1-success h3 { margin: 10px 0 6px; font-size: 20px; }
.sd1-success-link { display: inline-block; margin-top: 14px; padding: 10px 22px; border-radius: 30px; background: var(--sd1-btn); color: var(--sd1-btn-text) !important; text-decoration: none; }

@media (max-width: 480px) {
    .sd1-overlay.snapcod-overlay { padding: 15px 13px; }
    .is-images .sd1-opt { width: 64px; height: 64px; }
}

/* ---- Theme-proofing: themes style every input/button globally ---- */
.sd1 .sd1-field input,
.sd1 .sd1-field select,
.sd1 .sd1-field textarea {
    display: block !important;
    flex: 1 1 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    height: auto !important;
    min-height: 44px !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    color: #000 !important;
}
.sd1 .sd1-field textarea { padding: 12px 14px !important; min-height: 64px !important; }
.sd1 .sd1-field select { -webkit-appearance: auto; appearance: auto; }
.sd1 .sd1-field { margin: 0 !important; padding: 0 !important; }

.sd1 button.sd1-opt,
.sd1 button.sd1-close,
.sd1 button.sd1-cta {
    min-height: 0;
    letter-spacing: normal;
    text-shadow: none;
    width: auto;
}
.sd1 button.sd1-opt { line-height: 1 !important; text-transform: none !important; margin: 0 !important; }
.sd1 .is-buttons button.sd1-opt { padding: 0 10px !important; height: 36px !important; background: #fff !important; color: #000 !important; border-radius: 6px !important; }
.sd1 .is-buttons button.sd1-opt.is-active { background: #000 !important; color: #fff !important; }
.sd1 .is-images button.sd1-opt { padding: 4px !important; width: 72px !important; height: 72px !important; background: #fff !important; border-radius: 10px !important; }
.sd1 .is-images button.sd1-opt.is-active { padding: 2px !important; }
.sd1 button.sd1-close { background: transparent !important; border: 0 !important; padding: 4px !important; box-shadow: none !important; color: #000 !important; }
.sd1 button.sd1-cta { width: 100% !important; min-height: 50px !important; margin: 22px 0 0 !important; border: 0 !important; border-radius: 30px !important; background: var(--sd1-btn) !important; color: var(--sd1-btn-text) !important; }
@media (max-width: 480px) { .sd1 .is-images button.sd1-opt { width: 64px !important; height: 64px !important; } }

/* ---- Field errors: reserve room under the field instead of overlapping the next one ---- */
.sd1 .sd1-field .snapcod-field-error {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline-start: 2px;
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    color: #dc2626;
}
.sd1 .sd1-field:has(.snapcod-field-error:not(:empty)) { margin-bottom: 18px !important; }

/* ---- Checkbox fields (e.g. terms from checkout-field plugins) ---- */
.sd1 .sd1-check { position: relative; display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px; font-size: 13px; font-weight: 500; cursor: pointer; }
.sd1 .sd1-check input[type="checkbox"] { width: 18px !important; height: 18px !important; margin: 1px 0 0 !important; flex: 0 0 18px; accent-color: #000; }
.sd1 .sd1-check .snapcod-field-error { position: absolute; top: 100%; inset-inline-start: 28px; font-size: 12px; color: #dc2626; }
