/*
    mobile.css
    ----------
    Everything that is NOT inside a media query here is either:
      - the Google Translate widget (#langSwitch) which is shown on all sizes, or
      - the mobile image gallery (.agMG) which is only ever opened on narrow screens by js/mobile.js.

    The @media (max-width: 767px) block adapts the fixed 960px layout to phones.
    Desktop (>= 768px) is intentionally left untouched.
*/

/* ---------- Google Translate widget ---------- */
#langSwitch {
    float: right;
    clear: right;
    margin: 2px 10px 0 0;
    min-height: 24px;
}

/* Hide Google's blue top banner and keep the body from being pushed down by it */
.goog-te-banner-frame.skiptranslate,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
#goog-gt-tt,
.goog-te-balloon-frame {
    display: none !important;
}

body {
    top: 0 !important;
}

.goog-te-gadget,
.goog-te-gadget-simple {
    font-family: Arial, Tahoma, Verdana !important;
    font-size: 12px !important;
}

/* ---------- Mobile fullscreen swipe gallery (opened by js/mobile.js) ---------- */
.agMG {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 100000;
    display: none;
    -webkit-tap-highlight-color: transparent;
}

@supports (height: 100dvh) {
    .agMG {
        height: 100dvh;
    }
}

.agMG.agMG-open {
    display: block;
}

body.agMG-open {
    overflow: hidden;
}

.agMG-track {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x pinch-zoom;
}

.agMG-track::-webkit-scrollbar {
    display: none;
}

.agMG-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agMG-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

.agMG-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 0 14px;
    color: #fff;
    font: 14px Arial, Tahoma, Verdana, sans-serif;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
    z-index: 2;
    pointer-events: none;
}

.agMG-top > * {
    pointer-events: auto;
}

.agMG-close {
    width: 48px;
    height: 48px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 34px;
    line-height: 48px;
    padding: 0;
    cursor: pointer;
}

.agMG-prev,
.agMG-next {
    position: absolute;
    top: 50%;
    margin-top: -26px;
    width: 44px;
    height: 52px;
    border: 0;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 34px;
    line-height: 52px;
    padding: 0;
    z-index: 2;
    cursor: pointer;
}

.agMG-prev {
    left: 4px;
}

.agMG-next {
    right: 4px;
}

.agMG-prev[disabled],
.agMG-next[disabled] {
    opacity: 0.25;
}

