
/* ============================================
   ESTILOS PRINCIPALES CON POPPINS
   ============================================ */

/* Importar Poppins desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Aplicar Poppins a todos los elementos del plugin */
.pda-upload-area,
.pda-upload-area h3,
.pda-info,
.pda-required-notice,
.pda-drop-text,
.pda-or-text,
.pda-browse-btn,
.pda-file-name,
.pda-file-size,
.pda-remove-btn,
.pda-preview-note,
.pda-error,
.pda-cart-documents,
.pda-order-item-documents,
.pda-documents-title,
.pda-document-item,
.document-name,
.pda-view-document,
.pda-download-document,
.pda-order-documents-section h2,
.pda-product-title,
.pda-view-btn,
.pda-download-btn,
.pda-admin-documents h3,
.pda-admin-product p,
.pda-admin-document .document-name {
    font-family: "Poppins", Sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

/* Área principal */
.pda-upload-area {
    margin: 20px 0;
    padding: 25px;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    background-color: #fafafa;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pda-upload-area h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 20px !important;
    font-weight: 600 !important;
    text-align: center;
}

/* Información */
.pda-info {
    margin-bottom: 20px;
    color: #6b7280;
    text-align: center;
    line-height: 1.5 !important;
}

.pda-info small {
    font-size: 16px !important;
    color: var(--e-global-color-text);
}

.pda-required-notice {
    color: #dc2626;
    margin-top: 8px;
    font-size: 14px !important;
    font-weight: 500 !important;
}

/* Zona de drop */
.pda-drop-zone {
    padding: 40px 20px;
    text-align: center;
    background-color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px dashed #d1d5db;
    margin: 20px 0;
}

.pda-drop-zone:hover,
.pda-drop-zone.dragover {
    border-color: #007cba;
    background-color: #f8fbff;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.1);
}

.pda-drop-content .dashicons {
    font-size: 56px;
    width: 56px;
    height: 56px;
    color: #cbd5e1;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.pda-drop-zone:hover .dashicons,
.pda-drop-zone.dragover .dashicons {
    color: #007cba;
}

.pda-drop-text {
    color: #4b5563;
    margin-bottom: 8px;
    font-weight: 500 !important;
    font-size: 18px !important;
}

.pda-or-text {
    color: #9ca3af;
    margin: 10px 0;
    font-size: 16px !important;
}

/* Contenedor del botón centrado */
.pda-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

/* Botón de selección - CENTRADO */
.pda-browse-btn {
    background-color: #007cba;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500 !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 124, 186, 0.2);
    display: inline-block;
    text-align: center;
    min-width: 180px;
    font-size: 16px !important;
}

.pda-browse-btn:hover {
    background-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.3);
  	border-radius: 20px !important; 
}

.pda-browse-btn:active {
    transform: translateY(0);
    border-radius: 20px !important; 
}

/* Lista de archivos */
.pda-file-list {
    margin-top: 25px;
}

.pda-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pda-file-item:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    transform: translateX(2px);
}

.pda-file-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
    min-width: 0;
}

.pda-file-icon {
    margin-right: 12px;
    color: #6b7280;
    flex-shrink: 0;
}

.pda-file-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #374151;
    font-size: 16px !important;
    font-weight: 400 !important;
}

.pda-file-size {
    color: #9ca3af;
    margin-left: 10px;
    flex-shrink: 0;
    font-size: 14px !important;
}

.pda-remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 6px;
    margin-left: 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
    flex-shrink: 0;
    font-size: 16px !important;
}

.pda-remove-btn:hover {
    color: #dc2626;
    background-color: #fef2f2;
}

/* Nota de vista previa */
.pda-preview-note {
    margin-top: 20px;
    padding: 12px 15px;
    background-color: #f0f9ff;
    border-radius: 6px;
    color: #0369a1;
    border-left: 3px solid #007cba;
    text-align: center;
    font-size: 14px !important;
}

.pda-preview-note small {
    font-size: 14px !important;
}

/* Errores */
.pda-errors {
    margin-top: 20px;
    padding: 12px 15px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    display: none;
    text-align: center;
}

.pda-error {
    margin: 5px 0;
    font-size: 14px !important;
}

