/**
 * Estilos CSS para grupos de suscripción en el carrito
 * 
 * @package Boscos_Calculator
 * @version 1.0.0
 */

/* Contenedor principal de grupos de suscripción */
.boscos-subscription-groups-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Header de grupos de suscripción */
.subscription-groups-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #007cba;
}

.subscription-groups-title {
    color: #007cba;
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.title-text {
    font-weight: 600;
}

.subscription-count {
    background: #007cba;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.subscription-groups-description {
    color: #6c757d;
    margin: 0;
    font-style: italic;
}

/* Wrapper de grupos */
.subscription-groups-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Grupo individual de suscripción */
.subscription-group {
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.subscription-group:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 123, 186, 0.15);
    transform: translateY(-2px);
}

/* Header del grupo */
.subscription-group-header {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.pet-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pet-icon {
    font-size: 1.5rem;
}

.pet-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.subscription-id-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: monospace;
}

/* Resumen del grupo */
.group-summary {
    display: flex;
    gap: 1rem;
}

.products-count, .quantity-total {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.count-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.count-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Acciones del grupo */
.group-actions {
    display: flex;
    gap: 0.5rem;
}

.remove-subscription-group-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.remove-subscription-group-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1rem;
}

/* Productos del grupo */
.subscription-group-products {
    padding: 1.5rem;
}

.products-table-wrapper {
    overflow-x: auto;
}

.subscription-products-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.subscription-products-table th {
    background: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.subscription-products-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.subscription-product-row:hover {
    background: #f8f9fa;
}

/* Detalles del producto */
.product-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-image img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
}

.product-name {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    color: #212529;
}

.product-variation {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.variation-attr {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Cantidad y precios */
.quantity-display {
    background: #007cba;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.price-amount, .total-amount {
    font-weight: 600;
    color: #28a745;
}

/* Footer del grupo */
.subscription-group-footer {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #dee2e6;
}

.group-totals {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.total-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.total-label {
    font-weight: 600;
    color: #495057;
}

.total-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #28a745;
}

.group-actions-footer {
    display: flex;
    gap: 0.5rem;
}

.edit-subscription-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.edit-subscription-btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* Mensaje cuando no hay suscripciones */
.no-subscriptions-message {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Estados de carga y eliminación */
.subscription-group.removing {
    opacity: 0.6;
    pointer-events: none;
}

.subscription-group.removing .remove-subscription-group-btn {
    background: #6c757d;
    cursor: not-allowed;
}

.subscription-group.removing .remove-subscription-group-btn::after {
    content: "⏳";
    margin-left: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Indicadores de progreso */
.subscription-group .progress-indicator {
    display: none;
    text-align: center;
    padding: 1rem;
    background: #e9ecef;
    color: #495057;
}

.subscription-group.removing .progress-indicator {
    display: block;
}

/* ========================================
   ESTILOS ESPECÍFICOS PARA CHECKOUT
   ======================================== */

.boscos-checkout-subscription-groups {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.checkout-subscription-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #28a745;
}

.checkout-subscription-title {
    color: #28a745;
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.checkout-subscription-description {
    color: #6c757d;
    margin: 0;
    font-style: italic;
}

/* Validaciones de Checkout */
.checkout-validation-errors,
.checkout-validation-warnings {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.checkout-validation-errors {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.checkout-validation-warnings {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.validation-errors-title,
.validation-warnings-title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.validation-errors-list,
.validation-warnings-list {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

.validation-error-item,
.validation-warning-item {
    margin-bottom: 0.5rem;
}

.validation-errors-note,
.validation-warnings-note {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Grupos de Checkout */
.checkout-subscription-groups-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.checkout-subscription-group {
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.checkout-subscription-group:hover {
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
    transform: translateY(-2px);
}

.checkout-group-header {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkout-group-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.checkout-pet-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checkout-pet-icon {
    font-size: 1.5rem;
}

.checkout-pet-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.checkout-subscription-id-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: monospace;
}

.checkout-group-summary {
    display: flex;
    gap: 1rem;
}

.checkout-products-count,
.checkout-quantity-total {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.checkout-count-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.checkout-count-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Estados de Validación */
.checkout-group-status {
    display: flex;
    align-items: center;
}

.checkout-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.checkout-status-success {
    background: #28a745;
    color: white;
}

.checkout-status-warning {
    background: #ffc107;
    color: #212529;
}

.checkout-status-error {
    background: #dc3545;
    color: white;
}

/* Productos de Checkout */
.checkout-group-products {
    padding: 1.5rem;
}

.checkout-products-table-wrapper {
    overflow-x: auto;
}

.checkout-subscription-products-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.checkout-subscription-products-table th {
    background: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.checkout-subscription-products-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.checkout-subscription-product-row:hover {
    background: #f8f9fa;
}

.checkout-product-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.checkout-product-image img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
}

.checkout-product-name {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    color: #212529;
}

.checkout-product-variation {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.checkout-variation-attr {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.checkout-quantity-display {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.checkout-price-amount,
.checkout-total-amount {
    font-weight: 600;
    color: #28a745;
}

/* Footer de Checkout */
.checkout-group-footer {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #dee2e6;
}

.checkout-group-totals {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checkout-total-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkout-total-label {
    font-weight: 600;
    color: #495057;
}

.checkout-total-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #28a745;
}

.checkout-group-actions {
    display: flex;
    gap: 0.5rem;
}

.checkout-edit-subscription-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-decoration: none;
}

.checkout-edit-subscription-btn:hover {
    background: #138496;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.checkout-btn-icon {
    font-size: 1rem;
}

/* Resumen de Checkout */
.checkout-subscription-summary {
    margin-top: 2rem;
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    overflow: hidden;
}

.checkout-summary-header {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: white;
    padding: 1rem 1.5rem;
    text-align: center;
}

.checkout-summary-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.checkout-summary-content {
    padding: 1.5rem;
}

.checkout-summary-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.checkout-summary-stat {
    text-align: center;
}

.checkout-stat-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.checkout-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #495057;
}

.checkout-summary-alert {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

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

.checkout-summary-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

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

.checkout-summary-alert p {
    margin: 0.5rem 0;
}

.checkout-summary-alert p:first-child {
    margin-top: 0;
}

.checkout-summary-alert p:last-child {
    margin-bottom: 0;
}

.checkout-no-subscriptions-message {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .subscription-group-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .group-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .group-summary {
        justify-content: center;
    }
    
    .subscription-group-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .products-table-wrapper {
        font-size: 0.9rem;
    }
    
    .product-details {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .subscription-products-table th,
    .subscription-products-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }
    
    /* Responsive para Checkout */
    .checkout-group-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .checkout-group-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .checkout-group-summary {
        justify-content: center;
    }
    
    .checkout-group-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .checkout-products-table-wrapper {
        font-size: 0.9rem;
    }
    
    .checkout-product-details {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .checkout-subscription-products-table th,
    .checkout-subscription-products-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }
    
    .checkout-summary-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .boscos-subscription-groups-container {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .subscription-groups-title {
        font-size: 1.25rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .subscription-group-header {
        padding: 0.75rem 1rem;
    }
    
    .pet-name {
        font-size: 1.1rem;
    }
    
    .count-number {
        font-size: 1.25rem;
    }
}
