/* ============================================
   MOBILE RESPONSIVE - Agriturismo Portella
   Aggiungere DOPO common.css e style.css
   ============================================ */

/* Viewport fix */
html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}

/* ---- TABLET e sotto (max 1024px) ---- */
@media screen and (max-width: 1024px) {

    body {
        overflow-x: hidden;
    }

    #wrapper {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    #screen {
        width: 100% !important;
        overflow: visible !important;
    }

    /* Nascondi colonna sinistra con immagine su tablet piccoli */
    #screen #column-left {
        display: none;
    }

    #screen #column-right {
        float: none !important;
        width: 100% !important;
        overflow: visible !important;
    }

    #screen #column-right #mainpage-wrapper {
        overflow: visible !important;
    }
}

/* ---- SMARTPHONE (max 768px) ---- */
@media screen and (max-width: 768px) {

    /* Logo */
    #logo {
        width: 100% !important;
        background-size: contain !important;
        background-position: center !important;
        height: 45px !important;
        margin-left: 0 !important;
        margin-top: 8px !important;
    }

    /* Menu container */
    #menu-container {
        width: 100% !important;
        height: auto !important;
        padding-left: 0 !important;
    }

    /* Menu inside */
    #menu_inside {
        width: 100% !important;
    }

    /* Menu home e menu principale */
    #menu-home,
    #menu {
        display: block !important;
        width: 100% !important;
        float: none !important;
        text-align: center !important;
        margin: 0 !important;
        padding: 5px 0 !important;
    }

    #menu_inside ul#menu li,
    #menu-home li {
        display: inline-block !important;
        width: auto !important;
        margin: 3px 5px !important;
        font-size: 11px !important;
    }

    #menu_inside ul#menu li.item-400 {
        width: auto !important;
    }

    /* Main content */
    #main {
        width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        padding-top: 20px !important;
    }

    /* Contenuto pagina */
    .space {
        max-width: 100% !important;
        padding: 0 15px !important;
    }

    /* Footer */
    #footer {
        background-size: cover !important;
    }

    #credits p {
        padding: 10px 15px !important;
        font-size: 10px !important;
    }

    /* Box list (camere, ristorante, ecc.) */
    .items {
        width: 100% !important;
        height: auto !important;
    }

    .items-detail .items-img {
        float: none !important;
        width: 100% !important;
        height: auto !important;
    }

    .items-detail .items-img img {
        width: 100% !important;
        height: auto !important;
    }

    .items-detail .items-desc {
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 15px !important;
    }

    .items-scheda {
        width: 100% !important;
        float: none !important;
        height: auto !important;
        margin-top: 10px !important;
    }

    /* Form contatti e prenotazioni */
    #form {
        width: 100% !important;
    }

    input[type="text"],
    input[type="email"],
    textarea {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Google Maps iframe */
    #iframe-map {
        width: 100% !important;
        height: 300px !important;
    }

    /* Slider immagini */
    .box-slider-image {
        width: 100% !important;
        height: auto !important;
    }

    /* Page border top */
    #page {
        border-top: 5px solid #69564a !important;
    }

    /* Testatina */
    #testatina {
        padding: 10px 15px !important;
    }

    /* Hamburger menu button */
    #menu-toggle {
        display: block !important;
        cursor: pointer;
        padding: 10px 15px;
        font-size: 22px;
        color: #69564a;
        text-align: right;
    }

    #menu_inside.menu-closed #menu,
    #menu_inside.menu-closed #menu-home {
        display: none !important;
    }

    #menu_inside.menu-open #menu,
    #menu_inside.menu-open #menu-home {
        display: block !important;
        width: 100% !important;
        background: #f6f6f6;
        padding: 10px 0 !important;
    }

    #menu_inside.menu-open ul#menu li,
    #menu_inside.menu-open #menu-home li {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        padding: 8px 20px !important;
        margin: 0 !important;
        border-bottom: 1px solid #ddd !important;
    }
}

/* ---- WIDGET HOME ---- */
@media screen and (max-width: 768px) {

    #widget-home {
        height: auto !important;
        padding-bottom: 15px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        padding-top: 15px !important;
    }

    .widget-box,
    .widget-box.last {
        display: block !important;
        width: calc(50% - 5px) !important;
        padding: 0 !important;
    }

    .widget-box img,
    .widget-box.last img {
        width: 100% !important;
        height: auto !important;
    }

    /* Popup home */
    .popup_home {
        width: 90% !important;
        left: 5% !important;
        right: 5% !important;
    }

    .popup_home img {
        width: 100% !important;
        height: auto !important;
    }

    /* Addthis follow */
    .b-fb-page {
        width: 100% !important;
    }
}

/* ---- TABELLE PREZZI E CONTENUTO GENERICO ---- */
@media screen and (max-width: 768px) {

    /* Tutte le tabelle */
    table {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 11px !important;
    }

    table td, table th {
        padding: 4px 6px !important;
        word-wrap: break-word !important;
    }

    /* Immagini generiche */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Contenuto pagina generico */
    #main p, #main ul, #main ol {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Fix overflow generale */
    #main * {
        max-width: 100% !important;
    }
}

/* ---- TABELLE ---- */
@media screen and (max-width: 768px) {

    table {
        width: 100% !important;
        font-size: 11px !important;
    }

    table td, table th {
        padding: 4px !important;
        word-break: break-word !important;
    }

    /* Contenitore pagina scrollabile orizzontalmente se necessario */
    .items-desc,
    .items-detail,
    #main .space {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}