/**
 * ENTERPRISE PRODUCT MODULE STYLES v8.1
 * Estilos específicos del módulo de productos. No contiene reglas globales.
 * 
 * @version 8.1.0-Enterprise
 */

/* ============================================
   PRODUCT CARDS (ESPECÍFICO DEL MÓDULO)
   ============================================ */
.product-card {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: calc(var(--animation-order, 0) * 0.1s);
    opacity: 0;
}

.product-card-inner {
    position: relative;
    border-radius: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.stock-high { background: linear-gradient(135deg, #28a745, #20c997); }
.stock-medium { background: linear-gradient(135deg, #ffc107, #fd7e14); }
.stock-low { background: linear-gradient(135deg, #dc3545, #e83e8c); }
.stock-out { background: linear-gradient(135deg, #6c757d, #495057); }
.product-inactive .product-status-badge { background: linear-gradient(135deg, #6c757d, #343a40); }

.product-avatar { margin-top: 10px; }
.avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
}

.product-active .avatar-circle { background: linear-gradient(135deg, #007bff, #6610f2); }
.product-inactive .avatar-circle { background: linear-gradient(135deg, #6c757d, #495057); }

.product-title {
    font-weight: 600;
    color: #343a40;
    line-height: 1.4;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.product-title a {
    color: inherit;
    transition: color 0.2s;
}
.product-title a:hover { color: #007bff; text-decoration: none; }

.product-indicators {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
}

.indicator-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}
.indicator-row:last-child { border-bottom: none; }
.indicator-label { color: #6c757d; font-size: 0.875rem; }
.indicator-value { font-weight: 600; font-size: 1rem; }

.new-product-card {
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}
.new-product-card:hover {
    border-color: #007bff;
    background: #e7f1ff;
    transform: translateY(-3px);
}
.new-product-icon { opacity: 0.7; transition: all 0.3s ease; }
.new-product-card:hover .new-product-icon { opacity: 1; transform: scale(1.1); }

/* ============================================
   NUEVOS ESTILOS PARA DISEÑOS / FORMULACIONES
   ============================================ */
.design-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 20px;
}

.design-product-panel {
    flex: 1 1 300px;
    background: linear-gradient(145deg, #f8faff 0%, #f0f4fd 100%);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 20, 60, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    height: fit-content;
}

.design-form-panel {
    flex: 3 1 600px;
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.finished-product-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-left: 6px solid #4361ee;
}

.product-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eef2ff;
    color: #4361ee;
    letter-spacing: 0.3px;
}

.design-items-table {
    border-collapse: separate;
    border-spacing: 0 8px;
    width: 100%;
}

.design-items-table thead th {
    background: transparent;
    color: #6c757d;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 8px 12px;
}

.design-items-table tbody tr {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
}
.design-items-table tbody tr:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
.design-items-table tbody td {
    padding: 16px 12px;
    border: none;
    vertical-align: middle;
}
.design-items-table tbody td:first-child { border-radius: 16px 0 0 16px; }
.design-items-table tbody td:last-child { border-radius: 0 16px 16px 0; }

.btn-float-add {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    color: white;
    border: none;
    box-shadow: 0 8px 16px rgba(67, 97, 238, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin: 20px 0;
}
.btn-float-add:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 24px rgba(67, 97, 238, 0.4);
}
.btn-float-add i { font-size: 1.2rem; }

/* ============================================
   TARJETAS DE PRODUCTO EN LISTADO (DPL) - MEJORADAS
   ============================================ */
.design-product-card {
    background: white;
    border-radius: 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}
.design-product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.design-product-header {
    background: white;
    padding: 16px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s;
}
.design-product-header:hover {
    background-color: #f8f9fa;
}
.design-product-header[aria-expanded="true"] {
    border-bottom-color: #e9ecef;
}
.design-product-header[aria-expanded="true"] .toggle-icon {
    transform: rotate(90deg);
}

.design-product-header .product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}
.design-product-header .product-meta {
    display: flex;
    gap: 20px;
    color: #6c757d;
    font-size: 0.85rem;
}

.design-product-body {
    padding: 24px;
    background: #f8f9fc;
}

.insumos-table {
    width: 100%;
}
.insumos-table th {
    padding: 8px 12px;
    color: #495057;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
}
.insumos-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
}

/* ============================================
   PRD LISTADO ENTERPRISE
   ============================================ */
.prd-list-view .prd-tabs {
    background: #eaf0f6;
    border: 1px solid #d7e0ea;
    border-radius: 8px 8px 0 0;
    padding: 4px 4px 0;
    gap: 4px;
}

.prd-list-view .prd-tabs .nav-link {
    border: 0;
    border-radius: 6px 6px 0 0;
    color: #1f2937;
    font-weight: 700;
    min-height: 40px;
    padding: 10px 14px;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.prd-list-view .prd-tabs .nav-link:hover,
.prd-list-view .prd-tabs .nav-link:focus {
    background: #ffffff;
    color: #0d6efd;
    outline: 0;
    box-shadow: inset 0 -3px 0 #7ab8ff;
}

.prd-list-view .prd-tabs .nav-link.active {
    background: #ffffff;
    color: #0b3f8a;
    box-shadow: inset 0 -3px 0 #0d6efd;
}

.prd-list-view .content-header {
    padding-bottom: 4px;
}

.prd-list-view .content-header .fluent-card {
    margin-bottom: 0;
}

.prd-list-view #productTabContent {
    margin-top: 0;
}

.prd-list-view .prd-filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.prd-list-view .prd-search .form-control,
.prd-list-view .prd-search .input-group-text,
.prd-list-view .prd-search .btn {
    min-height: 44px;
}

.prd-list-view .prd-filter-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.prd-list-view .prd-toolbar-btn,
.prd-list-view .prd-export-btn {
    border-radius: 8px;
    font-weight: 700;
    min-height: 40px;
    padding-left: 14px;
    padding-right: 14px;
}

.prd-list-view .prd-export-group {
    gap: 8px;
}

.prd-list-view .prd-export-group .btn {
    border-radius: 8px !important;
}

.prd-list-view .prd-filter-panel {
    background: #f8fafc;
    border: 1px solid #dce5ef;
    border-radius: 8px;
    padding: 14px;
}

.prd-list-view .prd-filter-panel-header h3 {
    color: #334155;
    font-size: .95rem;
    font-weight: 800;
    margin: 0 0 12px;
}

.prd-list-view .dataTables_wrapper .dt-buttons,
.prd-list-view .dataTables_wrapper .dataTables_filter {
    display: none !important;
}

.prd-list-view .prd-table-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.prd-list-view .prd-table {
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0 !important;
}

.prd-list-view .prd-table thead th {
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    color: #0f172a;
    font-size: .78rem;
    font-weight: 800;
    padding: 14px 16px;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}

.prd-list-view .prd-table tbody td {
    border-top: 1px solid #e5edf5;
    color: #1f2937;
    padding: 16px;
    vertical-align: top;
}

.prd-list-view .prd-table tbody tr:hover {
    background: #f8fbff;
}

.prd-product-cell {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
}

.prd-row-icon {
    align-items: center;
    background: #eaf4ff;
    border-radius: 8px;
    color: #0d6efd;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.prd-product-name {
    color: #0f172a;
    display: block;
    font-weight: 800;
    line-height: 1.3;
}

.prd-product-name:hover {
    color: #0d6efd;
    text-decoration: none;
}

.prd-meta-line,
.prd-stack span {
    color: #64748b;
    display: block;
    font-size: .84rem;
    line-height: 1.45;
}

.prd-stack strong {
    color: #334155;
}

.prd-stock-pill {
    border-radius: 999px;
    display: inline-flex !important;
    font-weight: 800;
    margin-top: 5px;
    padding: 4px 10px;
}

.prd-stock-ok {
    background: #e8f7ee;
    color: #137333 !important;
}

.prd-stock-empty {
    background: #eef2f7;
    color: #475569 !important;
}

.prd-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.prd-feature {
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
    padding: 5px 9px;
}

.prd-feature.is-yes {
    background: #e8f7ee;
    color: #137333;
}

.prd-feature.is-no {
    background: #edf1f5;
    color: #475569;
}

.prd-actions {
    display: inline-flex;
    gap: 6px;
}

.prd-actions .btn {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.prd-table-footer .dataTables_length,
.prd-table-footer .dataTables_info,
.prd-table-footer .dataTables_paginate {
    color: #64748b;
    font-size: .84rem;
}

/* ============================================
   PRD FORMULARIO UNIFICADO
   ============================================ */
.prd-form-view .prd-form-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 55%, #198754 100%);
    color: #ffffff;
    padding: 24px 0;
}

.prd-form-view .prd-heading {
    align-items: center;
    display: flex;
    gap: 14px;
}

.prd-form-view .prd-heading-icon {
    align-items: center;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 8px;
    display: inline-flex;
    font-size: 1.35rem;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.prd-form-view .prd-heading h1 {
    color: #ffffff;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.prd-form-view .prd-heading p {
    color: rgba(255, 255, 255, .88);
    margin: 4px 0 0;
}

.prd-form-view .prd-mode-badge,
.prd-form-view .prd-header-link {
    border-radius: 8px;
    font-weight: 800;
}

.prd-form-view .prd-form-content {
    padding: 20px 0 28px;
}

.prd-form-view .prd-form-shell {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .07);
    overflow: hidden;
}

.prd-form-view .prd-form-section {
    border-bottom: 1px solid #e8eef5;
    padding: 22px;
}

.prd-form-view .prd-form-section:last-of-type {
    border-bottom: 0;
}

.prd-form-view .prd-section-title {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.prd-form-view .prd-section-title i {
    align-items: center;
    background: #eaf4ff;
    border-radius: 8px;
    color: #0d6efd;
    display: inline-flex;
    flex: 0 0 34px;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.prd-form-view .prd-section-title h2 {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.prd-form-view .prd-section-title span {
    color: #64748b;
    display: block;
    font-size: .86rem;
    margin-top: 2px;
}

.prd-form-view .prd-field label {
    color: #334155;
    font-weight: 800;
}

.prd-form-view .prd-field .form-control,
.prd-form-view .prd-field .input-group-text,
.prd-form-view .prd-field .btn {
    border-color: #d7e0ea;
    border-radius: 8px;
}

.prd-form-view .prd-field .input-group .form-control {
    border-radius: 0;
}

.prd-form-view .prd-field .input-group-prepend .input-group-text {
    border-radius: 8px 0 0 8px;
}

.prd-form-view .prd-field .input-group-append .input-group-text,
.prd-form-view .prd-field .input-group-append .btn {
    border-radius: 0 8px 8px 0;
}

.prd-form-view .prd-field .form-control:focus {
    border-color: #7ab8ff;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .12);
}

.prd-form-view .prd-values-layout {
    align-items: flex-start;
}

.prd-form-view .prd-values-main,
.prd-form-view .prd-values-switches {
    min-width: 0;
}

.prd-form-view .prd-values-section .prd-switch-grid {
    margin-top: 0;
}

.prd-form-view .prd-switch-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 0;
}

.prd-form-view .prd-switch {
    background: #f8fafc;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    min-height: 44px;
    padding: 11px 12px 8px 48px;
}

.prd-form-view .prd-switch label {
    color: #334155;
    font-weight: 800;
}

.prd-form-view .prd-form-actions {
    align-items: center;
    background: #f8fafc;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 18px 22px;
}

.prd-form-view .prd-required-note {
    color: #64748b;
    font-size: .86rem;
}

.prd-form-view .prd-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.prd-form-view .prd-action-buttons .btn {
    border-radius: 8px;
    font-weight: 800;
    min-height: 40px;
    padding-left: 16px;
    padding-right: 16px;
}

/* ============================================
   ANIMACIONES (ESPECÍFICAS)
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}
.fluent-btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
}

/* ============================================
   RESPONSIVE (ESPECÍFICO)
   ============================================ */
@media (max-width: 768px) {
    .design-layout { flex-direction: column; }
    .design-product-panel, .design-form-panel { flex: 1 1 auto; width: 100%; }
    .design-product-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .design-product-header .product-meta { flex-wrap: wrap; gap: 10px; }

    .prd-list-view .prd-filter-bar {
        grid-template-columns: 1fr;
    }

    .prd-list-view .prd-filter-actions {
        justify-content: stretch;
    }

    .prd-list-view .prd-toolbar-btn,
    .prd-list-view .prd-export-group,
    .prd-list-view .prd-export-btn {
        flex: 1 1 auto;
    }

    .prd-list-view .prd-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    .prd-list-view .prd-table-responsive {
        overflow-x: visible;
    }

    .prd-list-view .prd-table thead {
        display: none;
    }

    .prd-list-view .prd-table,
    .prd-list-view .prd-table tbody,
    .prd-list-view .prd-table tr,
    .prd-list-view .prd-table td {
        display: block;
        width: 100%;
    }

    .prd-list-view .prd-table tbody tr {
        background: #ffffff;
        border: 1px solid #dfe7ef;
        border-radius: 8px;
        box-shadow: 0 5px 16px rgba(15, 23, 42, .06);
        margin-bottom: 12px;
        overflow: hidden;
    }

    .prd-list-view .prd-table tbody td {
        border-top: 1px solid #edf2f7;
        padding: 12px 14px;
    }

    .prd-list-view .prd-table tbody td:first-child {
        border-top: 0;
    }

    .prd-list-view .prd-table tbody td::before {
        color: #64748b;
        content: attr(data-label);
        display: block;
        font-size: .72rem;
        font-weight: 800;
        margin-bottom: 6px;
        text-transform: uppercase;
    }

    .prd-list-view .prd-actions {
        justify-content: flex-start;
    }

    .prd-form-view .prd-form-header {
        padding: 18px 0;
    }

    .prd-form-view .prd-heading {
        align-items: flex-start;
    }

    .prd-form-view .prd-form-section {
        padding: 16px;
    }

    .prd-form-view .prd-values-switches {
        margin-top: 2px;
    }

    .prd-form-view .prd-switch-grid {
        grid-template-columns: 1fr;
        padding-top: 4px;
    }

    .prd-form-view .prd-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .prd-form-view .prd-action-buttons {
        justify-content: stretch;
    }

    .prd-form-view .prd-action-buttons .btn {
        flex: 1 1 auto;
    }
}
