/* 
 * WooCommerce Dimension Search - Estilos Responsive
 * Version: 1.0.0
 */

/* === Contenedor Principal === */
.wc-dimension-search-container {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.wc-dimension-search-container:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* === Título === */
.wc-dimension-search-title {
    margin: 0 0 20px 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #0071a1;
    padding-bottom: 10px;
}

/* === Formulario === */
.wc-dimension-search-form {
    width: 100%;
}

/* === Grid de Campos === */
.wc-dimension-search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* === Campos Individuales === */
.wc-dimension-field {
    display: flex;
    flex-direction: column;
    position: relative;
}

.wc-dimension-field label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wc-dimension-field label .unit {
    font-weight: 400;
    color: #888;
    font-size: 0.9em;
}

/* === Inputs === */
.wc-dimension-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #fafafa;
    color: #333;
    box-sizing: border-box;
}

.wc-dimension-input:focus {
    outline: none;
    border-color: #0071a1;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 113, 161, 0.1);
}

.wc-dimension-input:hover {
    border-color: #0071a1;
}

/* === Campo de Tolerancia === */
.wc-dimension-tolerance {
    grid-column: span 1;
}

.tolerance-help {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}

/* === Botones === */
.wc-dimension-search-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.wc-dimension-search-button {
    background: linear-gradient(135deg, #0071a1 0%, #005177 100%);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 113, 161, 0.2);
    flex: 1;
    min-width: 150px;
    justify-content: center;
}

.wc-dimension-search-button:hover {
    background: linear-gradient(135deg, #005177 0%, #003d5c 100%);
    box-shadow: 0 4px 8px rgba(0, 113, 161, 0.3);
    transform: translateY(-1px);
}

.wc-dimension-search-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 113, 161, 0.2);
}

.wc-dimension-search-button .button-icon {
    font-size: 1.1em;
}

.wc-dimension-reset-button {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
    padding: 12px 24px;
    font-size: 0.95em;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.wc-dimension-reset-button:hover {
    background: #e8e8e8;
    border-color: #999;
    color: #333;
}

/* === Criterios de Búsqueda Activos === */
.wc-dimension-search-active {
    margin-top: 20px;
    padding: 15px;
    background: #e7f3f8;
    border-left: 4px solid #0071a1;
    border-radius: 4px;
}

.wc-dimension-search-active .search-criteria {
    margin: 0;
    color: #333;
    font-size: 0.95em;
}

.wc-dimension-search-active .search-criteria strong {
    display: block;
    margin-bottom: 8px;
    color: #0071a1;
}

.criteria-item {
    display: inline-block;
    background: #ffffff;
    padding: 5px 12px;
    margin: 4px 4px 4px 0;
    border-radius: 4px;
    font-size: 0.9em;
    border: 1px solid #b8d9e8;
}

.criteria-item.tolerance {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* === Widget Sidebar === */
.widget.wc-dimension-search-widget .wc-dimension-search-container {
    padding: 15px;
}

.widget.wc-dimension-search-widget .wc-dimension-search-fields {
    grid-template-columns: 1fr;
}

.widget.wc-dimension-search-widget .wc-dimension-search-button {
    width: 100%;
}

/* === Responsive - Tablets === */
@media screen and (max-width: 768px) {
    .wc-dimension-search-container {
        padding: 15px;
    }
    
    .wc-dimension-search-title {
        font-size: 1.3em;
    }
    
    .wc-dimension-search-fields {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .wc-dimension-tolerance {
        grid-column: 1;
    }
    
    .wc-dimension-search-actions {
        flex-direction: column;
    }
    
    .wc-dimension-search-button,
    .wc-dimension-reset-button {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }
}

/* === Responsive - Móviles === */
@media screen and (max-width: 480px) {
    .wc-dimension-search-container {
        padding: 12px;
        margin: 15px 0;
        border-radius: 6px;
    }
    
    .wc-dimension-search-title {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .wc-dimension-search-fields {
        gap: 10px;
    }
    
    .wc-dimension-field label {
        font-size: 0.9em;
        margin-bottom: 6px;
    }
    
    .wc-dimension-input {
        padding: 10px 12px;
        font-size: 0.95em;
    }
    
    .wc-dimension-search-button {
        padding: 12px 20px;
        font-size: 0.95em;
    }
    
    .wc-dimension-reset-button {
        padding: 10px 18px;
        font-size: 0.9em;
    }
    
    .tolerance-help {
        font-size: 0.8em;
    }
    
    .criteria-item {
        font-size: 0.85em;
        padding: 4px 10px;
    }
}

/* === Modo Oscuro (opcional) === */
@media (prefers-color-scheme: dark) {
    .wc-dimension-search-container {
        background: #1e1e1e;
        border-color: #3a3a3a;
    }
    
    .wc-dimension-search-title {
        color: #e0e0e0;
        border-color: #0096d6;
    }
    
    .wc-dimension-field label {
        color: #c0c0c0;
    }
    
    .wc-dimension-input {
        background: #2a2a2a;
        border-color: #3a3a3a;
        color: #e0e0e0;
    }
    
    .wc-dimension-input:focus {
        background: #333;
        border-color: #0096d6;
    }
    
    .wc-dimension-search-active {
        background: #2a3a3f;
        border-color: #0096d6;
    }
    
    .wc-dimension-search-active .search-criteria {
        color: #e0e0e0;
    }
    
    .criteria-item {
        background: #333;
        border-color: #4a5a5f;
        color: #e0e0e0;
    }
}

/* === Animaciones === */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-dimension-search-active {
    animation: slideIn 0.3s ease;
}

/* === Accesibilidad === */
.wc-dimension-input:focus-visible {
    outline: 3px solid #0071a1;
    outline-offset: 2px;
}

.wc-dimension-search-button:focus-visible,
.wc-dimension-reset-button:focus-visible {
    outline: 3px solid #0071a1;
    outline-offset: 2px;
}

/* === Print Styles === */
@media print {
    .wc-dimension-search-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .wc-dimension-search-button,
    .wc-dimension-reset-button {
        display: none;
    }
}
