/**
 * YITH Radio Options - Modern Card Style
 *
 * Transforms radio button options into clean, clickable cards
 * with hidden radio buttons and visual selection states.
 *
 * Usage: Include in theme or add to Additional CSS
 */

/* ===========================================
   GRID LAYOUT - 3 columns
   =========================================== */
.yith-wapo-addon-type-radio .options {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
    .yith-wapo-addon-type-radio .options {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .yith-wapo-addon-type-radio .options {
        grid-template-columns: 1fr !important;
    }
}

/* ===========================================
   CARD STYLING
   =========================================== */
.yith-wapo-addon-type-radio .yith-wapo-option {
    position: relative;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%; /* Equal height cards */
}

/* Hover state */
.yith-wapo-addon-type-radio .yith-wapo-option:hover {
    border-color: #009245;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

/* Selected state */
.yith-wapo-addon-type-radio .yith-wapo-option.selected {
    border-color: #009245;
    background: linear-gradient(to bottom, #f0fff5, #fff);
    box-shadow: 0 0 0 1px #009245, 0 2px 8px rgba(0,146,69,0.15);
}

/* Checkmark indicator on selected */
.yith-wapo-addon-type-radio .yith-wapo-option.selected::before {
    content: "✓";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #009245;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
}

/* Focus state for keyboard accessibility */
.yith-wapo-addon-type-radio .yith-wapo-option:focus-within {
    outline: 2px solid #009245;
    outline-offset: 2px;
}

/* ===========================================
   HIDE RADIO BUTTON VISUALLY (but keep clickable)
   =========================================== */

/* Make entire card the click target */
.yith-wapo-addon-type-radio .yith-wapo-option {
    position: relative;
    cursor: pointer;
}

/* Hide the radiobutton visual indicator */
.yith-wapo-addon-type-radio .radiobutton {
    position: static !important;
}

/* Make the actual input cover the entire card - invisible but clickable */
.yith-wapo-addon-type-radio .radiobutton input[type="radio"],
.yith-wapo-addon-type-radio input[type="radio"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
    z-index: 10 !important;
    margin: 0 !important;
}

/* Make the label cover the entire card for clicks */
.yith-wapo-addon-type-radio .yith-wapo-option .label {
    position: static;
}

.yith-wapo-addon-type-radio .yith-wapo-option label.yith-wapo-addon-label {
    cursor: pointer;
    display: block;
}

/* Ensure label click triggers the input */
.yith-wapo-addon-type-radio .radio-button-container {
    display: block;
    width: 100%;
}

/* ===========================================
   IMAGE STYLING - Consistent sizes
   =========================================== */
.yith-wapo-addon-type-radio .image-container {
    width: 100%;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.yith-wapo-addon-type-radio .image-container .image {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.yith-wapo-addon-type-radio img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* ===========================================
   LABEL & TEXT STYLING
   =========================================== */
.yith-wapo-addon-type-radio .option-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.yith-wapo-addon-type-radio .yith-wapo-addon-label {
    font-size: 13px;
    line-height: 1.35;
    color: #333;
    display: block;
    width: 100%;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    max-height: none !important;
}

/* Separate the label text from price */
.yith-wapo-addon-type-radio .radio-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
}

/* Push price to bottom of card */
.yith-wapo-addon-type-radio .option-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.yith-wapo-addon-type-radio .yith-wapo-addon-label {
    flex: 1;
}

/* ===========================================
   PRICE STYLING - Inline and clean
   =========================================== */
.yith-wapo-addon-type-radio .option-price {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    color: #009245;
    white-space: nowrap;
}

/* Selected state price */
.yith-wapo-addon-type-radio .yith-wapo-option.selected .option-price {
    background: #009245;
    color: #fff;
}

/* Hide brackets around price */
.yith-wapo-addon-type-radio .option-price .brackets {
    display: none;
}

/* Hide the + sign, keep it cleaner */
.yith-wapo-addon-type-radio .option-price .sign {
    display: none;
}

/* ===========================================
   DISABLED STATE
   =========================================== */
.yith-wapo-addon-type-radio .yith-wapo-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===========================================
   NO IMAGE VARIANT - Compact style
   =========================================== */
.yith-wapo-addon-type-radio .yith-wapo-option:not(:has(.image-container)) {
    padding: 10px 14px;
}

.yith-wapo-addon-type-radio .yith-wapo-option:not(:has(.image-container)) .option-container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
}

.yith-wapo-addon-type-radio .yith-wapo-option:not(:has(.image-container)) .yith-wapo-addon-label {
    flex-direction: row;
    gap: 8px;
}

.yith-wapo-addon-type-radio .yith-wapo-option:not(:has(.image-container)) .option-price {
    margin-top: 0;
}
