/*
 * Catalogue — public pages and admin.
 * Everything is scoped under .cat-* classes so existing pages are unaffected.
 * Colours follow the site: red #FF002A (buttons, active states),
 * dark #17303B (headings), light #F8F8F8 (surfaces).
 */
:root {
    --cat-accent: #FF002A;
    --cat-accent-dark: #8d0018;
    --cat-ink: #17303B;
    --cat-muted: #6c757d;
    --cat-border: #e4e7ea;
    --cat-surface: #F8F8F8;
    --cat-radius: 10px;
    --cat-shadow: 0 2px 10px rgba(23, 48, 59, 0.06);
}

/* ---------- Hero ---------- */
.cat-hero .cat-hero-text {
    color: rgba(255, 255, 255, 0.85);
    max-width: 720px;
    margin: 0 auto 1.75rem;
}

.cat-hero h1 {
    color: #fff;
}

.cat-search {
    max-width: 720px;
    margin: 0 auto;
}

.cat-search .form-control {
    height: 56px;
    border: 0;
    border-radius: 60px 0 0 60px;
    padding-left: 1.5rem;
}

.cat-search .btn {
    border-radius: 0 60px 60px 0;
    padding: 0 1.75rem;
}

/* ---------- Category navigation ---------- */
.cat-category-card {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    color: var(--cat-ink);
    transition: border-color .2s, box-shadow .2s;
}

.cat-category-card:hover,
.cat-category-card:focus-visible,
.cat-category-card.is-active {
    border-color: var(--cat-accent);
    box-shadow: var(--cat-shadow);
    color: var(--cat-ink);
}

.cat-category-card.is-empty:not(.is-active) {
    opacity: .55;
}

.cat-category-thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: var(--cat-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--cat-accent);
    font-size: 1.4rem;
}

.cat-category-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-category-name {
    font-weight: 600;
    line-height: 1.25;
    display: block;
}

.cat-category-count {
    font-size: .85rem;
    color: var(--cat-muted);
}

/* ---------- Filters ---------- */
.cat-filters {
    background: #fff;
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    padding: 1.25rem;
}

.cat-filters .form-label {
    font-weight: 600;
    color: var(--cat-ink);
    font-size: .9rem;
    margin-bottom: .35rem;
}

.cat-filters-title {
    font-size: 1.1rem;
    color: var(--cat-ink);
}

.cat-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.cat-result-count {
    color: var(--cat-muted);
    margin: 0;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border: 1px solid var(--cat-border);
    border-radius: 60px;
    font-size: .85rem;
    background: #fff;
    color: var(--cat-ink);
}

.cat-chip:hover {
    border-color: var(--cat-accent);
}

/* ---------- Product cards ---------- */
.cat-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}

.cat-card:hover {
    box-shadow: var(--cat-shadow);
    border-color: #d3d8dc;
}

.cat-card-media {
    display: block;
    aspect-ratio: 4 / 3;
    background: #fff;
    border-bottom: 1px solid var(--cat-border);
    position: relative;
}

.cat-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.cat-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--cat-surface);
    color: #b5bcc2;
    font-size: .8rem;
}

.cat-placeholder i {
    font-size: 2.2rem;
}

.cat-badge-featured {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--cat-ink);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
}

.cat-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1rem 1.1rem 1.1rem;
}

.cat-brand {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cat-accent);
    margin-bottom: .25rem;
    min-height: 1.1em;
}

.cat-card-title {
    font-size: 1.05rem;
    line-height: 1.35;
    margin-bottom: .35rem;
}

.cat-card-title a {
    color: var(--cat-ink);
}

.cat-part {
    font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .82rem;
    color: var(--cat-muted);
    margin-bottom: .5rem;
    word-break: break-word;
}

.cat-card-text {
    font-size: .9rem;
    color: #555;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-card-actions {
    margin-top: auto;
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.cat-card-actions .btn {
    flex: 1 1 auto;
    font-size: .875rem;
    padding: .45rem .75rem;
}

.cat-btn-outline {
    border: 1px solid var(--cat-ink);
    color: var(--cat-ink);
    background: #fff;
}

.cat-btn-outline:hover,
.cat-btn-outline:focus {
    background: var(--cat-ink);
    border-color: var(--cat-ink);
    color: #fff !important;
}

/* ---------- States ---------- */
.cat-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: #fff;
    border: 1px dashed var(--cat-border);
    border-radius: var(--cat-radius);
}

.cat-state i {
    font-size: 2.5rem;
    color: #c4cad0;
    margin-bottom: 1rem;
}

/* ---------- Pagination (Laravel bootstrap-5 view) ---------- */
.cat-pagination .page-link {
    color: var(--cat-ink);
}

.cat-pagination .page-item.active .page-link {
    background: var(--cat-accent);
    border-color: var(--cat-accent);
    color: #fff !important;
}

