:root { --topbar-h: 60px; --sidebar-w: 300px; --folder: #f4b400; }
body { background: #F3F1EE; padding-top: var(--topbar-h); font-family: 'Nunito', Arial, sans-serif; font-size: 13px;}
.dam-topbar { height: var(--topbar-h); z-index: 1040; }

#searchForm, #searchForm input, #btnDownloadCat, #pmAll{font-size:13px}
.btn{background-color: #4F4A45!important;--bs-btn-border-color:#4F4A45!important;border-color:#4F4A45!important}
.btn:hover{background-color: #655e58!important;--bs-btn-border-color:#4F4A45!important;border-color:#4F4A45!important}
.btn-outline-secondary, #btnMore{color:#ffffff!important}

.dam-topbar .btn{background-color: #ffffff!important;--bs-btn-border-color:#4F4A45!important;border-color:#4F4A45!important}
.dam-topbar .btn:hover{background-color: #ffffff!important;}

/* Sidebar */
@media (min-width: 992px) {
  .dam-sidebar.offcanvas-lg { position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: var(--sidebar-w); overflow-y: auto; z-index: 1020; }
  .dam-main { margin-left: var(--sidebar-w); }
}
.tree-home, .tree-link { color: #333; text-decoration: none; }
.tree-home { display: block; padding: .45rem .6rem; border-radius: .5rem; font-weight: 500; }
.tree-home:hover, .tree-row:hover { background: #eef1f5; }
.tree-home.active, .tree-link.active { color: #4F4A45; font-weight: 600; }
.tree { margin: 0; padding: 0; }
.tree-sub { display: none; padding-left: 1rem; }
li.open > .tree-sub { display: block; }
.tree-row { display: flex; align-items: center; gap: .15rem; border-radius: .5rem; padding-right: .25rem; }
.tree-toggle { border: 0; background: none; width: 26px; height: 30px; color: #777; flex: none; padding: 0; }
.tree-toggle i { transition: transform .15s; display: inline-block; }
li.open > .tree-row .tree-toggle i { transform: rotate(90deg); }
.tree-link { flex: 1; min-width: 0; padding: .3rem .25rem; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-link i { color: var(--folder); margin-right: .25rem; }
.tree-dl { opacity: 0; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #555; flex: none; }
.tree-row:hover .tree-dl { opacity: 1; }
.tree-dl:hover { background: var(--bs-primary); color: #fff; }
@media (hover: none) { .tree-dl { opacity: 1; } }

/* Subbar */
.dam-subbar { position: sticky; top: var(--topbar-h); z-index: 1010; background: #fff; border-bottom: 1px solid #e3e6ea; padding: .7rem 1.25rem; }
.breadcrumb a { text-decoration: none; color:#635D56}
.breadcrumb-item.active { font-weight: 600; }

/* Folders */
.folder-card { position: relative; background: #fff; border: 1px solid #e3e6ea; border-radius: .9rem; padding: 1.2rem 1rem; text-align: center; cursor: pointer; transition: box-shadow .15s, transform .15s; height: 100%; }
.folder-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.09); transform: translateY(-2px); }
.folder-ico { font-size: 4rem; color: var(--folder); line-height: 1; }
.folder-title { font-weight: 600; margin-top: .4rem; overflow-wrap: anywhere; }
.folder-meta { color: #6c757d; font-size: .85rem; }
.folder-dl { position: absolute; top: .5rem; right: .5rem; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid #dde1e6; color: #333; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.folder-card:hover .folder-dl { opacity: 1; }
.folder-dl:hover { background: var(--bs-primary); color: #fff; border-color: var(--bs-primary); }
@media (hover: none) { .folder-dl { opacity: 1; } }

/* Products */
.prod-card { position: relative; background: #fff; border: 2px solid transparent; border-radius: .9rem; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); height: 100%; display: flex; flex-direction: column; }
.prod-card.selected { border-color: var(--bs-primary); }
.prod-thumb { aspect-ratio: 1/1; background: #fff; display: flex; align-items: center; justify-content: center; cursor: zoom-in; border-bottom: 1px solid #f0f2f4; }
.prod-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.prod-thumb .bi { font-size: 3rem; color: #c3c8cf; }
.prod-check { position: absolute; top: .5rem; left: .5rem; background: rgba(255,255,255,.92); border-radius: .4rem; padding: .15rem .35rem; line-height: 1; z-index: 2; }
.prod-check input { width: 1.15rem; height: 1.15rem; cursor: pointer; margin: 0; }
.prod-count { position: absolute; top: .5rem; right: .5rem; z-index: 2; }
.prod-body { padding: .7rem .8rem .3rem; flex: 1; }
.prod-ref { font-weight: 700; font-size: .95rem; overflow-wrap: anywhere; }
.prod-exc { color: #6c757d; font-size: .82rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-foot { padding: .6rem .8rem .8rem; display: flex; gap: .4rem; }
.prod-foot .btn-primary { flex: 1; }

/* Selection bar / toast */
.selbar { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: #212529; color: #fff; padding: .7rem 1.2rem; border-radius: 3rem; box-shadow: 0 8px 28px rgba(0,0,0,.3); z-index: 1050; }
.dl-toast { position: fixed; right: 1.2rem; bottom: 1.2rem; background: #fff; border: 1px solid #dde1e6; padding: .8rem 1.1rem; border-radius: .7rem; box-shadow: 0 8px 28px rgba(0,0,0,.18); z-index: 1060; }
.selbar:not(.d-none) ~ .dl-toast { bottom: 5rem; }
.modal-img { background: #fff; border: 1px solid #e3e6ea; border-radius: .7rem; overflow: hidden; text-align: center; }
.modal-img img { width: 100%; aspect-ratio: 1/1; object-fit: contain; }
.modal-img .name { font-size: .75rem; color: #6c757d; padding: .3rem .5rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Bloqueado hasta introducir contraseña */
.dam-locked { background: #e9ecef; }
.dam-locked .dam-main, .dam-locked .dam-sidebar { visibility: hidden; }