/**
 * Post Guard Optional Add-Ons — Frontend Styles
 * Extracted from optional-addons.php (was inline via wp_head).
 */
.bpt-product-addons { margin: 15px 0; }
.addons-title { display: block; margin-bottom: 5px; font-weight: 600; font-size: 1.1em; }
.addons-subtitle { display: block; margin-bottom: 10px; font-size: 0.9em; color: #666; font-style: italic; }
.addons-groups { margin-top: 10px; }

/* Group box */
.addon-group-box {
    margin-bottom: 12px; padding: 14px 16px;
    border: 1px solid #ddd; border-radius: 6px; background: #f9f9f9;
}
.addon-group-box:last-child { margin-bottom: 0; }
.addon-group-title { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.95em; color: #333; }
.addon-group-description { display: block; margin-bottom: 10px; font-size: 0.85em; color: #666; }
.addon-group-options { margin-top: 6px; }

/* Clear radio link */
.addon-clear-radio {
    display: inline-block; margin-top: 6px; font-size: 0.85em;
    color: #0073aa; text-decoration: none; cursor: pointer;
}
.addon-clear-radio:hover { color: #005177; text-decoration: underline; }

/* Addon option */
.addon-option-wrapper { margin-bottom: 8px; }
.addon-option-wrapper:last-child { margin-bottom: 0; }
.addon-option { display: block; cursor: pointer; }
.addon-option-wrapper.has-thumbnail .addon-option {
    display: flex; align-items: center; gap: 10px;
}
.addon-option input[type="checkbox"],
.addon-option input[type="radio"] { margin-right: 8px; }
.addon-option-wrapper.has-thumbnail .addon-option input[type="checkbox"],
.addon-option-wrapper.has-thumbnail .addon-option input[type="radio"] { margin-right: 0; flex-shrink: 0; }

.addon-thumbnail { flex-shrink: 0; }
.addon-thumbnail img { max-width: 60px; max-height: 60px; border: 1px solid #ddd; border-radius: 4px; display: block; }
.addon-thumbnail a { display: block; transition: opacity 0.3s; }
.addon-thumbnail a:hover { opacity: 0.8; }

.addon-label-wrapper { display: inline; }
.addon-option-wrapper.has-thumbnail .addon-label-wrapper { flex: 1; min-width: 0; }
.addon-price-text { display: inline; }
.addon-price-unit { font-size: 0.9em; color: #666; }
.addon-link { color: #0073aa; text-decoration: none; transition: color 0.2s; }
.addon-link:hover { color: #005177; text-decoration: underline; }

/* Qty field */
.addon-qty-field {
    margin: 6px 0 4px 26px; padding: 8px 12px;
    background: #fff; border: 1px solid #e0e0e0; border-radius: 4px;
}
.addon-option-wrapper.has-thumbnail .addon-qty-field { margin-left: 96px; }
.addon-qty-inner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.addon-qty-label { font-size: 13px; font-weight: 600; color: #333; }
.addon-qty-controls {
    display: flex; align-items: center; border: 1px solid #ccc; border-radius: 4px; overflow: hidden;
}
.addon-qty-minus, .addon-qty-plus {
    width: 32px; height: 32px; border: none; background: #f5f5f5; cursor: pointer;
    font-size: 16px; line-height: 32px; text-align: center; color: #333; padding: 0; transition: background 0.2s;
}
.addon-qty-minus:hover, .addon-qty-plus:hover { background: #e0e0e0; }
.addon-qty-input {
    width: 48px; height: 32px; text-align: center; border: none;
    border-left: 1px solid #ccc; border-right: 1px solid #ccc;
    font-size: 14px; -moz-appearance: textfield; padding: 0;
}
.addon-qty-input::-webkit-outer-spin-button,
.addon-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.addon-coverage-hint { font-size: 12px; color: #666; font-style: italic; }
.addon-suggested-qty { color: #0073aa; font-weight: 600; }

/* Tooltip */
.addon-tooltip-trigger {
    display: inline-block; margin-left: 5px; cursor: pointer;
    position: relative; font-size: 14px; vertical-align: middle; flex-shrink: 0;
}
.addon-tooltip-content {
    position: absolute; bottom: calc(100% + 10px); left: 50%;
    transform: translateX(-50%) scale(0.9); background: #333; color: #fff;
    padding: 8px 12px; border-radius: 4px; font-size: 13px; line-height: 1.4;
    width: 200px; max-width: 90vw; white-space: normal; word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); opacity: 0; visibility: hidden;
    transition: all 0.3s ease; z-index: 1000; pointer-events: none;
}
.addon-tooltip-content::after {
    content: ''; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%); border: 5px solid transparent; border-top-color: #333;
}
@media (hover: hover) and (pointer: fine) {
    .addon-tooltip-trigger:hover .addon-tooltip-content {
        opacity: 1; visibility: visible; transform: translateX(-50%) scale(1);
    }
}
.addon-tooltip-content.visible {
    opacity: 1; visibility: visible; transform: translateX(-50%) scale(1); pointer-events: auto;
}

@media (max-width: 768px) {
    .addon-option-wrapper.has-thumbnail .addon-option { flex-wrap: nowrap; }
    .addon-option-wrapper.has-thumbnail .addon-label-wrapper { flex: 1; min-width: 0; }
    .addon-option-wrapper.has-thumbnail .addon-price-text { display: block; }
    .addon-thumbnail img { max-width: 70px; max-height: 70px; }
    .addon-qty-field { margin-left: 0 !important; }
    .addon-qty-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
    .addon-tooltip-content {
        position: fixed; width: calc(100vw - 40px); max-width: 300px;
        left: 20px !important; right: 20px !important; bottom: auto; top: auto;
        transform: scale(0.9); margin: 0;
    }
    .addon-tooltip-content.visible { transform: scale(1); }
    .addon-tooltip-content::after { display: none; }
}
.addon-tooltip-trigger:focus-visible { outline: 2px solid #0073aa; outline-offset: 2px; border-radius: 2px; }
