/* ============================================
   Cabins Product Options – Frontend Styles
   ============================================ */

/* --- Sales message banner --- */
.cpo-sales-message {
    margin: 0 0 20px;
    padding: 14px 18px;
    background: #fff8e1;
    border: 2px solid #f9a825;
    border-left-width: 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1.05em;
    color: #5d4037;
    line-height: 1.5;
}

/* --- Options section on single product --- */
.cpo-product-options {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.cpo-product-options h3 {
    margin: 0 0 8px;
    font-size: 1.2em;
    font-weight: 600;
}

.cpo-intro-text {
    margin: 0 0 20px;
    font-size: 0.95em;
    color: #444;
    line-height: 1.6;
}

.cpo-option-group {
    margin-bottom: 20px;
}

.cpo-option-group h4 {
    margin: 0 0 10px;
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
}

.cpo-option-description {
    margin: -4px 0 12px;
    font-size: 0.9em;
    color: #666;
}

.cpo-option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.cpo-option-item {
    position: relative;
    display: flex;
    width: calc(33.333% - 7px);
    box-sizing: border-box;
}

.cpo-option-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cpo-option-item label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    text-align: center;
    width: 100%;
    font-size: 0.95em;
    white-space: normal;
    word-break: break-word;
}

.cpo-option-item label:hover {
    border-color: #999;
}

.cpo-option-item input[type="radio"]:checked + label {
    border-color: #2e7d32;
    background-color: #e8f5e9;
    font-weight: 600;
}

.cpo-option-price {
    display: block;
    font-size: 1em;
    color: #666;
    margin-top: 4px;
}

.cpo-option-price del {
    color: #999;
    margin-right: 4px;
}

.cpo-option-price ins {
    color: #c0392b;
    font-weight: 700;
    text-decoration: none;
}

.cpo-sale-badge {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    font-size: 0.72em;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cpo-option-item.cpo-option-on-sale label {
    border-color: #e8b4b0;
    background-color: #fdf5f4;
}

.cpo-option-item.cpo-option-on-sale input[type="radio"]:checked + label {
    border-color: #c0392b;
    background-color: #fdecea;
}

.cpo-option-group--info {
    background: #f0f4ff;
    border: 1px solid #c5cfe8;
    border-radius: 6px;
    padding: 16px 20px;
}

.cpo-option-group--info h4 {
    color: #1a3a6b;
}

.cpo-option-group--info .cpo-option-description {
    font-style: normal;
    color: #333;
    font-size: 0.95em;
    margin-bottom: 0;
}

/* --- Conditionally hidden groups --- */
.cpo-option-group.cpo-group-hidden {
    display: none;
}

/* --- "None" / no-selection option --- */
.cpo-option-item.cpo-option-none label {
    background: #fff;
    border-style: dashed;
}

/* --- Inline totals box --- */
.cpo-inline-totals {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 16px 20px;
    background: #1a3a6b;
    border-radius: 6px;
    color: #fff;
}

.cpo-inline-totals__label {
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cpo-inline-totals__value {
    font-size: 1.4em;
    font-weight: 700;
}

.cpo-inline-totals__value .woocommerce-Price-amount {
    color: #fff;
}

/* --- Sticky totals box --- */
.cpo-sticky-totals {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px 24px;
    min-width: 240px;
    max-width: 320px;
    font-size: 0.95em;
    transition: opacity 0.3s;
    display: none;
}

.cpo-sticky-totals h4 {
    margin: 0 0 12px;
    font-size: 1em;
    font-weight: 700;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.cpo-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: #555;
}

.cpo-totals-row.cpo-totals-final {
    border-top: 2px solid #333;
    margin-top: 8px;
    padding-top: 8px;
    font-weight: 700;
    font-size: 1.1em;
    color: #111;
}

/* --- Cart option meta --- */
.cpo-cart-options {
    margin-top: 6px;
    font-size: 0.88em;
    color: #555;
}

.cpo-cart-options dt {
    font-weight: 600;
    display: inline;
}

.cpo-cart-options dd {
    display: inline;
    margin: 0 0 0 4px;
}

.cpo-cart-options dd::after {
    content: '';
    display: block;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .cpo-sticky-totals {
        left: 10px;
        right: 10px;
        max-width: none;
        bottom: 10px;
    }

    .cpo-option-list {
        flex-direction: column;
    }

    .cpo-option-item {
        width: 100%;
    }

    .cpo-option-item label {
        min-width: auto;
    }
}

/* --- Option image thumbnails --- */
.cpo-option-item.cpo-has-image label {
    padding: 10px 14px 12px;
}

.cpo-option-thumb-wrap {
    display: block;
    margin-bottom: 8px;
    line-height: 0;
}

.cpo-option-thumb {
    width: 120px;
    height: 100px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

.cpo-option-thumb-zoom {
    position: absolute;
    top: 83px;
    right: 52px;
    z-index: 2;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.15s;
}

.cpo-option-thumb-zoom:hover {
    background: rgba(0, 0, 0, 0.8);
}

.cpo-option-thumb-zoom svg {
    width: 13px;
    height: 13px;
    fill: #fff;
    display: block;
}

/* --- Lightbox modal --- */
.cpo-lightbox {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.cpo-lightbox.is-open {
    display: flex;
}

.cpo-lightbox__backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.82);
}

.cpo-lightbox__content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
}

.cpo-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.cpo-lightbox__close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 30px;
    height: 30px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #333;
    transition: background-color 0.15s;
}

.cpo-lightbox__close:hover {
    background: #eee;
}
