/* Apartments grid – cards, filters and floating "cere detalii" bar.
 * Paletă Ghica (aceleași culori ca pe single apartment). */
:root {
    --accent: #EB6920;
    --accent-80: #EF874D;
    --accent-60: #F3A579;
    --accent-40: #F7C3A6;
    --accent-20: #FBE1D2;
    --accent-10: #FDF0E9;
    --primary: #172843;
    --primary-80: #455369;
    --primary-60: #747E8E;
    --primary-40: #A2A9B4;
    --primary-20: #D7D7D7;
    --primary-10: #EBEBEB;
    --dark: #1F1F1F;
    --light: #FDF0E9;
    --danger: #D64545;
}

/* Floating mobile bar */
.cere-detalii-fixed {
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
    max-width: 100%;
    bottom: 0;
    transition: all 0.2s ease-in-out;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    display: flex;
    font-weight: 500;
}

.cere-detalii-fixed.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cere-detalii-fixed > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex: 1;
    padding: 8px;
    line-height: 1;
    gap: 4px;
    background-color: var(--accent);
}

.cere-detalii-fixed > a svg {
    width: 16px;
    height: 16px;
}

.cere-detalii-fixed > a:nth-child(2) {
    color: #fff;
    background-color: var(--primary);
}

@media screen and (min-width: 880px) {
    .cere-detalii-fixed {
        display: none !important;
    }
}

@media screen and (max-width: 360px) {
    .cere-detalii-fixed {
        font-size: 12px;
    }
}

/* No-results message (shown by JS when a filter combo matches nothing) */
.ap-no-results {
    text-align: center;
    padding: 32px 16px;
    margin: 0 0 20px;
    background-color: var(--accent-10);
    border-radius: 8px;
    color: var(--primary);
    font-weight: 500;
}

.ap-no-results[hidden] {
    display: none;
}

/* "More apartments" block */
.more-apartments {
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
    padding: 1rem 1rem;
    background-color: var(--accent-10);
    border-radius: 8px;
}

/* Grid + filters */
.ap {
    overflow: hidden;
}

.ap-filters-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin: 30px 0;
}

.ap-filters-wrap .button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.ap-filters-wrap .button-group .button {
    border-style: solid;
    border-width: 2px 2px 2px 2px;
    padding: 8px 16px 8px 16px;
    border-radius: 50rem;
    background-color: transparent;
    color: var(--primary);
}

.ap-filters-wrap .button-group.group-green .button {
    border-color: var(--accent);
}

.ap-filters-wrap .button-group.group-green .button:hover,
.ap-filters-wrap .button-group.group-green .button.is-checked {
    background-color: var(--accent);
}

.ap-filters-wrap .button-group.group-blue .button {
    border-color: var(--primary);
}

.ap-filters-wrap .button-group.group-blue .button:hover,
.ap-filters-wrap .button-group.group-blue .button.is-checked {
    background-color: var(--primary);
    color: #fff;
}

.ap-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -12px;
    margin-right: -12px;
}

.ap-item {
    padding: 0 12px;
    margin-bottom: 24px;
    width: 25%;
}

.ap-item-inner {
    height: 100%;
    background-color: #fff;
    border: 1px solid var(--primary-20);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Întreg cardul e link către pagina single */
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ap-item-inner:hover {
    background-color: var(--accent-10);
    box-shadow: 0 8px 24px rgba(23, 40, 67, 0.12);
    transform: translateY(-2px);
}

.ap-item-inner:hover,
.ap-item-inner:focus,
.ap-item-inner:hover .ap-item-top-info-1,
.ap-item-inner:focus .ap-item-top-info-1 {
    color: inherit;
}

/* Imagine card: pătrat 1:1, contain, fundal alb */
.ap-item-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #fff;
    border-radius: 3px;
    overflow: hidden;
    /* Centrare robustă chiar dacă tema forțează img{height:auto} */
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-item-image-main {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    background-color: #fff;
    display: block;
}

/* Duplex: miniatură cu nivelul secundar, colț dreapta-jos */
.ap-item-image-secondary {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 40%;
    height: 40%;
    object-fit: contain;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    transition: width 0.25s ease, height 0.25s ease, right 0.25s ease, bottom 0.25s ease, border-radius 0.25s ease, box-shadow 0.25s ease;
    z-index: 2;
}

/* La hover pe card, miniatura crește pe toată suprafața și pierde radius/umbră */
.ap-item-inner:hover .ap-item-image-secondary {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
}

.ap-item-top {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px;
}

.ap-item-top-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-transform: uppercase;
}

