/* Responsive overrides for Cowgirls Espresso */
/* Overrides the fixed 1180px layout from style.css without modifying it */

/* Hamburger menu button — hidden on desktop */
#hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1000;
    position: relative;
}

#hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background: #D93783;
    margin: 5px 0;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate hamburger to X when open */
.nav-open #hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.nav-open #hamburger span:nth-child(2) {
    opacity: 0;
}

.nav-open #hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -7px);
}

/* Make fixed-width containers fluid */
@media screen and (max-width: 1200px) {
    #layout {
        width: 100% !important;
        max-width: 1180px;
    }

    #content,
    #content .mid,
    #center {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    .col-mid {
        width: 100% !important;
        max-width: 1180px;
    }

    .coffe-box,
    .serving-box,
    .school-box,
    .staff-box,
    .news-box {
        width: auto !important;
        box-sizing: border-box;
    }

    #header {
        width: 100% !important;
        max-width: 1180px;
        margin: 0 auto;
    }

    #footerCntr {
        width: 100% !important;
    }

    .footer-box {
        width: 100% !important;
        box-sizing: border-box;
    }

    #navigation {
        width: 100% !important;
        box-sizing: border-box;
    }

    #content {
        background-size: contain;
    }
}

/* Tablet */
@media screen and (max-width: 768px) {
    /* Constrain media elements without breaking JS-driven layouts */
    video, iframe, embed, object {
        max-width: 100% !important;
        height: auto;
    }

    body {
        overflow-x: hidden;
    }

    #layout {
        width: 100% !important;
        float: none !important;
        margin: 0 auto !important;
        overflow-x: hidden;
        padding: 0 15px;
        box-sizing: border-box;
    }

    #content {
        float: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background-image: none !important;
        background-color: transparent !important;
    }

    #content .mid {
        float: none !important;
        width: 100% !important;
        padding: 0 15px 20px 15px !important;
        box-sizing: border-box !important;
        background-image: none !important;
        background-color: #fff !important;
    }

    #center {
        float: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Center text in serving-box left column (theme days etc) */
    .serving-box .left,
    .serving-box .coffe .left {
        text-align: center !important;
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .serving-box h2,
    .serving-box h3 {
        text-align: center !important;
    }

    .serving-box .left h2 {
        text-align: center !important;
    }

    /* Center headings on mobile */
    .coffe-box h1,
    .coffe-box h2,
    .serving-box h2,
    .serving-box h3,
    .news-box h1 {
        text-align: center !important;
    }

    /* Stack left/right columns in news-box */
    .news-box .left {
        width: 100% !important;
        float: none !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .news-box .right {
        width: 100% !important;
        float: none !important;
        padding: 0 !important;
        margin-top: 20px;
        text-align: center;
        position: static !important;
    }

    .news-box .right img.arrow,
    .school-box .right img.arrow,
    img.arrow {
        display: none !important;
    }

    .news-box .right h4 {
        text-align: center !important;
    }

    .news-box .right p {
        text-align: center !important;
        padding: 10px 0 !important;
    }

    .news-box .right img {
        display: block;
        margin: 10px auto;
    }

    /* School-box (theme days + slideshow) */
    .school-box {
        padding: 20px 15px 0 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .school-box .left {
        width: 100% !important;
        float: none !important;
        background-image: none !important;
        text-align: center;
    }

    .school-box .right {
        width: 100% !important;
        float: none !important;
        position: static !important;
        text-align: center;
        padding: 0 !important;
    }

    .school-box .right p {
        padding: 10px 0 !important;
        text-align: center !important;
    }

    .school-box .right h4 {
        text-align: center !important;
    }

    .school-box h1 {
        text-align: center !important;
    }

    .school-box h2 {
        text-align: center !important;
    }

    .school-box .days {
        text-align: center;
    }

    .school-box .days table {
        width: 100% !important;
        margin: 0 auto;
    }

    .school-box .days td {
        display: block;
        text-align: center;
    }

    .school-box .slider {
        width: 100% !important;
        padding: 15px 0 !important;
        background-image: none !important;
        box-sizing: border-box;
    }

    .school-box .text {
        width: 100% !important;
    }

    /* Stack coffe-box columns */
    .coffe-box .coffe,
    .coffe-box .location {
        width: 100% !important;
        float: none !important;
    }

    .coffe-box .location {
        margin-right: 0 !important;
        padding: 0 !important;
    }

    .coffe-box .left,
    .coffe-box .right {
        width: 100% !important;
        float: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
        background-image: none !important;
        text-align: center;
    }

    .coffe-box .left img,
    .coffe-box .right img {
        display: inline-block;
        margin: 0 auto;
    }

    /* Homepage location/promo boxes */
    .coffe-box li {
        width: 100% !important;
        height: auto !important;
        background-size: 100% 100% !important;
        display: flex;
        align-items: center;
        box-sizing: border-box;
    }

    .coffe-box .home {
        width: 30% !important;
        float: none !important;
        flex-shrink: 0;
    }

    .coffe-box .home img {
        width: 100%;
        height: auto;
    }

    .coffe-box .find {
        width: 65% !important;
        float: none !important;
        padding: 10px !important;
    }

    .coffe-box .find h2 {
        font-size: 18px !important;
        line-height: 1.2 !important;
    }

    /* Stack serving-box columns */
    .serving-box .coffe,
    .serving-box .location {
        width: 100% !important;
        float: none !important;
    }

    .serving-box .left,
    .serving-box .right {
        width: 100% !important;
        float: none !important;
    }

    /* Staff box */
    .staff-box {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .staff-box li {
        margin-right: 20px !important;
    }

    /* Profile detail */
    .profile_pic,
    .profile_blurb {
        width: 100% !important;
        float: none !important;
        margin: 0 0 15px 0 !important;
    }

    /* Locations overview */
    .locationsoverviewwrapper {
        width: 100% !important;
        float: none !important;
        margin-bottom: 25px !important;
        padding-bottom: 25px !important;
        border-bottom: 1px solid #ddd;
        text-align: center;
    }

    .locationsoverviewwrapper:last-child {
        border-bottom: none;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .locationsoverview {
        width: 100% !important;
        margin: 0 auto;
    }

    .locationsoverview td {
        text-align: center !important;
    }

    .locationsoverview td.featuredimg {
        width: 100% !important;
        padding-bottom: 10px;
    }

    .locationsoverview .featuredimgcontainer,
    .locationsoverview .featuredimgwrapper {
        display: flex;
        justify-content: center;
    }

    .locationsoverview img.featuredimg {
        width: 150px !important;
        height: auto;
        border-radius: 6px;
    }

    .locationsoverview h3 {
        text-align: center !important;
        font-size: 1.2em;
        margin-bottom: 5px;
    }

    .locationsoverview address {
        display: block;
        text-align: center;
        margin-bottom: 3px;
    }

    .locationsoverview td.contact {
        text-align: center !important;
        padding-top: 5px;
    }

    /* Header */
    #header {
        height: auto !important;
        min-height: 200px;
        position: relative;
    }

    #header .logo {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        text-align: center;
        padding: 20px 0;
    }

    .logo img {
        max-width: 200px;
        height: auto;
    }

    img.girls {
        display: none;
    }

    /* Navigation */
    #navigation {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        background-size: cover;
        padding: 10px 0;
    }

    /* Hamburger menu */
    #hamburger {
        display: block;
        position: absolute;
        top: 10px;
        right: 15px;
    }

    /* Hide nav by default on mobile */
    #navigation ul.sf-menu.main {
        display: none !important;
        flex-direction: column;
        width: 100%;
        background: #14010a;
        padding: 10px 0;
        border-top: 1px solid #35252c;
    }

    /* Show nav when hamburger is toggled */
    #navigation.nav-open ul.sf-menu.main {
        display: flex !important;
    }

    #navigation ul.sf-menu.main li {
        float: none !important;
        text-align: center;
        border-bottom: 1px solid #35252c;
    }

    #navigation ul.sf-menu.main li a {
        display: block;
        padding: 12px 15px !important;
    }

    /* Hide dropdown submenus in mobile nav */
    #navigation ul.sf-menu.main ul {
        display: none !important;
        position: static !important;
    }

    /* Social icons in header - hide on mobile nav area */
    #navigation ul.social {
        display: none;
    }

    /* Footer */
    .footer-box .first,
    .footer-box .second,
    .footer-box .third {
        width: 100% !important;
        float: none !important;
        text-align: center !important;
    }

    .footer-box .second {
        padding-top: 10px;
    }

    .footer-box ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Social icons */
    ul.social {
        text-align: center !important;
    }

    .footer-box .third .social {
        display: flex;
        justify-content: center;
    }

    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Tables in forms */
    table {
        width: 100% !important;
    }

    table td {
        display: block;
        width: 100% !important;
    }

    table input[type="text"],
    table textarea {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Content box padding */
    .news-box {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .coffe-box {
        padding: 20px 15px 0 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background-color: #f3f1f1 !important;
        background-image: none !important;
    }

    .serving-box {
        padding: 20px 15px 20px 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background-color: #fff !important;
    }

    /* Theme day icons are JPGs with baked-in white backgrounds.
       Round them so the white squares aren't visible against #f3f1f1. */
    .school-box .days td img,
    .serving-box .days td img {
        border-radius: 50%;
    }

    .news-box {
        background-color: #fff !important;
    }

    .staff-box {
        padding-left: 0 !important;
    }

    /* Hide pagination dots on mobile */
    .pagination {
        display: none !important;
    }
}

/* Mobile */
@media screen and (max-width: 480px) {
    #layout {
        padding: 0 10px;
    }

    .logo img {
        max-width: 150px;
    }

    .coffe-box h1,
    .serving-box h2,
    .news-box h1 {
        font-size: 22px !important;
    }

    .coffe-box h2,
    .serving-box h3,
    .news-box h3 {
        font-size: 16px !important;
    }

    .coffe-box .find h2 {
        font-size: 14px !important;
        line-height: 1.2 !important;
    }

    .coffe-box .find p {
        font-size: 12px !important;
    }

    h1 {
        font-size: 1.5em !important;
    }

    #navigation li a {
        font-size: 12px !important;
        line-height: 40px !important;
    }

    /* Footer nav */
    #footer ul.sf-menu,
    .footer-box ul {
        flex-direction: column;
        align-items: center;
    }

    .footer-box li a {
        background: none !important;
        padding: 5px 0 !important;
        display: block;
    }

    /* Form inputs full width */
    .news-box input {
        width: 100% !important;
        box-sizing: border-box;
    }

    .news-box textarea {
        width: 100% !important;
        box-sizing: border-box;
    }
}