/* ---------- Phone layout ---------- */
@media (max-width: 767px) {

    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        font-size: 81.25%; /* 13px instead of 11px base */
        background-position: center 90px;
    }

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

    /* Header */
    #header {
        height: auto;
        overflow: hidden;
        padding-bottom: 6px;
    }

    #headerContent {
        width: auto;
        padding: 5px 10px;
    }

    #logotype {
        float: none;
        padding: 0;
        text-align: center;
    }

    #logotype img {
        width: 110px;
        height: auto;
    }

    #HeaderCreateAccount {
        float: none;
        width: auto;
        margin: 2px 0 0;
        text-align: center;
    }

    #HeaderCreateAccount p {
        float: none;
        width: auto !important;
        text-align: center !important;
        padding: 0;
    }

    #loggedInHeaderLinks {
        float: none;
        margin: 0;
        text-align: center;
    }

    #loggedInHeaderLinks a {
        display: inline-block;
        padding: 6px 8px;
    }

    #loggedInHeaderLinks br {
        display: none;
    }

    #langSwitch {
        float: none;
        clear: both;
        text-align: center;
        margin: 4px 0 0;
    }

    /* Menu */
    #menubar {
        height: auto;
    }

    #menu {
        width: auto;
    }

    #menu ul {
        padding: 4px 4px;
        text-align: center;
    }

    #menu ul li {
        float: none;
        display: inline-block;
        font-size: 14px;
        line-height: 30px;
    }

    #menu ul li a {
        display: inline-block;
        padding: 0 6px;
    }

    /* Content container */
    #mainContent {
        width: auto;
        padding: 0 10px;
    }

    .contentPage {
        width: auto;
        padding-left: 0;
    }

    #PrintAndSocial {
        float: none;
        margin: 10px 0 0;
    }

    #topInfo {
        padding: 10px;
    }

    h1 {
        font-size: 1.6em;
    }

    #spacer {
        margin-top: 15px;
    }

    /* Auction date lists (Pågående / Avslutade / Alla auktioner) */
    #LinkList {
        margin-left: 0;
        padding-bottom: 20px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    #LinkList li {
        margin-left: 0;
        padding: 8px 6px;
    }

    /* Start page slideshow: shown as a single static image, plugin is skipped on phones */
    #pagerImage {
        width: auto;
        height: auto;
        margin: 10px 0;
    }

    #slides,
    .slides_container,
    .slides_container > div {
        width: 100% !important;
        height: auto !important;
    }

    .slides_container > div {
        display: none;
    }

    .slides_container > div:first-child {
        display: block;
    }

    .slides_container img {
        width: 100%;
        height: auto;
    }

    .pagination {
        display: none;
    }

    .col {
        margin: 15px 0;
        width: auto;
    }

    /* Auction list for one day (Auktioner.aspx) */
    #categoriesContainer {
        float: none;
        width: auto;
        margin-top: 10px;
        text-align: left;
    }

    #categories button {
        width: auto;
        margin: 0 6px 6px 0;
    }

    #pageSizeContainer {
        margin-top: 10px;
    }

    #auctions,
    #myAuctions {
        width: auto;
        overflow-x: auto;
    }

    #auctionsTable,
    #myAuctionsTable {
        width: 100%;
    }

    .auctionHeader {
        width: auto;
    }

    .auctionCity,
    #auctionsTable td:nth-child(5) {
        display: none;
    }

    .aiTd {
        width: 70px;
        height: auto;
    }

    .aiTd img {
        max-width: 60px;
        max-height: 60px;
    }

    #updateNotice {
        float: none;
        margin: 6px 0;
    }

    .aucpagination ul li {
        margin: 6px;
    }

    .divIcon {
        margin-top: 10px;
    }

    /* Object page (Objekt.aspx) */
    #objectDescAndStatus {
        float: none;
        width: auto;
    }

    #objectDescDetails,
    #objectStatus,
    #objectDescDiv {
        float: none;
        width: auto;
        padding-right: 0;
        margin-top: 15px;
    }

    #objectStatus label {
        width: auto;
    }

    #objectStatusActions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }

    #objectStatusActions br {
        display: none;
    }

    #bidAmount {
        width: 90px;
    }

    #MakeBid,
    #MakeAutoBid {
        margin: 0;
        width: auto;
    }

    #AutoBidHelpLink,
    #currentAutoBid {
        display: block;
        width: 100%;
        margin-left: 0;
    }

    .auctionImages {
        float: none;
        width: auto;
        margin-top: 20px;
    }

    #showNext,
    #showPrevious {
        display: block;
        width: auto;
        margin: 0 0 8px;
    }

    .bidsList {
        width: 100%;
    }

    .objectImagesAndLabel {
        width: auto;
        padding-left: 0;
    }

    .auctionImages ul {
        display: flex;
        flex-wrap: wrap;
    }

    .auctionImages ul li {
        display: block;
        width: 33.333%;
    }

    .auctionImages ul li a {
        float: none;
        display: block;
        width: auto;
        padding: 4px;
    }

    .auctionImages ul li a img {
        width: 100%;
        height: auto;
    }

    /* Hover-preview popups make no sense on touch and land in odd places */
    #biggerImgPop,
    #bigImgPop {
        display: none !important;
    }

    #pdf {
        width: auto;
    }

    /* My page */
    #kundInfo1 {
        width: 100% !important;
    }

    .myab {
        width: auto;
    }

    /* Forms: 16px inputs stop iOS from zooming in on focus */
    input.text,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
    }

    /* jQuery UI dialogs (login, register, bid confirmation, ...) */
    .ui-dialog {
        max-width: calc(100% - 16px);
        box-sizing: border-box;
    }

    .ui-dialog .ui-dialog-content {
        max-height: calc(100vh - 190px) !important;
        box-sizing: border-box;
    }

    .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
        float: none;
    }

    .ui-dialog .ui-dialog-buttonpane button {
        display: block;
        width: 100%;
        margin: 6px 0;
        white-space: normal;
    }

    .ui-dialog .ui-dialog-buttonpane button .ui-button-text {
        white-space: normal;
    }

    .loginFormDiv,
    .forgotPasswordFormDiv,
    .tipsaFormDiv,
    .bytLosenFormDiv {
        width: auto;
    }

    #LoggaIn label,
    #GlomtLosenord label,
    #TipsaEnVan label,
    #BytLosen label {
        float: none;
        width: auto;
        text-align: left;
        padding: 3px 0;
    }

    #LoggaIn .text,
    #GlomtLosenord .text,
    #TipsaEnVan .text,
    #BytLosen .text {
        width: 100%;
        box-sizing: border-box;
        padding: 6px;
    }

    #RegisterForm {
        min-height: 0 !important;
    }

    #RegisterForm input.text {
        width: 100%;
        box-sizing: border-box;
        padding: 6px;
    }

    .salesTerms {
        font-size: 1em;
    }
}
