/* === LeafPack Public Styles === */

.leafpack-mochila {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1f2937;
    max-width: 100%;
    margin: 0 auto;
}

/* Header */
.leafpack-header {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.leafpack-title {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.leafpack-desc {
    margin: 0 0 0.75rem;
    color: #4b5563;
}

.leafpack-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.leafpack-total-peso {
    color: #0f766e;
}

.leafpack-total-precio {
    color: #0369a1;
}

/* Grupos (accordion) */
.leafpack-grupos {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leafpack-grupo {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #ffffff;
}

.leafpack-grupo-summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.05rem;
    border-left: 5px solid #9ca3af;
    background: #ffffff;
    transition: background 0.2s ease;
}

.leafpack-grupo-summary::-webkit-details-marker {
    display: none;
}

.leafpack-grupo-summary::marker {
    display: none;
}

.leafpack-grupo[open] .leafpack-grupo-summary {
    background: #f3f4f6;
}

.leafpack-grupo-icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.leafpack-grupo-nombre {
    flex: 1 1 auto;
}

.leafpack-grupo-count {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

/* Colores de grupo */
.leafpack-color-orange { border-left-color: #f97316; }
.leafpack-color-purple { border-left-color: #a855f7; }
.leafpack-color-yellow { border-left-color: #eab308; }
.leafpack-color-green  { border-left-color: #22c55e; }
.leafpack-color-indigo { border-left-color: #6366f1; }
.leafpack-color-gray   { border-left-color: #9ca3af; }
.leafpack-color-red    { border-left-color: #ef4444; }
.leafpack-color-blue   { border-left-color: #3b82f6; }

/* Contenido del grupo */
.leafpack-grupo-content {
    padding: 1rem 1.25rem 1.25rem;
}

/* Grid de objetos */
.leafpack-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .leafpack-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (min-width: 1024px) {
    .leafpack-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Item */
.leafpack-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.leafpack-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.leafpack-item-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.leafpack-item-img-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-bottom: 1px solid #e5e7eb;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.leafpack-item-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.leafpack-item-body {
    padding: 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.leafpack-item-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.leafpack-item-title a {
    color: #2563eb;
    text-decoration: none;
}

.leafpack-item-title a:hover {
    text-decoration: underline;
}

.leafpack-item-desc,
.leafpack-item-notas {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.4;
}

.leafpack-item-meta {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #374151;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.leafpack-item-peso {
    color: #0f766e;
}

.leafpack-item-precio {
    color: #0369a1;
    font-weight: 600;
}

/* Errores */
.leafpack-error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 1rem;
    border-radius: 0.5rem;
}
