/* ============================================
   Package Cart System
   ============================================ */

/* Cart Button in Sidebar */
.cart-button-container {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.btn-cart {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
}

.btn-cart:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    background: var(--error);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Add to Cart Buttons */
.btn-add-cart {
    padding: 8px 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.05);
}

.btn-add-folder-cart {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    z-index: 10;
}

.folder-thumbnail-card {
    position: relative;
}

.folder-thumbnail-card:hover .btn-add-folder-cart {
    opacity: 1;
}

.btn-add-folder-cart:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.05);
}

/* Location heart indicator on folder thumbnail cards */
.loc-heart-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.2s, background 0.2s;
    padding: 0;
    line-height: 1;
}

.loc-heart-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.15);
}

.loc-heart-btn .heart {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
    pointer-events: none;
}

.loc-heart-btn.partial .heart {
    color: #f6ad55;
}

.loc-heart-btn.partial {
    background: rgba(255, 255, 255, 0.85);
}

.loc-heart-btn.all .heart {
    color: #ef4444;
}

.loc-heart-btn.all {
    background: rgba(255, 255, 255, 0.9);
}

@keyframes locHeartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

.loc-heart-btn.pop .heart {
    animation: locHeartPop 0.35s ease;
}

/* File item with actions */
.file-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.12s ease;
}

.file-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Modal Sizes */
.modal-medium {
    width: 560px;
    max-width: 95vw;
    padding: 28px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-large {
    width: 800px;
    max-width: 95vw;
    padding: 28px;
    max-height: 92vh;
    overflow-y: auto;
}

.modal-wide {
    width: 1000px;
    max-width: 96vw;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Project technicians / work-requests bulk panel */
.wr-panel-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-input, #f3f4f6);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
}
.wr-panel-body {
    max-height: 58vh;
    overflow-y: auto;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
}
.wr-panel-table {
    width: 100%;
    border-collapse: collapse;
}
.wr-panel-table th {
    position: sticky;
    top: 0;
    background: var(--bg-input, #f9fafb);
    z-index: 1;
}
.wr-panel-table th,
.wr-panel-table td {
    padding: 8px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
}
.wr-panel-table td .btn-small { margin-right: 4px; }
.wr-modify-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}
@media (max-width: 620px) {
    .wr-modify-grid { grid-template-columns: 1fr; }
}
.wr-modify-grid .form-group-full { grid-column: 1 / -1; }
.wr-modify-grid input,
.wr-modify-grid textarea {
    width: 100%;
    padding: 8px 11px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* Cart Modal */
.cart-items-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.btn-remove-cart {
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.btn-remove-cart:hover {
    background: var(--error-light);
}

.cart-folder-group {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

.cart-folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    font-size: 0.9rem;
}

.cart-folder-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    display: inline-block;
}

.cart-folder-arrow.open {
    transform: rotate(90deg);
}

.cart-folder-icon {
    font-size: 1.1rem;
}

.cart-folder-name {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-folder-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.cart-folder-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.cart-folder-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
}

.cart-photo-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-photo-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.cart-photo-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.cart-photo-thumb:hover .cart-photo-remove {
    opacity: 1;
}

/* My Packages Grid */

/* aviso del carrito mientras falta el proyecto o el decorado del envío */
.paquete-falta-destino { color: var(--warning); font-weight: 500; }

/* carrito y formulario de un envío nuevo hecho a partir de otro */
.envio-previo-aviso { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius); background: var(--bg-dark); font-size: 0.85rem; color: var(--text-secondary); }
.envio-previo-aviso[hidden] { display: none; }
