/* WC Product Addons - Frontend Styles */

/* Container único para todos os grupos */
.product-addons-container {
    margin: 20px 0;
    padding: 25px;
    background: #fff;
    border: 1px solid #47735E;
    border-radius: 6px;
}

/* Cada grupo de adicional */
.product-addon-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e1e1e1;
}

.product-addon-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Header do grupo */
.product-addon-header {
    margin-bottom: 12px;
}

.product-addon-title {
    margin: 0 0 5px 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    line-height: 1.4;
}

.product-addon-subtitle {
    margin: 0;
    padding: 0;
    font-size: 11px;
    color: #999;
    line-height: 1.4;
}

/* ===== SELECT PADRÃO ===== */
.product-addon-select {
    width: 100%;
    border: 1px solid #E0E0E0;
    background-color: #ffffff;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.product-addon-select:hover {
    border-color: #47735E;
}

.product-addon-select:focus {
    outline: none;
    border-color: #47735E;
}

.product-addon-select option {
    padding: 8px;
}

/* Estado de selecionado */
.product-addon-group.has-selection .product-addon-select {
    border-color: #47735E;
    color: #47735E;
    background: #F5FCF8;
    font-weight: bold;
}

/* ===== SELECT COM IMAGEM ===== */
.product-addon-trigger {
    width: 100%;
    min-height: 60px;
    padding: 10px 15px 10px 10px;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 7px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0px !important;
    text-align: left !important;
}

.product-addon-trigger:hover,
.product-addon-trigger:focus {
    border-color: #47735E;
    background: #ffffff;
}

.product-addon-trigger .trigger-thumbnail {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #EDEBE9;
    border: 1px solid #E0E0E0;
}

.product-addon-trigger .trigger-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-addon-trigger .trigger-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.product-addon-trigger .trigger-title {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-addon-trigger .trigger-price {
    font-size: 13px;
    color: #666;
    font-weight: 400;
    line-height: 1.2;
}

.product-addon-trigger .trigger-icon {
    flex-shrink: 0;
    margin-left: 10px;
    display: flex;
    align-items: center;
}

.product-addon-trigger .trigger-icon svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    color: #666;
}

.product-addon-group.has-selection .product-addon-trigger {
    border-color: #47735E;
    background: #F5FCF8;
}

.product-addon-group.has-selection .product-addon-trigger .trigger-title {
    color: #47735E;
    font-weight: bold;
}

.product-addon-group.has-selection .product-addon-trigger .trigger-price {
    color: #47735E;
    font-weight: 600;
}

/* Modal Base */
.product-addon-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999999999999999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-addon-modal.active {
    display: block;
    opacity: 1;
}

.product-addon-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Prevenir scroll quando modal aberto */
body.modal-open {
    overflow: hidden;
}

/* Modal Content - Desktop (Modal Centralizado) */
.product-addon-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-addon-modal .modal-content.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Header */
.product-addon-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid #E0E0E0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.product-addon-modal .modal-title {
    margin: 0;
    font-size: 18px !important;
    font-weight: bold;
    color: #000000;
}

.product-addon-modal .modal-close {
    height: fit-content !important;
    min-height: fit-content !important;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #999999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: none !important;
    margin: 0 !important;
}

.product-addon-modal .modal-back {
    height: fit-content !important;
    min-height: fit-content !important;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: none !important;
    margin: 0 10px 0 0 !important;
}

.product-addon-modal .modal-close svg,
.product-addon-modal .modal-back svg {
    width: 20px;
    height: 20px;
}

/* Modal Body */
.product-addon-modal .modal-body {
    height: 100% !important;
    max-height: 100% !important;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Opções dos Adicionais */
.product-addon-modal .product-addon-option {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.product-addon-modal .product-addon-option:last-child {
    margin-bottom: 0;
}

.product-addon-modal .product-addon-option:hover {
    border-color: #47735E;
    background: #F5FCF8;
}

.product-addon-modal .product-addon-option.selected {
    border-color: #47735E;
    background: #F5FCF8;
}

/* Imagem da Opção */
.product-addon-modal .option-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    margin-right: 15px;
    overflow: hidden;
    border-radius: 6px;
    background: #EDEBE9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-addon-modal .option-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-addon-modal .no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #999;
    background: #EDEBE9;
}

/* Info da Opção */
.product-addon-modal .option-info {
    flex: 1;
}

.product-addon-modal .option-title {
    font-size: 16px;
    font-weight: bold;
    color: #000;
    margin-bottom: 4px;
    line-height: 1.4;
}

.product-addon-modal .option-price {
    font-size: 14px;
    color: #47735E;
    font-weight: bold;
    line-height: 1.4;
}

.product-addon-modal .product-addon-option[data-value=""] .option-price {
    color: #646464;
}

/* ===== MOBILE - Bottom Sheet ===== */
@media (max-width: 768px) {
    .product-addons-container {
        padding: 25px;
        margin: 15px 0;
    }
    
    .product-addon-group {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }
    
    /* Bottom Sheet Style */
    .product-addon-modal .modal-content {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(100%);
        width: 100%;
        max-width: 100%;
        max-height: 80vh !important;
        border-radius: 20px 20px 0 0;
    }
    
    .product-addon-modal .modal-content.show {
        transform: translateY(0);
    }
    
    .product-addon-modal .modal-header {
        padding: 20px;
        position: relative;
    }
    
    .product-addon-modal .modal-title {
        font-size: 18px !important;
    }
    
    .product-addon-modal .modal-body {
        height: 100% !important;
        max-height: 100% !important;
        padding: 20px;
        padding-bottom: 50px;
    }
    
    .product-addon-modal .product-addon-option {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .product-addon-modal .option-image {
        width: 100px;
        height: 100px;
        margin-right: 12px;
    }
    
    .product-addon-modal .option-title {
        font-size: 14px;
    }
    
    .product-addon-modal .option-price {
        font-size: 13px;
    }
}

/* Animações adicionais */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
/* Grid de opções de variação */
.variation-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 0;
}

.variation-option-box {
    background: #fff;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.variation-option-box:hover {
    border-color: #47735E;
    background: #F5FCF8;
    /* transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(71, 115, 94, 0.15); */
}

.variation-option-box span {
    word-break: break-word;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .variation-options-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        margin-bottom: 50px;
    }
    
    .variation-option-box {
        padding: 15px 10px;
        font-size: 13px;
        min-height: 50px;
    }
}
