/* ==========================================================================
   Wildanet Add-ons UI — Card-based layout
   ========================================================================== */

/* ── Page background ────────────────────────────────────────────────────── */
.wildanet-addons-container {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #123459;
    max-width: 860px;
    margin: 0 auto 120px;
    padding: 0 20px;
    position: relative;
}

/* ── Header area ────────────────────────────────────────────────────────── */
.addons-header {
    text-align: center;
    margin-bottom: 36px;
}

.addons-header-title {
    font-size: 28px;
    font-weight: 700;
    color: #123459;
    margin: 0 0 8px;
    line-height: 1.25;
}

.addons-header-subtitle {
    font-size: 15px;
    color: #4a6a8a;
    margin: 0;
    line-height: 1.5;
}

.addons-header-subtitle strong {
    font-weight: 700;
}

/* ── Card grid ──────────────────────────────────────────────────────────── */
.addons-card-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Individual card ────────────────────────────────────────────────────── */
.addon-card {
    background: #ffffff;
    min-width: 0;
    border-radius: 20px;
    padding: 28px 32px;
    box-shadow: 0 2px 16px rgba(18, 52, 89, 0.07);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
    text-align: left;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    position: relative;
}

/* Left side: icon + image + price stacked vertically */
.addon-card-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 180px;
    text-align: center;
}

/* Right side: title + description + toggle + options */
.addon-card-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Stack vertically on mobile */
@media (max-width: 600px) {
    .addon-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 18px;
    }

    .addon-card-left {
        width: 100%;
    }
}

.addon-card:hover {
    box-shadow: 0 4px 24px rgba(18, 52, 89, 0.12);
}

.addon-card.is-in-cart {
    box-shadow: 0 4px 24px rgba(49, 164, 165, 0.18);
}

/* Card icon */
.addon-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0f5f5, #c5ede0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 18px;
    color: #1a8a7d;
}

/* Card title */
.addon-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #123459;
    margin: 0 0 6px;
    line-height: 1.3;
}

/* Card description */
.addon-card-desc {
    font-size: 13px;
    color: #5a7a9a;
    line-height: 1.5;
    margin: 0 0 16px;
}

/* Card image */
.addon-card-image {
    width: 100%;
    max-width: 180px;
    margin: 0 auto 12px;
}

.addon-card-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ── Price area inside card ─────────────────────────────────────────────── */
.addon-card-price {
    font-size: 22px;
    font-weight: 800;
    color: #123459;
    margin-bottom: 4px;
}

.addon-card-price-suffix {
    font-size: 12px;
    color: #6a8aaa;
    margin-bottom: 14px;
    display: block;
}

/* ── Toggle switch for simple products ──────────────────────────────────── */
.addon-toggle-wrap {
    width: 100%;
}

.addon-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 50px;
    border: 2px solid #e0e5ea;
    background: #f7f8fa;
    transition: all 0.3s ease;
    user-select: none;
}

.addon-toggle.is-active {
    background: #e6f7f1;
    border-color: #2bb77a;
}

/* Toggle slider */
.toggle-slider {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: #ccd3da;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.addon-toggle.is-active .toggle-slider {
    background: #2bb77a;
}

.addon-toggle.is-active .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: #6a8aaa;
    transition: color 0.3s ease;
}

.addon-toggle.is-active .toggle-label {
    color: #1a7a52;
}

/* Checkmark icon in toggle */
.toggle-check {
    display: none;
    color: #2bb77a;
    font-weight: 700;
    font-size: 14px;
}

.addon-toggle.is-active .toggle-check {
    display: inline;
}

/* ── Radio options for variable products ────────────────────────────────── */
.addon-radio-options {
    width: 100%;
    text-align: left;
    margin-top: 4px;
}

.addon-radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 4px;
}

.addon-radio-option:last-child {
    margin-bottom: 0;
}

.addon-radio-option:hover {
    background: #f0f4f8;
}

.addon-radio-option.is-selected {
    background: #e6f7f1;
}

/* Custom radio circle */
.radio-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ccd3da;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.addon-radio-option.is-selected .radio-circle {
    border-color: #2bb77a;
    background: #2bb77a;
}

.addon-radio-option.is-selected .radio-circle::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.radio-label {
    font-size: 13px;
    font-weight: 600;
    color: #123459;
    flex: 1;
}

.radio-price {
    font-size: 13px;
    font-weight: 700;
    color: #1a8a7d;
    white-space: nowrap;
}

.addon-radio-option.is-no-option .radio-price {
    color: #8a9ab0;
}

