/* Global responsive guardrails for all templates */

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
video,
canvas,
svg,
iframe {
    max-width: 100%;
    height: auto;
}

table {
    width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

.container,
.container-fluid {
    width: 100%;
}

/* Prevent common card/grid overflow in custom templates */
[class*="card"],
[class*="panel"],
[class*="box"] {
    min-width: 0;
}

/* Laptops/small desktops */
@media (max-width: 1200px) {
    .row {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .container,
    .container-fluid {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .top-nav,
    .side-card,
    .main-card,
    .form-card {
        border-radius: 14px !important;
    }

    .property-title {
        font-size: 1.8rem !important;
        line-height: 1.25 !important;
    }

    .price-tag {
        font-size: 1.45rem !important;
        padding: 10px 20px !important;
    }
}

/* Phones */
@media (max-width: 768px) {
    .container,
    .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .hero-img-wrap {
        min-height: 280px !important;
    }

    .content-body,
    .form-container,
    .form-card,
    .side-card {
        padding: 16px !important;
    }

    .property-title {
        font-size: 1.5rem !important;
    }

    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .feature-item {
        padding: 10px !important;
    }

    .gallery-controls {
        right: 12px !important;
        bottom: 12px !important;
    }

    .gallery-counter {
        top: 12px !important;
        left: 12px !important;
        font-size: 12px !important;
    }

    .thumb-btn img {
        width: 84px !important;
        height: 62px !important;
    }
}

/* Small phones */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .property-title {
        font-size: 1.3rem !important;
    }

    .price-tag {
        font-size: 1.2rem !important;
        padding: 8px 14px !important;
    }

    .features-grid {
        grid-template-columns: 1fr !important;
    }

    .btn,
    .contact-btn,
    .btn-gradient,
    .btn-upload {
        width: 100%;
    }
}