/* Previsualización de imágenes */
.pda-image-preview {
    max-width: 60px;
    max-height: 60px;
    margin-right: 12px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* ============================================
   ESTILOS PARA CARRITO Y CHECKOUT
   ============================================ */

/* Documentos en carrito y checkout */
.cart_item .pda-cart-documents,
.woocommerce-checkout-review-order-table .pda-cart-documents {
    line-height: 1.5 !important;
    margin-top: 5px;
    padding-left: 12px;
    border-left: 2px solid #e5e7eb;
    font-size: 16px !important;
}

.cart_item .pda-cart-documents br,
.woocommerce-checkout-review-order-table .pda-cart-documents br {
    display: block;
    margin: 4px 0;
}

/* Estilos para variaciones de producto */
.variation-Documentosadjuntos {
    margin-top: 8px;
    color: #374151;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.variation-Documentosadjuntos .pda-cart-documents {
    font-weight: 400 !important;
    margin-left: 8px;
    color: #6b7280;
    font-size: 16px !important;
}

/* ============================================
   ESTILOS PARA VISUALIZACIÓN DE DOCUMENTOS EN ORDEN
   ============================================ */

/* Documentos en detalles del producto dentro de la orden */
.pda-order-item-documents {
    margin-top: 10px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007cba;
    font-size: 16px !important;
}

.pda-documents-title {
    color: #374151;
    margin-bottom: 8px;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.pda-documents-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pda-document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 16px !important;
}

.pda-document-item:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.document-name {
    flex-grow: 1;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px !important;
    font-weight: 400 !important;
}

.pda-view-document,
.pda-download-document {
    padding: 4px 10px;
    margin-left: 5px;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.pda-view-document {
    background-color: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
}

.pda-view-document:hover {
    background-color: #2563eb;
    color: white;
}

.pda-download-document {
    background-color: #10b981;
    color: white;
    border: 1px solid #10b981;
}

.pda-download-document:hover {
    background-color: #059669;
    color: white;
}

/* Sección de documentos en página de orden */
.pda-order-documents-section {
    margin-top: 40px;
    padding: 25px;
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 16px !important;
}

.pda-order-documents-section h2 {
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    font-size: 20px !important;
    font-weight: 600 !important;
}

.pda-documents-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pda-product-documents {
    padding: 15px;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.pda-product-title {
    color: #374151;
    margin-bottom: 15px;
    font-size: 18px !important;
    font-weight: 600 !important;
}

.pda-document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    transition: all 0.2s;
}

.pda-document-item:hover {
    background-color: #f1f5f9;
    transform: translateX(2px);
}

.document-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.document-icon {
    color: #64748b;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.document-actions {
    display: flex;
    gap: 8px;
}

.pda-view-btn,
.pda-download-btn {
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.pda-view-btn {
    background-color: #3b82f6;
    color: white;
}

.pda-view-btn:hover {
    background-color: #2563eb;
    color: white;
}

.pda-download-btn {
    background-color: #10b981;
    color: white;
}

.pda-download-btn:hover {
    background-color: #059669;
    color: white;
}

/* ============================================
   ESTILOS PARA ADMIN
   ============================================ */

/* Estilos para admin */
.pda-admin-documents {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 16px !important;
}

.pda-admin-documents h3 {
    color: #1f2937;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    font-size: 18px !important;
    font-weight: 600 !important;
}

.pda-admin-product {
    margin-bottom: 15px;
    padding: 12px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.pda-admin-product p {
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 10px;
}

.pda-admin-document {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    margin-top: 8px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.pda-admin-document .document-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pda-admin-document .document-name {
    color: #4b5563;
    font-size: 16px !important;
}

.pda-admin-document .document-actions {
    display: flex;
    gap: 5px;
}

.pda-admin-document .button-small {
    padding: 4px 10px;
    height: auto;
    line-height: 1.5;
    font-size: 14px !important;
}

/* ============================================
   OCULTAR COLUMNA DE SUBTOTAL EN CHECKOUT
   ============================================ */

/* FORZAR la eliminación de la columna de subtotal */
body.woocommerce-checkout table.woocommerce-checkout-review-order-table th.product-total,
body.woocommerce-checkout table.woocommerce-checkout-review-order-table td.product-total,
body.woocommerce-checkout #order_review table.shop_table th.product-total,
body.woocommerce-checkout #order_review table.shop_table td.product-total,
.woocommerce table.shop_table th.product-total,
.woocommerce table.shop_table td.product-total {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Asegurar que la columna de producto ocupe el 100% */
body.woocommerce-checkout table.woocommerce-checkout-review-order-table th.product-name,
body.woocommerce-checkout table.woocommerce-checkout-review-order-table td.product-name,
body.woocommerce-checkout #order_review table.shop_table th.product-name,
body.woocommerce-checkout #order_review table.shop_table td.product-name {
    width: 100% !important;
    display: table-cell !important;
}

/* Ajustar específicamente para la tabla de checkout */
.woocommerce-checkout #order_review table.shop_table {
    width: 100% !important;
    table-layout: fixed !important;
}

/* Asegurar que el thead solo tenga una columna */
.woocommerce-checkout #order_review table.shop_table thead tr {
    display: table-row !important;
}

.woocommerce-checkout #order_review table.shop_table thead tr th:first-child {
    width: 100% !important;
    text-align: left !important;
    padding-left: 20px !important;
    font-family: "Poppins", Sans-serif !important;
    font-size: 16px !important;
}

/* Ocultar cualquier segundo th que pueda existir */
.woocommerce-checkout #order_review table.shop_table thead tr th:nth-child(2),
.woocommerce-checkout #order_review table.shop_table thead tr th + th {
    display: none !important;
}

/* Ajustar los tbody y tfoot */
.woocommerce-checkout #order_review table.shop_table tbody td,
.woocommerce-checkout #order_review table.shop_table tfoot td {
    padding: 15px 20px !important;
}