/* ── Sticky footer bar ──────────────────────────────────────────────────── */
.addons-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #e8ecf0;
    box-shadow: 0 -4px 20px rgba(18, 52, 89, 0.08);
    z-index: 9999;
    padding: 14px 0;
}

.addons-footer-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Basket summary rows ─────────────────────────────────────────────── */
.footer-basket-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8ecf0;
}

.footer-basket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #4a6b8a;
    line-height: 1.4;
}

.footer-basket-item.is-package {
    font-weight: 700;
    color: #123459;
}

.footer-basket-item.is-package .footer-item-price {
    font-weight: 800;
}

.footer-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 12px;
}

.footer-item-qty {
    font-size: 11px;
    color: #8aa4be;
    margin-left: 4px;
}

.footer-item-price {
    font-weight: 600;
    color: #123459;
    white-space: nowrap;
}

.footer-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-total-label {
    font-size: 14px;
    color: #6a8aaa;
}

.footer-total-price {
    font-size: 26px;
    font-weight: 800;
    color: #123459;
}

.footer-total-price .currency-symbol {
    font-size: 18px;
    font-weight: 700;
}

.btn-continue-checkout,
.btn-continue-checkout:link,
.btn-continue-checkout:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a8a7d;
    color: #ffffff !important;
    border: none;
    border-radius: 50px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    text-decoration: none !important;
    font-family: inherit;
}

.btn-continue-checkout:hover {
    background: #157a6e;
    transform: translateY(-1px);
    color: #ffffff !important;
    text-decoration: none !important;
}

.btn-continue-checkout:active {
    transform: translateY(0);
}

.btn-continue-checkout.is-disabled {
    background: #b0bec5;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.8;
    font-size: 13px;
    font-weight: 600;
}

/* ── Loading state ──────────────────────────────────────────────────────── */
.addon-card.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.addon-toggle.is-loading .toggle-slider {
    animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .addons-header-title {
        font-size: 22px;
    }

    .addon-card {
        padding: 22px 18px 20px;
    }

    .addon-card-price {
        font-size: 20px;
    }

    .addons-footer-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .btn-continue-checkout {
        width: 100%;
        justify-content: center;
    }
}

/* ── Hide default WooCommerce price HTML formatting ─────────────────────── */
.addon-card-price .woocommerce-Price-currencySymbol {
    font-size: 0.7em;
}

.addon-card-price del,
.addon-card-price ins {
    text-decoration: none;
}

/* ── Multi-instance merge ────────────────────────────────────────────────
   When the page has 2+ shortcode instances (e.g. separate Elementor
   sections), addons.js merges all cards into the first grid on DOMReady
   and hides the extra empty containers.
   ──────────────────────────────────────────────────────────────────────── */

/* ── Phoneline+ multi-step card ────────────────────────────────────────── */
.phoneline-step {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0eaf2;
    animation: stepReveal 0.3s ease;
}

@keyframes stepReveal {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.phoneline-step-label {
    font-size: 12px;
    font-weight: 700;
    color: #6a8aaa;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Handset type pills */
.handset-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.handset-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px;
    border: 2px solid #dce6f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.handset-option:hover {
    border-color: #1a8a7d;
    background: #f0faf9;
}

.handset-option.is-selected {
    border-color: #1a8a7d;
    background: #e8f7f5;
    box-shadow: 0 0 0 1px #1a8a7d;
}

.handset-option-label {
    font-size: 12px;
    font-weight: 700;
    color: #123459;
    text-align: center;
    word-break: break-word;
}

.handset-option-detail {
    font-size: 10px;
    color: #1a8a7d;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* Shared step heading & divider (used by both simple and phoneline cards) */
.step-heading {
    font-size: 12px;
    font-weight: 700;
    color: #6a8aaa;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    text-align: center;
}

.step-divider {
    border: none;
    border-top: 1px solid #e0eaf2;
    margin: 0 0 16px;
}

.simple-qty-step {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0eaf2;
}

/* Quantity stepper */
.qty-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.qty-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 50% !important;
    border: 2px solid #123549 !important;
    background: #fff !important;
    font-size: 20px;
    font-weight: 700;
    color: #123549;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1;
    outline: none;
    padding: 0 !important;
    -webkit-appearance: none;
    appearance: none;
}

.qty-btn:hover:not(:disabled) {
    border-color: #48A9A6 !important;
    background: #48A9A6 !important;
    color: #fff;
}

.qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.qty-value {
    font-size: 28px;
    font-weight: 800;
    color: #123459;
    min-width: 36px;
    text-align: center;
}

/* Responsive: stack handset options on small screens */
@media (max-width: 360px) {
    .handset-type-options {
        flex-direction: column;
    }
}