/* Header katalog */
.header h1 {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.header p {
    margin: 0;
    opacity: 0.85;
}

/* Filter bar */
.catalog-filters {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.02);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
}

.catalog-filters-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex: 1 1 auto;
}

.catalog-filters-left input[type="text"],
.catalog-filters-left select {
    min-width: 180px;
}

.catalog-filters-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.catalog-filters .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    font-size: 0.875rem;
    text-decoration: none;
}

/* Info meta */
.catalog-meta {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
}

/* Grid katalog 4x4 */
.catalog-grid {
    margin-top: 1.5rem;
    display: grid;
    gap: 1.1rem;
}

/* Desktop: 4 kolom */
@media (min-width: 1024px) {
    .catalog-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Tablet: 3 kolom */
@media (min-width: 768px) and (max-width: 1023px) {
    .catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile: 2 kolom */
@media (max-width: 767px) {
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Kartu katalog */
.catalog-card {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.catalog-card:focus {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}

.catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

/* Gambar */
.catalog-image {
    position: relative;
    overflow: hidden;
}

.catalog-image img {
    display: block;
    width: 100%;
    height: 210px;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.catalog-card:hover .catalog-image img {
    transform: scale(1.04);
}

.catalog-image-placeholder {
    height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(
        45deg,
        #f1f5f9,
        #f1f5f9 10px,
        #e2e8f0 10px,
        #e2e8f0 20px
    );
    font-size: 0.85rem;
    color: #64748b;
}

/* Body card */
.catalog-body {
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.catalog-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.catalog-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.1rem 0 0.2rem;
}

.catalog-price {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.98rem;
}

.catalog-desc {
    margin: 0.3rem 0 0;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #475569;
}

/* Footer note */
.catalog-footer-note {
    margin-top: 1.75rem;
    font-size: 0.85rem;
    text-align: center;
    color: #64748b;
}

.catalog-footer-note a {
    color: #0f172a;
    font-weight: 600;
    text-decoration: underline;
}

/* Pagination */
.catalog-pagination {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.catalog-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    font-size: 0.85rem;
    text-decoration: none;
    color: #0f172a;
    background: #ffffff;
}

.catalog-pagination .page-link:hover {
    background: #0f172a;
    color: #ffffff;
}

.catalog-pagination .page-link.is-current {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* Modal */
.catalog-modal {
    position: fixed;
    inset: 0;
    display: none; /* default: tersembunyi */
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 50;
}

.catalog-modal.is-open {
    display: flex;      /* baru muncul ketika is-open */
    opacity: 1;
    pointer-events: auto;
}

.catalog-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

/* Dialog utama: scroll di level ini */
.catalog-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: calc(100vh - 2rem); /* jangan melebihi tinggi layar */
    background: #ffffff;
    border-radius: 1.25rem;
    overflow-y: auto;    /* SCROLL DI SINI */
    overflow-x: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.5);
    z-index: 1;
}

/* Isi dialog (gambar + teks) */
.catalog-modal-content {
    display: flex;
    flex-direction: row;
    padding: 1.25rem 1.4rem 1.4rem;
    gap: 1rem;
}

/* Biar flex child boleh mengecil */
.catalog-modal-image,
.catalog-modal-body {
    min-height: 0;
}

/* Gambar di modal */
.catalog-modal-image {
    flex: 0 0 40%;
    background: #020617;
}

.catalog-modal-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #020617;
}

/* Body modal: tidak perlu max-height, scroll sudah di dialog */
.catalog-modal-body {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 0 0 0.25rem;
    overflow: visible;
}

/* Styling teks di body tetap sama */
.catalog-modal-category {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.catalog-modal-title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.catalog-modal-price {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.catalog-modal-short {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 0.4rem;
}

.catalog-modal-desc {
    font-size: 0.9rem;
    color: #334155;
    white-space: pre-line;
}

/* Tombol close */
.catalog-modal-close {
    position: absolute;
    top: 0.4rem;
    right: 0.6rem;
    border: none;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

/* Responsif modal (mobile) */
@media (max-width: 768px) {
    /* Modal direntangkan, dialog menempel atas dan bisa full-height */
    .catalog-modal {
        align-items: stretch;
        padding: 0.75rem;
    }

    .catalog-modal-dialog {
        width: 100%;
        max-height: 100vh;  /* penuh tinggi layar */
        margin: 0;
        border-radius: 1rem;
    }

    .catalog-modal-content {
        flex-direction: column;
        padding: 1rem;
    }

    .catalog-modal-image {
        flex: none;
    }

    .catalog-modal-image img {
        max-height: 260px;
        object-fit: cover;
    }

    .catalog-modal-body {
        padding: 0.75rem 0 0.75rem;
    }
}

/* Body lock ketika modal dibuka */
body.no-scroll {
    overflow: hidden;
}

.catalog-hint {
    font-size: 0.85rem;
    margin-top: 0.35rem;
    opacity: 0.8;
}

.catalog-modal-price {
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.catalog-modal-sizes-title{
    font-weight:600;
    margin-top:0.25rem;
    margin-bottom:0.25rem;
    font-size:0.9rem;
    }
.catalog-size-select{
    width:100%;
    margin-top:0.1rem;
    margin-bottom:0.35rem;
    padding:0.4rem 0.55rem;
    border-radius:0.45rem;
    border:1px solid rgba(15,23,42,0.15);
    font-size:0.9rem;
}
.catalog-size-note{
    font-size:0.8rem;
    color:#4b5563;
    margin-bottom:0.35rem;
}
.catalog-order-form{
    margin-top:0.25rem;
    margin-bottom:1rem;
}
.catalog-order-form .btn-primary{
    width:100%;
    text-align:center;
}
.catalog-order-hint{
    font-size:0.8rem;
    color:#6b7280;
    margin-top:0.25rem;
}