/**
 * Royal Kids - Estilos de Extras de Cumpleaños
 * @version 1.0.0
 * @since 3.8.87
 */

/* ============================================
   PASO DE EXTRAS EN FORMULARIO
   ============================================ */

.rk-optional-badge {
    font-size: 12px;
    font-weight: normal;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

.rk-extras-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Tarjeta de Extra */
.rk-extra-card {
    background: #f5f5f5;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.rk-extra-card:hover {
    border-color: #ccc;
}

.rk-extra-card.rk-extra-selected {
    border-color: #4caf50;
    background: #fff;
}

/* Header con Toggle Switch */
.rk-extra-header-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: inherit;
}

.rk-extra-title {
    margin: 0;
    font-size: 18px;
    padding: 5px 0;
    color: #333;
    flex: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.rk-extra-image-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.rk-extra-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Toggle Switch estilo iOS */
.rk-toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.rk-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.rk-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 28px;
}

.rk-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.rk-toggle-switch input:checked + .rk-toggle-slider {
    background-color: #4caf50;
}

.rk-toggle-switch input:checked + .rk-toggle-slider:before {
    transform: translateX(24px);
}

/* Contenido colapsable */
.rk-extra-content {
    padding: 0 20px 20px 20px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

.rk-extra-description {
    margin: 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Header del Extra (versión legacy, mantener compatibilidad) */
.rk-extra-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.rk-extra-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.rk-extra-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rk-extra-info h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rk-extra-icon {
    font-size: 24px;
}

/* Opciones del Extra */
.rk-extra-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.rk-extra-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Grid de opciones con precio */
.rk-price-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.rk-price-option {
    cursor: pointer;
}

.rk-price-option input {
    display: none;
}

.rk-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
}

.rk-price-option input:checked + .rk-option-content {
    border-color: #d81d23;
    background: linear-gradient(135deg, #fff5f5, #ffebee);
}

.rk-option-value {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.rk-option-price {
    font-size: 18px;
    font-weight: bold;
    color: #d81d23;
    margin: 5px 0;
}

.rk-option-desc {
    font-size: 11px;
    color: #888;
}

/* Selects secundarios */
.rk-extra-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
}

.rk-extra-select:focus {
    border-color: #d81d23;
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Control de cantidad */
.rk-extra-quantity {
    display: flex;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.rk-quantity-control {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.rk-qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #d81d23;
    font-size: 20px;
    color: #FFF;
    cursor: pointer;
    transition: background 0.2s;
}

.rk-qty-btn:hover {
    background: #e0e0e0;
}

.rk-qty-btn:active {
    background: #d0d0d0;
}

.rk-qty-input {
    width: 80px;
    text-align: center;
    border: none;
    font-size: 16px;
    font-weight: 600;
    background: transparent;
}

.rk-qty-input:focus {
    outline: none;
}

/* Footer del Extra */
.rk-extra-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.rk-extra-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.rk-extra-toggle input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.rk-toggle-text {
    font-weight: 600;
    color: #333;
}

.rk-extra-subtotal {
    text-align: right;
}

.rk-subtotal-label {
    font-size: 12px;
    color: #666;
    display: block;
}

.rk-subtotal-value {
    font-size: 20px;
    font-weight: bold;
    color: #4caf50;
}

/* ============================================
   RESUMEN DE EXTRAS
   ============================================ */
#rk-summary-extras-container {
    background: #ffffff;
    border-top: 1px solid #ffd0d2;
    padding: 12px 24px;
    margin: 0 -25px;
    border-bottom: 1px solid #ffd0d2;
}
.rk-summary-extras-title {
    font-weight: 600;
    color: #333;
}

#rk-summary-extras-list {
    font-size: 14px;
}

#rk-summary-extras-list .rk-extra-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    color: #555;
}

#rk-summary-extras-list .rk-extra-item-name {
    flex: 1;
}

#rk-summary-extras-list .rk-extra-item-price {
    font-weight: 700;
    color: #0a0a0a;
}

.rk-summary-extras-total,
.rk-summary-grand-total {
    border-radius: 6px;
    margin-top: 5px;
}