/* Para los totales, mantener dos columnas */
.woocommerce-checkout #order_review table.shop_table tfoot tr th {
    width: 70% !important;
    text-align: right !important;
    padding-right: 20px !important;
    font-family: "Poppins", Sans-serif !important;
    font-size: 16px !important;
}

.woocommerce-checkout #order_review table.shop_table tfoot tr td {
    width: 30% !important;
    text-align: left !important;
    padding-left: 0 !important;
    font-family: "Poppins", Sans-serif !important;
    font-size: 16px !important;
}

/* Para el total final */
.woocommerce-checkout #order_review table.shop_table tfoot tr.order-total th,
.woocommerce-checkout #order_review table.shop_table tfoot tr.order-total td {
    font-size: 18px !important;
    font-weight: 700 !important;
}

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

@media (max-width: 768px) {
    .pda-upload-area {
        padding: 20px 15px;
    }
    
    .pda-drop-zone {
        padding: 30px 15px;
    }
    
    .pda-browse-btn {
        padding: 12px 24px;
        min-width: 160px;
    }
    
    .pda-file-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }
    
    .pda-file-info {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .pda-remove-btn {
        align-self: flex-end;
    }
    
    .pda-order-documents-section {
        padding: 15px;
    }
    
    .pda-product-documents {
        padding: 12px;
    }
    
    .pda-document-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 0;
    }
    
    .document-info {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .document-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .pda-view-btn,
    .pda-download-btn {
        margin-right: 8px;
        margin-bottom: 5px;
    }
    
    .pda-view-document,
    .pda-download-document {
        margin-left: 0;
        margin-right: 8px;
        margin-bottom: 5px;
    }
    
    .pda-order-documents-section .pda-document-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 0;
    }
    
    .pda-order-documents-section .document-actions {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .pda-order-documents-section .pda-view-btn,
    .pda-order-documents-section .pda-download-btn {
        margin-left: 0;
        margin-top: 8px;
        align-self: flex-start;
    }
    
    .cart_item .pda-cart-documents,
    .woocommerce-checkout-review-order-table .pda-cart-documents {
        padding-left: 8px;
        font-size: 15px !important;
    }
    
    /* Ajustar los totales en mobile */
    .woocommerce-checkout #order_review table.shop_table tfoot th,
    .woocommerce-checkout #order_review table.shop_table tfoot td {
        width: 50% !important;
    }
}

/* Animación para archivos nuevos */
@keyframes pda-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pda-file-item {
    animation: pda-fadeIn 0.3s ease-out;
} 