/* Base Widget Container */
.nvd-mini {
    margin-bottom: 20px;
}

.nvd-widget-card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nvd-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nvd-body {
    flex-grow: 1;
    min-width: 0;
}

.nvd-icon-wrap {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.nvd-toggle-wrap {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Switch Styles */
.nvd-toggle-input {
    width: 36px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
    background-position: left center;
    background-repeat: no-repeat;
    background-size: contain;
    border: 1px solid rgba(0, 0, 0, .25);
    appearance: none;
    height: 20px;
    vertical-align: top;
    transition: background-position .15s ease-in-out;
    cursor: pointer;
    border-radius: 2em;
}

.nvd-toggle-input:checked {
    background-position: right center;
    background-color: #0d6efd;
    border-color: #0d6efd;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* Icons */
.navidium-shipping-icon {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Text Styles */
.nvd-widget-card h4 {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
}

.nvd-widget-card p {
    margin: 0 0 5px;
    font-size: 14px;
    color: #667;
}

.nvd-price {
    color: #333;
    font-weight: 700;
}

/* Logic Classes */
.nvd-selected,
.nvd-dis-selected {
    font-style: italic;
    margin-bottom: 0;
}

/* Cart block (positions outside totals table) */
.navidium-cart-block {
    margin-bottom: 1.5em;
}

.navidium-cart-block .navidium-protection-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.navidium-cart-block .navidium-protection-label {
    font-weight: 600;
}

.navidium-cart-block .description {
    margin-left: 0;
}

/* Existing Legacy Styles */
.navidium-shipping-protection-widget.is-updating {
    opacity: 0.6;
    pointer-events: none;
}

@media (max-width: 640px) {
    .nvd-row {
        align-items: flex-start;
    }

    .nvd-toggle-wrap {
        margin-left: 0;
    }
}

/* Hide Navidium protection line on block cart page only (checkout summary still shows it). */
.wc-block-cart .navidium-hide-cart-line-item,
.wc-block-cart-items .navidium-hide-cart-line-item,
tr.navidium-hide-cart-line-item {
    display: none !important;
}
/*
 * Cart toggle switch.
 * Previously referenced as .switch / .slider from the markup but never defined here,
 * so the classic cart toggle rendered as a bare unstyled checkbox.
 */
.nvd-cart-toggle-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.nvd-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex: none;
}

.nvd-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.nvd-slider {
    position: absolute;
    inset: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.2s ease;
    pointer-events: none;
}

.nvd-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.nvd-switch input:checked + .nvd-slider {
    background-color: #1a7f37;
}

.nvd-switch input:checked + .nvd-slider::before {
    transform: translateX(20px);
}

.nvd-switch input:focus-visible + .nvd-slider {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}
