.pts-search-container {
    width: 80%;
    max-width: none;
    margin: 0 auto;
    padding-top: 5px;
    padding-bottom: 5px;
}

.pts-search-form {
    width: 100%;
    margin: 0;
}

.pts-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 999px;
    overflow: hidden;
}

.pts-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    z-index: 2;
}

.pts-search-input {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 9px 12px 9px 50px;
    border-radius: 999px !important;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    font-size: 14px;
    line-height: 1.3;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}

.header .nav li.pt-header-search-item input.pts-search-input {
    border-radius: 999px !important;
    padding-left: 50px !important;
}

.pts-search-input:focus {
    border-color: #60a5fa;
    background: #fff;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

.pts-search-input::placeholder {
    color: #6b7280;
}

li.pt-header-search-item {
    display: flex;
    align-items: center;
    min-width: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.header .nav li.pt-header-search-item {
    flex: 1 1 auto;
}

li.pt-header-search-item .pts-search-container {
    display: block;
    width: 80%;
    margin: 0 auto;
    max-width: none;
}

li.pt-header-qr-item {
    display: flex;
    align-items: center;
}

.header-main .mobile-nav li.pt-header-search-item,
.header-main .mobile-nav li.pt-header-qr-item,
.header-top .mobile-nav li.pt-header-search-item,
.header-top .mobile-nav li.pt-header-qr-item,
.header-main .header-nav li.pt-header-search-item,
.header-main .header-nav li.pt-header-qr-item,
.header-top .nav li.pt-header-search-item,
.header-top .nav li.pt-header-qr-item {
    display: flex !important;
    align-items: center;
}

.header .nav li.pt-header-search-item .pts-search-form,
.header .nav li.pt-header-search-item .pts-search-input-wrapper,
.header .nav li.pt-header-search-item .pts-search-input {
    width: 100%;
    max-width: none;
}

/* Header logo visibility states from Theme Settings > Header > Logo & Site Identity. */
body.pt-logo-hide-all #masthead .logo {
    display: none !important;
}

@media (min-width: 850px) {
    body.pt-logo-hide-desktop #masthead .logo {
        display: none !important;
    }
}

@media (max-width: 849px) {
    body.pt-logo-hide-mobile #masthead .logo {
        display: none !important;
    }
}

/* Prevent native Flatsome search icon from duplicating PT Search UI. */
body.ptfc-has-pt-search li.header-search {
    display: none !important;
}

/* Keep one desktop search instance when both topbar and main slots contain PT Search. */
body.ptfc-search-main-desktop.ptfc-search-top-desktop #top-bar .pt-header-search-item,
body.ptfc-qr-main-desktop #top-bar .pt-header-qr-item {
    display: none !important;
}

@media (max-width: 849px) {
    /* On mobile, prioritize topbar PT Search (full field) over cramped main left/right slot. */
    body.ptfc-search-main-mobile.ptfc-search-top-mobile .header-main .mobile-nav .pt-header-search-item {
        display: none !important;
    }

    body.ptfc-qr-main-mobile #top-bar .mobile-nav .pt-header-qr-item,
    body.ptfc-qr-main-mobile .header-top .mobile-nav .pt-header-qr-item {
        display: none !important;
    }

    #top-bar .mobile-nav li.pt-header-search-item,
    #top-bar .mobile-nav li.pt-header-search-item .pts-search-container {
        width: 80%;
        max-width: 100%;
        flex: 1 1 100%;
    }

    .pts-search-input {
        min-width: 0;
        width: 100%;
    }
}

/* Ensure topbar center can let PT Search use available row width. */
body.ptfc-search-top-desktop #top-bar .flex-col.flex-center {
    flex: 1 1 auto;
}

body.ptfc-search-top-desktop #top-bar .flex-col.flex-center .nav.nav-center {
    width: 100%;
}

.pts-scan-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: 0;
    color: #fecd1a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pts-scan-btn:focus {
    outline: 2px solid rgba(0, 113, 227, 0.35);
    outline-offset: 2px;
}

.pts-scan-btn:active {
    opacity: 0.6;
}

.pt-search-mobile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.pts-qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.pts-qr-modal.open {
    display: flex;
}

.pts-qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.pts-qr-content {
    position: relative;
    z-index: 3001;
    background: #fff;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    overflow: hidden;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.pts-qr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pts-qr-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.pts-qr-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    line-height: 1;
}

#pts-reader {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    min-height: 260px;
}

.pts-qr-instruction {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-top: 15px;
    margin-bottom: 0;
}
