/**
 * Pixxi Property Carousel — Frontend Styles
 * All rules scoped under .ppc-wrap to avoid theme conflicts.
 */

/* =========================================
   Scoped Reset
   ========================================= */
.ppc-wrap,
.ppc-wrap *,
.ppc-wrap *::before,
.ppc-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ppc-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
    padding: 0 48px; /* space for arrows */
}

.ppc-wrap img {
    max-width: 100%;
    height: auto;
    display: block;
}

.ppc-wrap a {
    text-decoration: none;
    color: inherit;
}

.ppc-wrap button {
    font-family: inherit;
}

/* =========================================
   Carousel Layout
   ========================================= */
.ppc-viewport {
    overflow: hidden;
    width: 100%;
}

.ppc-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.ppc-slide {
    flex: 0 0 calc(100% / 3);
    padding: 0 12px;
    min-width: 0;
}

@media (max-width: 1024px) {
    .ppc-slide {
        flex: 0 0 50%;
    }
}

@media (max-width: 640px) {
    .ppc-wrap {
        padding: 0 36px;
    }
    .ppc-slide {
        flex: 0 0 100%;
        padding: 0 6px;
    }
}

/* =========================================
   Arrow Buttons
   ========================================= */
.ppc-wrap .ppc-arrow {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #ddd !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10;
    transition: opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #333 !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.ppc-wrap .ppc-arrow:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.ppc-wrap .ppc-arrow:disabled {
    opacity: 0.3;
    cursor: default;
    box-shadow: none;
}

.ppc-wrap .ppc-arrow--prev {
    left: 0;
}

.ppc-wrap .ppc-arrow--next {
    right: 0;
}

@media (max-width: 640px) {
    .ppc-wrap .ppc-arrow {
        width: 32px !important;
        height: 32px !important;
    }
    .ppc-wrap .ppc-arrow svg {
        width: 16px;
        height: 16px;
    }
}

/* =========================================
   Navigation Dots
   ========================================= */
.ppc-wrap .ppc-nav-dots {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 20px 0 4px !important;
    margin: 0 !important;
    list-style: none !important;
}

.ppc-wrap .ppc-nav-dots .ppc-nav-dot {
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
    min-height: 10px !important;
    max-width: 10px !important;
    max-height: 10px !important;
    border-radius: 50% !important;
    background: #ccc !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transition: background 0.2s, transform 0.2s !important;
}

.ppc-wrap .ppc-nav-dots .ppc-nav-dot:hover {
    background: #999 !important;
}

.ppc-wrap .ppc-nav-dots .ppc-nav-dot.ppc-nav-dot--active {
    background: #333 !important;
    transform: scale(1.3) !important;
}

/* =========================================
   Property Card
   ========================================= */
.ppc-card {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ppc-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.ppc-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

/* ── Card Image ── */
.ppc-card__image {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #f0f0f0;
}

.ppc-card__photos {
    position: relative;
    width: 100%;
    height: 100%;
}

.ppc-wrap .ppc-card__img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ppc-wrap .ppc-card__img.ppc-card__img--active {
    opacity: 1;
}

/* ── Card Image Dots ── */
.ppc-card__dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
}

.ppc-card__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s;
}

.ppc-card__dot--active {
    background: #fff;
}

/* ── Card Badges ── */
.ppc-card__badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 2;
}

.ppc-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.3;
}

.ppc-badge--type {
    background: rgba(255, 255, 255, 0.92);
    color: #333;
    backdrop-filter: blur(4px);
}

.ppc-badge--listing {
    background: #1a1a1a;
    color: #fff;
}

/* ── Card Body ── */
.ppc-card__body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ppc-card__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1a1a1a;
}

/* ── Price ── */
.ppc-card__price-wrap {
    margin-bottom: 10px;
}

.ppc-card__price-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 1px;
}

.ppc-card__price {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ── Meta Row ── */
.ppc-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    margin-top: auto;
}

.ppc-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ppc-card__meta-item svg {
    flex-shrink: 0;
    color: #999;
}

.ppc-card__size {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

.ppc-card__size svg {
    flex-shrink: 0;
    color: #999;
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 640px) {
    .ppc-card__title {
        font-size: 15px;
    }
    .ppc-card__body {
        padding: 12px 14px 14px;
    }
}

/* =========================================
   No-JS Fallback: horizontal scroll
   ========================================= */
.no-js .ppc-viewport {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.no-js .ppc-viewport::-webkit-scrollbar {
    display: none;
}

.no-js .ppc-slide {
    scroll-snap-align: start;
}

.no-js .ppc-arrow,
.no-js .ppc-nav-dots {
    display: none;
}
