/* ════════════════════════════════════════════════════════════
   rambal_allcategories  –  SparkFun-style category grid
   ════════════════════════════════════════════════════════════ */

.rac-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 80px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

/* ── Heading ───────────────────────────────────────────────── */
.rac-page-heading {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 8px 0 24px;
    line-height: 1.2;
}

/* ── Search ────────────────────────────────────────────────── */
.rac-search-bar {
    position: relative;
    max-width: 400px;
    margin-bottom: 28px;
}

.rac-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9ca3af;
    pointer-events: none;
}

.rac-filter-input {
    width: 100%;
    padding: 9px 34px 9px 36px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: .88rem;
    color: #111;
    background: #fff;
    outline: none;
    box-sizing: border-box;
}

.rac-filter-input:focus {
    border-color: #e8323c;
    box-shadow: 0 0 0 3px rgba(232,50,60,.10);
}

.rac-filter-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 1rem;
    padding: 2px 4px;
    line-height: 1;
    display: none;
}
.rac-filter-clear.visible { display: block; }

/* ── Grid ──────────────────────────────────────────────────── */
.rac-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ── Card ──────────────────────────────────────────────────── */
.rac-block {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow .18s, transform .18s;
}

.rac-block:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
    transform: translateY(-2px);
}

.rac-block.hidden { display: none !important; }

/* ── Category image ────────────────────────────────────────── */
.rac-cat-img-link {
    display: block;
    width: 100%;
    height: 140px;
    background: #f3f4f6;
    overflow: hidden;
    text-decoration: none;
    flex-shrink: 0;
}

.rac-cat-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .25s;
}

.rac-block:hover .rac-cat-img-link img {
    transform: scale(1.04);
}

.rac-cat-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
}
.rac-cat-img-placeholder svg {
    width: 40px;
    height: 40px;
}

/* ── Card body ─────────────────────────────────────────────── */
.rac-card-body {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Category title ────────────────────────────────────────── */
.rac-cat-title {
    display: block;
    font-size: .95rem;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    margin-bottom: 8px;
    line-height: 1.3;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}
.rac-cat-title:hover { color: #e8323c; }

/* ── Sub-list ──────────────────────────────────────────────── */
.rac-sub-list {
    list-style: none;
    margin: 0 0 auto;
    padding: 0;
    flex: 1;
}

.rac-sub-item > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: .8rem;
    color: #374151;
    text-decoration: none;
    line-height: 1.35;
    border-bottom: 1px solid #f9f9f9;
}
.rac-sub-item:last-child > a { border-bottom: none; }
.rac-sub-item > a:hover { color: #e8323c; }
.rac-sub-item > a:hover .rac-arrow { opacity: 1; }

.rac-arrow {
    flex-shrink: 0;
    color: #e8323c;
    opacity: 0;
    font-size: .75rem;
    transition: opacity .12s;
}

/* ── Products ──────────────────────────────────────────────── */
.rac-prod-item > a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 0;
    font-size: .8rem;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #f9f9f9;
}
.rac-prod-item:last-child > a { border-bottom: none; }
.rac-prod-item > a:hover { color: #e8323c; }

.rac-prod-thumb {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
}

/* ── Ver todo ──────────────────────────────────────────────── */
.rac-view-all {
    display: inline-block;
    margin-top: 10px;
    font-size: .75rem;
    font-weight: 600;
    color: #e8323c;
    text-decoration: none;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.rac-view-all:hover { text-decoration: underline; }

/* ── Empty state ───────────────────────────────────────────── */
.rac-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    display: none;
}
.rac-empty p { font-size: .95rem; margin: 0; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

/* 3 columns — large tablet */
@media (max-width: 1100px) {
    .rac-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 2 columns — tablet / small laptop */
@media (max-width: 768px) {
    .rac-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .rac-cat-img-link { height: 110px; }
    .rac-page-heading { font-size: 1.4rem; }
}

/* 1 column — mobile */
@media (max-width: 480px) {
    .rac-wrapper { padding: 0 10px 60px; }
    .rac-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .rac-cat-img-link { height: 160px; }
    .rac-page-heading { font-size: 1.25rem; margin-bottom: 16px; }
    .rac-search-bar { max-width: 100%; margin-bottom: 16px; }
    .rac-card-body { padding: 10px 12px 12px; }
}