/* ---------- Product detail ---------- */
.cat-gallery-main {
    display: block;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    background: #fff;
    overflow: hidden;
}

.cat-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.cat-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.cat-thumb {
    width: 72px;
    height: 72px;
    padding: 4px;
    border: 1px solid var(--cat-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.cat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cat-thumb[aria-current="true"],
.cat-thumb:hover,
.cat-thumb:focus-visible {
    border-color: var(--cat-accent);
}

.cat-meta {
    border-top: 1px solid var(--cat-border);
    margin: 1.25rem 0;
}

.cat-meta div {
    display: flex;
    gap: 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--cat-border);
}

.cat-meta dt {
    flex: 0 0 42%;
    font-weight: 600;
    color: var(--cat-ink);
}

.cat-meta dd {
    margin: 0;
    word-break: break-word;
}

.cat-section-title {
    color: var(--cat-ink);
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.cat-specs {
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    overflow: hidden;
}

.cat-specs table {
    margin: 0;
}

.cat-specs th {
    width: 40%;
    background: var(--cat-surface);
    color: var(--cat-ink);
    font-weight: 600;
}

.cat-specs th,
.cat-specs td {
    padding: .7rem 1rem;
    border-color: var(--cat-border);
}

.cat-description {
    color: #444;
    line-height: 1.7;
}

.cat-preview-banner {
    background: #fff3cd;
    border-bottom: 1px solid #ffe08a;
    color: #664d03;
    padding: .75rem 1rem;
    text-align: center;
    font-weight: 600;
}

/* ================= Admin ================= */
.cat-admin {
    background: #f3f5f7;
    font-family: 'Inter', 'Roboto', sans-serif;
    color: #2b3a42;
    min-height: 100vh;
}

/* Not in Bootstrap 5.0 */
.cat-admin .fw-semibold {
    font-weight: 600;
}

.cat-admin a:hover {
    color: var(--cat-accent);
}

.cat-admin-nav {
    background: var(--cat-ink);
}

.cat-admin-nav .navbar-brand img {
    height: 34px;
}

.cat-admin-nav .nav-link {
    color: rgba(255, 255, 255, .78);
    font-weight: 500;
    padding: .9rem 1rem !important;
}

.cat-admin-nav .nav-link:hover,
.cat-admin-nav .nav-link.is-active {
    color: #fff !important;
    box-shadow: inset 0 -3px 0 var(--cat-accent);
}

.cat-admin-nav .navbar-toggler {
    border-color: rgba(255, 255, 255, .4);
    color: #fff;
}

.cat-panel {
    background: #fff;
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    padding: 1.25rem;
}

.cat-panel-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--cat-ink);
    margin-bottom: 1rem;
}

.cat-stat {
    background: #fff;
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    padding: 1rem 1.25rem;
    height: 100%;
    display: block;
    color: inherit;
}

a.cat-stat:hover {
    border-color: var(--cat-accent);
}

.cat-stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--cat-ink);
    line-height: 1.1;
}

.cat-stat-label {
    font-size: .85rem;
    color: var(--cat-muted);
}

.cat-table {
    background: #fff;
}

.cat-table th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--cat-muted);
    font-weight: 600;
    white-space: nowrap;
}

.cat-table td {
    vertical-align: middle;
}

.cat-thumb-sm {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 1px solid var(--cat-border);
    border-radius: 6px;
    background: #fff;
}

.cat-thumb-sm.is-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #c4cad0;
    background: var(--cat-surface);
}

.cat-status {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 60px;
    white-space: nowrap;
}

.cat-status-published,
.cat-status-active {
    background: #e3f6ec;
    color: #146c43;
}

.cat-status-draft,
.cat-status-inactive {
    background: #eef0f2;
    color: #59646c;
}

.cat-status-new {
    background: #fde2e6;
    color: #a3001b;
}

.cat-status-in_progress {
    background: #fff3cd;
    color: #664d03;
}

.cat-admin .form-label {
    font-weight: 600;
    font-size: .9rem;
}

.cat-admin .form-text {
    font-size: .8rem;
}

.cat-spec-row + .cat-spec-row {
    margin-top: .5rem;
}

.cat-gallery-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .75rem;
}

.cat-gallery-admin .cat-gallery-item {
    border: 1px solid var(--cat-border);
    border-radius: 8px;
    padding: .5rem;
    background: #fff;
}

.cat-gallery-admin img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--cat-surface);
    border-radius: 6px;
    margin-bottom: .4rem;
}

.cat-import-table td,
.cat-import-table th {
    font-size: .85rem;
    vertical-align: top;
}

.cat-row-error {
    background: #fff5f6;
}

.cat-login {
    max-width: 420px;
    margin: 8vh auto;
}