/* ============================================
   MI CUENTA - SECCIÓN DE EXTRAS
   ============================================ */

.rk-birthday-extras-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.rk-extras-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.rk-extras-section-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.rk-add-extra-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rk-add-extra-btn:hover {
    background: #388e3c;
    transform: translateY(-1px);
}

/* Lista de extras contratados */
.rk-extras-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Grupo de extras */
.rk-extras-group {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.rk-extras-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
    border-bottom: 1px solid #eee;
}

.rk-extras-group-icon {
    font-size: 20px;
}

.rk-extras-group-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.rk-extras-group-qty {
    font-size: 13px;
    color: #888;
}

.rk-extras-group-total {
    font-weight: bold;
    color: #4caf50;
}

.rk-contracted-extra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
}

.rk-contracted-extra-info {
    flex: 1;
}

.rk-contracted-extra-name {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rk-contracted-extra-details {
    font-size: 13px;
    color: #666;
    margin-top: 3px;
}

.rk-contracted-extra-price {
    text-align: right;
}

.rk-contracted-extra-amount {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.rk-contracted-extra-status {
    font-size: 12px;
    margin-top: 2px;
}

.rk-contracted-extra-status.paid {
    color: #4caf50;
}

.rk-contracted-extra-status.pending {
    color: #ff9800;
}

/* Sin extras */
.rk-no-extras {
    text-align: center;
    padding: 20px;
    color: #888;
}

.rk-no-extras-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

/* ============================================
   MODAL DE AÑADIR EXTRAS
   ============================================ */

.rk-extras-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.rk-extras-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.rk-extras-modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.rk-extras-modal-overlay.active .rk-extras-modal {
    transform: translateY(0);
}

.rk-extras-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.rk-extras-modal-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rk-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.rk-modal-close:hover {
    background: #e0e0e0;
}

.rk-extras-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.rk-extras-modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.rk-modal-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 18px;
}

.rk-modal-total-amount {
    font-weight: bold;
    color: #4caf50;
    font-size: 24px;
}

.rk-modal-pay-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.rk-modal-pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.rk-modal-pay-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Selector de extra en modal */
.rk-modal-extras-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rk-modal-extra-option {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rk-modal-extra-option:hover {
    border-color: #d81d23;
}

.rk-modal-extra-option.selected {
    border-color: #4caf50;
    background: #e8f5e9;
}

.rk-modal-extra-title {
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   FILA SECUNDARIA (Sabor + Cantidad)
   ============================================ */

.rk-extra-secondary-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.rk-extra-secondary-attr {
    flex: 1;
    min-width: 150px;
}

.rk-extra-quantity {
    flex-shrink: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
	#rk-summary-extras-container {
        padding: 10px 15px;
	    margin: 0 -15px;
	}
    .rk-extra-header {
        flex-direction: column;
        text-align: center;
    }
    
    .rk-extra-image {
        margin: 0 auto;
    }
    
    .rk-extra-header-toggle {
        flex-wrap: wrap;
    }
    
    .rk-extra-title {
        order: 1;
        flex: auto;
    }
    
    .rk-extra-image-thumb {
        order: 2;
    }
    
    .rk-toggle-switch {
        order: 0;
    }
    
    .rk-price-options-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .rk-extra-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .rk-extra-subtotal {
        text-align: center;
    }
    
    .rk-extras-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .rk-extra-secondary-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .rk-extra-secondary-attr {
        width: 100%;
    }
    .rk-extra-quantity {

    }
    .rk-extra-quantity label {
        margin-bottom: 0px;
    }

}

@media (max-width: 480px) {
    .rk-price-options-grid {
        grid-template-columns: 1fr;
    }
    
    .rk-option-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .rk-option-price {
        margin: 0;
    }
}

/* ============================================
   DESGLOSE DE EXTRAS EN PANEL DE CLIENTE
   v3.8.92
   ============================================ */

.rk-extras-breakdown {
    font-size: 12px;
    color: #666;
    margin-top: -5px;
    padding-left: 10px;
}

.rk-price-per-child.rk-extras-breakdown {
    margin-bottom: 10px;
}