.ap-item-top-info-1 {
    display: flex;
    gap: 4px;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 700;
    line-height: 1em;
}

.ap-item-top-info-1-right {
    opacity: 0.4;
}

.ap-item-top-info-2 {
    display: flex;
    gap: 4px;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1em;
}

.ap-item-top-info-2-right {
    opacity: 0.7;
    display: flex;
    gap: 8px;
}

.ap-item-top-areas {
    display: flex;
    margin-top: 6px;
    color: var(--primary);
}

.ap-item-top-areas > div {
    width: 33.3333%;
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    text-align: center;
}

.ap-item-top-areas > div:nth-child(1) {
    background-color: #00000005;
}

.ap-item-top-areas > div:nth-child(2) {
    background-color: #FFFFFF66;
}

.ap-item-top-areas > div:nth-child(3) {
    background-color: #00000005;
}

.ap-item-top-areas > div > div:first-of-type {
    font-size: 24px;
    font-weight: 700;
    line-height: 1em;
}

.ap-item-top-areas > div > div:last-of-type {
    font-size: 13px;
    line-height: 1em;
    color: var(--primary-60);
}

.ap-item-bottom {
    padding: 10px;
}

.ap-item-bottom-price-wrap {
    position: relative;
}

.ap-item-bottom-price-full {
    text-decoration-line: line-through;
    opacity: 0.5;
    color: var(--accent);
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    line-height: 1em;
    display: block;
    position: absolute;
    bottom: 100%;
    margin-bottom: -6px;
}

.ap-item-bottom-price-full .ap-item-bottom-price-suffix {
    display: inline-block;
    font-weight: 400;
    text-decoration-line: line-through;
}

.ap-item-bottom-price {
    color: var(--accent);
    font-weight: 700;
    font-size: 20px;
    text-transform: uppercase;
    line-height: 1em;
    display: block;
    padding: 7px 0;
}

.ap-item-bottom-price .ap-item-bottom-price-suffix {
    display: inline-block;
    font-size: 16px;
    font-weight: 400;
}

.ap-item-bottom-price-with-vat-wrap {
    font-size: 13px;
    line-height: 1em;
    color: var(--primary-60);
    margin-top: -4px;
}

.ap-item-bottom-price-with-vat {
    font-weight: 700;
}

.ap-item-bottom-price-with-vat .ap-item-bottom-price-suffix {
    font-weight: 400;
}

.ap-item-bottom .rezervat {
    width: 100%;
    text-align: center;
    line-height: 1em;
    padding: 15px 10px;
    font-size: 15px;
    border-radius: 8px;
    background-color: var(--accent-20);
    color: var(--primary);
}

.ap-item-bottom .vandut {
    width: 100%;
    text-align: center;
    line-height: 1em;
    padding: 15px 10px;
    font-size: 15px;
    border-radius: 8px;
    background-color: var(--danger);
    color: #fff;
}

@media screen and (max-width: 1024px) {
    .ap-item {
        width: 33.333%;
    }
}

@media screen and (max-width: 879px) {
    .ap-item {
        width: 50%;
    }
}

@media screen and (max-width: 560px) {
    .ap-item {
        width: 100%;
    }
}
