.laws-page {
    width: 100%;
    max-width: 1100px;
    min-height: calc(100vh - 120px);
    margin: 0 auto;
    padding: 40px 20px;
}

/* The display rules below would otherwise override the [hidden] attribute used by the search and infinite scroll. */
.laws-page [hidden] {
    display: none !important;
}

.laws-toolbar {
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 16px;
    background: #fff;
    border: 1px solid #dce7f3;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.laws-toolbar label {
    color: #1c2a3a;
    font-weight: 700;
    white-space: nowrap;
}

.laws-search-box {
    position: relative;
    width: 100%;
}

.laws-search-box i {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: #6c757d;
}

.laws-search-box input {
    width: 100%;
    min-height: 46px;
    padding: 10px 44px 10px 14px;
    border: 1px solid #c9d8e8;
    border-radius: 6px;
    color: #1c2a3a;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.laws-search-box input:focus {
    border-color: #4a9fe3;
    box-shadow: 0 0 0 3px rgba(74, 159, 227, 0.18);
}

.laws-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 14px;
    color: #0d47a1;
    background: #e3f2fd;
    border-radius: 6px;
    font-weight: 700;
    white-space: nowrap;
}

.laws-list {
    display: grid;
    gap: 14px;
}

.law-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    background: #fff;
    border: 1px solid #dce7f3;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.law-item:hover {
    transform: translateY(-2px);
    border-color: #b8d7f3;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.law-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.law-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    color: #1a5fb4;
    background: #eaf4ff;
    border-radius: 8px;
    font-size: 1.2rem;
}

.law-text {
    min-width: 0;
}

.law-text h2 {
    margin: 0 0 4px;
    color: #1c2a3a;
    font-size: 1.16rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.law-text span {
    display: inline-flex;
    color: #6c757d;
    font-size: 0.95rem;
}

.law-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 8px 18px;
    color: #fff;
    background: #4a9fe3;
    border: 1px solid #3a8fd3;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.law-open:hover {
    background: #3a8fd3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 159, 227, 0.26);
}

.law-item-enter {
    animation: lawItemEnter 0.35s ease;
}

@keyframes lawItemEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.laws-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #6c757d;
    font-weight: 600;
}

.laws-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 24px 0;
    padding: 28px;
    color: #495057;
    background: #fff;
    border: 1px solid #dce7f3;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    font-size: 1.1rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .laws-page {
        padding: 30px 15px;
    }

    .laws-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .laws-count {
        width: 100%;
    }

    .law-item {
        align-items: stretch;
        flex-direction: column;
    }

    .law-open {
        width: 100%;
    }
}
