/* =======================================================================
   AC14 MARCAS — Estilos compartidos v2.0
   ======================================================================= */

/* Forzar ancho completo cuando está dentro de Elementor */
.elementor-widget-shortcode .ac14m-archivo,
.elementor-widget-shortcode .ac14m-carrusel-wrapper {
    width: 100%;
    max-width: 100%;
}
.elementor-widget-shortcode:has(.ac14m-archivo) {
    width: 100% !important;
    max-width: 100% !important;
}

/* ── ARCHIVO DE MARCAS ─────────────────────────────────────────────────── */

.ac14m-archivo {
    max-width: 100%;
    padding: 20px 0;
}

/* Buscador */
.ac14m-archivo__buscador-wrap {
    position: relative;
    margin-bottom: 20px;
}
.ac14m-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}
.ac14m-archivo__buscador {
    width: 100%;
    padding: 12px 15px 12px 42px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color .2s;
    box-sizing: border-box;
}
.ac14m-archivo__buscador:focus {
    border-color: #cf2e2e;
    outline: none;
}

/* Filtros tipo */
.ac14m-archivo__filtros-tipo {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.ac14m-filtro-tipo {
    padding: 7px 16px;
    border: 1.5px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
}
.ac14m-filtro-tipo:hover { background: #eceff1; border-color: #bbb; }
.ac14m-filtro-tipo.activo { background: #cf2e2e; color: #fff; border-color: #cf2e2e; }

/* Filtros letra */
.ac14m-archivo__filtros-letra {
    display: grid;
    grid-template-columns: repeat(27, 1fr);
    gap: 4px;
    margin-bottom: 16px;
    width: 100%;
}
.ac14m-filtro-letra {
    width: 100%;
    height: 32px;
    padding: 0;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
    text-align: center;
}
.ac14m-filtro-letra:hover { background: #eceff1; border-color: #bbb; }
.ac14m-filtro-letra.activo { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

/* Barra info */
.ac14m-archivo__barra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}
#ac14m-contador {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}
#ac14m-reset {
    padding: 7px 16px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
}
#ac14m-reset:hover { background: #cf2e2e; }

/* Grid de marcas */
.ac14m-archivo__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

/* Tarjeta de marca */
.ac14m-marca-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 20px 14px 14px;
    text-align: center;
    transition: transform .2s, box-shadow .2s;
    animation: ac14mFadeIn .25s ease-in-out;
    position: relative;
}
.ac14m-marca-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.ac14m-marca-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}
.ac14m-marca-card img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    margin-bottom: 12px;
}
.ac14m-marca-card span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}
.ac14m-badge-propia {
    display: inline-block;
    margin-top: 6px;
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #fff !important;
    background: #cf2e2e;
    border-radius: 3px;
    padding: 2px 6px;
}

@keyframes ac14mFadeIn {
    from { opacity: 0; transform: scale(.97); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── CARRUSEL DE MARCAS ─────────────────────────────────────────────────── */

.ac14m-carrusel-wrapper {
    width: 100%;
    padding: 16px 0;
}
.ac14m-carrusel-seccion {
    margin-bottom: 32px;
}
.ac14m-carrusel-titulo {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}
.ac14m-carrusel {
    position: relative;
    width: 100%;
    padding: 16px 0;
}
/* Slider manual: se desliza con el dedo / la rueda o con las flechas (sin movimiento automático) */
.ac14m-carrusel__track {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 60px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 52px;
    scroll-padding: 0 52px;
}
.ac14m-carrusel__track::-webkit-scrollbar { display: none; }
.ac14m-carrusel__item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    scroll-snap-align: start;
}
.ac14m-carrusel__item img {
    max-width: 160px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: .85;
    transition: opacity .2s;
    display: block;
}
.ac14m-carrusel__item:hover img { opacity: 1; }

/* Flechas (las crea el JS solo si hay más marcas de las que caben) */
.ac14m-flecha {
    position: absolute;
    top: 50%;
    margin-top: -20px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    cursor: pointer;
    z-index: 2;
    transition: opacity .15s, background .15s;
}
.ac14m-flecha:hover { background: #f6f7f9; }
.ac14m-flecha[disabled] { opacity: 0; pointer-events: none; }
.ac14m-flecha--prev { left: 0; }
.ac14m-flecha--next { right: 0; }
.ac14m-flecha svg { width: 18px; height: 18px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .ac14m-carrusel__track { gap: 36px; padding: 0 12px; scroll-padding: 0 12px; }
    .ac14m-carrusel__item img { max-width: 120px; }
    .ac14m-flecha { width: 34px; height: 34px; margin-top: -17px; }
    .ac14m-archivo__grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
    .ac14m-filtro-letra  { min-width: 26px; height: 26px; font-size: 11px; }
}

.ac14m-flecha[hidden] { display: none; }

/* Arrastrar con el ratón (PC) */
@media (hover: hover) and (pointer: fine) {
    .ac14-arrastrable { cursor: grab; }
    .ac14-arrastrable img { -webkit-user-drag: none; user-select: none; }
}
.ac14-arrastrando { cursor: grabbing !important; user-select: none; }
.ac14-arrastrando * { pointer-events: none; }
