/* RVS Frontend Styles */

/* Main container */
.rvs-options {
    margin: 20px 0;
    clear: both;
}

.ff-acc-group {
    grid-column: span 12;
}

.ff-acc-group {
    background: #eef4ff;
    border: 1px solid #e5efff;
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(40, 90, 255, .06);
    margin: 10px 0 20px;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* Fieldset styles */
.rvs-attribute-fieldset {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 0;
    overflow: hidden;
}

.rvs-attribute-fieldset legend {
    display: none;
}

.rvs-attribute-fieldset.ff-acc legend {
    display: block;
    padding: 15px 20px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
}

/* Collapsible header */
.gacc__bar {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #f8f8f8;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #e0e0e0;
}

.gacc__bar:hover {
    background: #f0f0f0;
}

.gacc__icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gacc__icon img {
    max-width: 100%;
    max-height: 100%;
}

.gacc__title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.gacc__chev {
    font-size: 18px;
    color: #666;
    transition: transform 0.3s ease;
}

.is-open .gacc__chev {
    transform: rotate(180deg);
}

/* Panel content */
.gacc__panel {
    padding: 20px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}

.gacc__panel.collapsed {
    max-height: 0;
    padding: 0 20px;
    opacity: 0;
    overflow: hidden;
}

/* Radio/Checkbox styles */
.gfield_radio {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gchoice {
    position: relative;
    flex: 0 0 auto;
    min-width: 120px;
}

.gfield-choice-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.gform-field-label--type-inline {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 10px;
    min-height: 50px;
}

.gfield-choice-input:checked + .gform-field-label--type-inline {
    background: #f0f7ff;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.gfield-choice-input:hover + .gform-field-label--type-inline {
    border-color: #007cba;
}

/* Term image */
.rvs-term-image {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rvs-term-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Labels and prices */
.gfp-label-main {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.gfp-price-pill {
    background: #28a745;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-left: auto;
}

.gfp-old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 13px;
    margin-left: 8px;
}

/* Summary section */
.rvs-summary {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.rvs-total-price-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

.rvs-total-value {
    font-size: 24px;
    font-weight: bold;
    color: #28a745;
}

/* Cart section */
.rvs-cart-section {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    align-items: center;
}

.rvs-cart-section .quantity {
    flex: 0 0 auto;
}

.rvs-cart-section .quantity input {
    width: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

.rvs-cart-section .rvs-add-to-cart {
    flex: 1;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.rvs-cart-section .rvs-add-to-cart:hover {
    background: #005a87;
}

.rvs-cart-section .rvs-add-to-cart.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive styles */
@media (max-width: 768px) {
    .gfield_radio {
        flex-direction: column;
    }
    
    .gchoice {
        width: 100%;
    }
    
    .rvs-cart-section {
        flex-direction: column;
    }
    
    .rvs-cart-section .quantity,
    .rvs-cart-section .rvs-add-to-cart {
        width: 100%;
    }
}

/* Radio button style (single selection) */
/* input[type="radio"] + .gform-field-label--type-inline::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
} */

input[type="radio"]:checked + .gform-field-label--type-inline::before {
    border-color: #007cba;
    background: radial-gradient(circle, #007cba 40%, transparent 40%);
}

/* Checkbox style (multiple selection) */
input[type="checkbox"] + .gform-field-label--type-inline::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-right: 8px;
    flex-shrink: 0;
}

input[type="checkbox"]:checked + .gform-field-label--type-inline::before {
    border-color: #007cba;
    background: #007cba;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='white' d='M16.7 5.3l-9 9-4.4-4.4 1.4-1.4 3 3 7.6-7.6z'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 14px;
}

/* Style for conditional details */
.rvs-condition-details {
    margin-left: 25px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
}

.rvs-condition-details select {
    margin-right: 10px;
    min-width: 200px;
}

/* Style for hidden fieldsets */
.rvs-attribute-fieldset[style*="display: none"] {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Notification styles */
.rvs-notification {
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    animation: rvs-slideIn 0.3s ease-out;
}

.rvs-notification.rvs-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.rvs-notification.rvs-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

@keyframes rvs-slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}