/* BLACK BACKGROUND */
body {
    background: #000 !important;
    color: #fff;
    font-family: Arial, sans-serif;
}

/* =====================================
   TOP BAR
===================================== */

.pc-topbar {
    position:fixed;
    top:40px;
    left:0;
    width:100%;
    display:flex;
    justify-content:center;
    align-items:center;
    gap:25px;
}

.pc-brand {
    text-align:center;
    line-height:1.4;
}

/* CHARLES & KEITH */
.brand-main {
    font-size:24px;
    font-weight:600;
    letter-spacing:2px;
    white-space:nowrap;
}

/* PEDRO */
.brand-sub {
    font-size:24px;
    font-weight:600;
    letter-spacing:2px;
    white-space:nowrap;
}

/* =====================================
   REGION BUTTONS
===================================== */

.pc-region {
    display:flex;
    justify-content:center;
    gap:12px;
    margin-top:10px;
    margin-bottom:20px;
}

.region-btn {
    background:#222;
    border:1px solid #444;
    color:#fff;
    padding:6px 16px;
    border-radius:6px;
    cursor:pointer;
}

.region-btn.active {
    background:#fff;
    color:#000;
}

.region-btn-disabled,
.region-btn:disabled {
    cursor:not-allowed;
    background:#222;
    border-color:#444;
    color:#888;
}

/* =====================================
   TITLE
===================================== */

.pc-title {
    text-align:center;
    font-size:30px;
    font-weight:600;
    letter-spacing:1.5px;
    margin:10px 0 25px 0;
}

/* =====================================
   CARD
===================================== */

.pc-card {
    width:650px;
    margin-bottom:80px;
    background:#111;
    padding:40px;
    border-radius:16px;
}

/* =====================================
   INPUT ROW
===================================== */

.pc-row{
    display:flex;
    gap:10px;
    max-width:560px;
    margin:0 auto 20px auto;
}

/* INPUT FIELDS */

.pc-row input,
.pc-row select{
    flex:1;
    min-width:0;
    padding:10px;
    background:#222;
    border:1px solid #444;
    color:#fff;
    border-radius:6px;
}

/* =====================================
   BUTTON STANDARD SIZE
===================================== */

.pc-btn{
    width:140px;
    padding:14px;
    background:#fff;
    color:#000;
    border:none;
    border-radius:6px;
    cursor:pointer;
    font-weight:500;
}

/* =====================================
   RESULT BOX
===================================== */

.pc-result {
    margin-top:25px;
    padding:20px;
    background:#1a1a1a;
    border-radius:8px;
    min-height:120px;
}

.pc-result:empty {
    display:none;
    min-height:0;
    padding:0;
    margin-top:0;
    background:none;
}

.pc-force-hide {
    display:none !important;
}

/* =====================================
   BUTTON ROW
===================================== */

.pc-clear-row{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:20px;
    margin-top:25px;
}

/* =====================================
   FIX CLICK ISSUE
===================================== */

#price-checker-wrapper {
    position:relative;
    z-index:9999;
    padding-top:40px;
    display:flex;
    flex-direction:column;
    overflow-x:hidden;
    max-width:100vw;
    align-items:center;
}

.pc-card {
    position:relative;
    z-index:9999;
}

.pc-section button {
    position:relative;
    z-index:9999;
}

/* =====================================
   HIDE WORDPRESS LAYOUT
===================================== */

header,
footer,
.site-header,
.site-footer,
#colophon {
    display:none !important;
}

.entry-title,
.page-title,
h1.wp-block-post-title {
    display:none !important;
}


/* Price result grid */

.price-result-grid{
    display:grid;
    grid-template-columns: 1fr 1fr;
    column-gap:40px;
    row-gap:10px;
}

.price-result-grid .full{
    grid-column:1 / span 2;
}

.price-result-grid hr{
    grid-column:1 / span 2;
    border:none;
    border-top:1px solid #555;
    margin:10px 0;
}


/* Hide WordPress admin bar and search icon */

body{
    margin-top:0 !important;
}

/* Hide theme search icon */

.search-toggle,
.site-search,
.header-search,
.search-icon{
    display:none !important;
}


/* ============================= */
/* HEADER / BRAND / TITLE LAYOUT */
/* ============================= */

/* Charles & Keith + Pedro same size */

.pc-brand{
    position:fixed;
    top:40px;
    left:30px;
    display:flex;
    flex-direction:column;
    line-height:1.1;
    z-index:1000;
}

.pc-brand div{
    font-size:16px;
    font-weight:600;
}

/* Logout button top-right */

.pc-logout{
    position:fixed;
    top:40px;
    right:30px;
    z-index:1000;
    padding:4px 10px;
    font-size:14px;
    display:flex;
    align-items:center;
    gap:14px;
}

.pc-user-greeting{
    color:#ccc;
    font-size:13px;
}


/* Region buttons centred */

/* Display panel spacing */

.pc-display{
    margin-top:20px;
}


/* Keep only the user greeting in admin bar */

#wpadminbar .ab-top-menu > li:not(#wp-admin-bar-my-account){
    display:none !important;
}

#wpadminbar .ab-sub-wrapper{
    display:none !important;
}

/* Position greeting */

#wp-admin-bar-my-account{
    position:fixed;
    top:15px;
    right:110px;
    background:none;
}

/* =====================================
   SOURCE SELECTION (native select, grouped by brand)
===================================== */

.pc-search-wrap {
    position:relative;
    display:inline-flex;
    align-items:center;
    gap:10px;
}

.source-select-wrap {
    display:inline-block;
}

.pc-source-select-hint {
    font-size:11px;
    color:#7fc8ff;
    margin-bottom:4px;
    text-align:center;
}

#source-select {
    padding:10px 12px;
    background:#222;
    border:1px solid #444;
    color:#fff;
    border-radius:6px;
    font-size:14px;
    max-width:220px;
}

.pc-source-label {
    color:#7fc8ff;
    font-weight:600;
    margin-bottom:10px;
}

.pc-mismatch {
    color:#ff4d4d;
    font-weight:700;
    font-size:14px;
    margin-top:14px;
    padding-top:12px;
    border-top:1px solid #333;
}

/* =====================================
   MODE TOGGLE (Single check / Batch check)
===================================== */

.pc-mode-toggle {
    display:flex;
    justify-content:center;
    gap:10px;
    margin-bottom:20px;
}

.mode-btn {
    background:#222;
    border:1px solid #444;
    color:#fff;
    padding:6px 16px;
    border-radius:6px;
    cursor:pointer;
    font-size:13px;
}

.mode-btn.active {
    background:#fff;
    color:#000;
}

/* =====================================
   BATCH CHECK
===================================== */

.pc-batch-label {
    font-size:11px;
    color:#888;
    text-transform:uppercase;
    letter-spacing:0.5px;
    margin-bottom:10px;
}

.pc-batch-item-row {
    background:#1a1a1a;
    border-radius:8px;
    padding:10px;
    margin-bottom:10px;
}

.pc-batch-item-label {
    font-size:11px;
    color:#888;
    margin-bottom:6px;
    display:flex;
    justify-content:space-between;
}

.pc-batch-item-remove {
    color:#ff8080;
    cursor:pointer;
}

.pc-batch-item-fields {
    display:flex;
    gap:6px;
    flex-wrap:wrap;
}

.pc-batch-item-fields input,
.pc-batch-item-fields select {
    flex:1;
    min-width:90px;
    padding:8px;
    background:#222;
    border:1px solid #444;
    color:#fff;
    border-radius:6px;
    font-size:12px;
}

.pc-batch-add {
    font-size:13px;
    color:#7fc8ff;
    cursor:pointer;
    margin-bottom:10px;
}

.pc-batch-add-disabled {
    color:#666;
    cursor:not-allowed;
}

.pc-batch-store-pills {
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-bottom:10px;
}

.pc-store-pill {
    background:#222;
    border:1px solid #444;
    border-radius:6px;
    padding:6px 10px;
    font-size:12px;
    display:flex;
    align-items:center;
    gap:8px;
}

.pc-store-pill-remove {
    color:#ff8080;
    cursor:pointer;
    font-weight:700;
}

.pc-batch-store-picker select {
    padding:8px 10px;
    background:#222;
    border:1px solid #444;
    color:#fff;
    border-radius:6px;
    font-size:13px;
    max-width:220px;
}

.pc-batch-price-date {
    font-size:11px;
    color:#888;
    margin-bottom:8px;
}

.pc-batch-table {
    width:100%;
    border-collapse:collapse;
    font-size:12px;
}

.pc-batch-table th {
    padding:8px 6px;
    text-align:center;
    color:#888;
    font-weight:500;
    border-bottom:1px solid #333;
}

.pc-batch-table th:first-child {
    text-align:left;
}

.pc-batch-table .pc-batch-main-col {
    color:#7fc8ff;
}

.pc-batch-table td {
    padding:8px 6px;
    text-align:center;
    border-bottom:1px solid #222;
}

.pc-batch-table td:first-child {
    text-align:left;
}

.pc-batch-variant {
    color:#666;
    font-size:10px;
}

.pc-batch-mismatch {
    background:#3a1a1a;
    color:#ff8080;
    font-weight:600;
}

.pc-batch-error {
    color:#888;
    font-size:11px;
}

/* =====================================
   ASK A QUESTION (CHAT)
===================================== */

.pc-ask-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:16px;
}

.pc-ask-back {
    font-size:13px;
    color:#7fc8ff;
    cursor:pointer;
}

.pc-ask-back-bottom {
    font-size:13px;
    color:#7fc8ff;
    cursor:pointer;
    display:flex;
    align-items:center;
}

.pc-ask-label {
    font-size:11px;
    color:#666;
    text-transform:uppercase;
    letter-spacing:0.5px;
}

.pc-ask-messages {
    display:flex;
    flex-direction:column;
    gap:10px;
    max-height:420px;
    overflow-y:auto;
    padding:4px;
}

.pc-ask-bubble-user {
    align-self:flex-end;
    background:#fff;
    color:#000;
    padding:10px 14px;
    border-radius:14px 14px 2px 14px;
    max-width:75%;
    font-size:13px;
}

.pc-ask-bubble-app {
    align-self:flex-start;
    background:#222;
    color:#eee;
    padding:10px 14px;
    border-radius:14px 14px 14px 2px;
    max-width:75%;
    font-size:13px;
    white-space:pre-line;
}

.pc-ask-typing {
    display:flex;
    align-items:center;
    gap:4px;
    padding:14px 16px;
}

.pc-ask-typing span {
    width:6px;
    height:6px;
    border-radius:50%;
    background:#888;
    display:inline-block;
    animation:pc-ask-typing-bounce 1.2s infinite ease-in-out;
}

.pc-ask-typing span:nth-child(2) {
    animation-delay:0.2s;
}

.pc-ask-typing span:nth-child(3) {
    animation-delay:0.4s;
}

@keyframes pc-ask-typing-bounce {
    0%, 60%, 100% { transform:translateY(0); opacity:0.5; }
    30% { transform:translateY(-4px); opacity:1; }
}

.pc-ask-chip-row {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:10px;
}

.pc-ask-chip {
    background:#333;
    border:1px solid #555;
    color:#fff;
    padding:6px 14px;
    border-radius:20px;
    font-size:12px;
    cursor:pointer;
}

.pc-ask-chip:hover {
    background:#444;
    border-color:#7fc8ff;
}

.pc-ask-chip-group-label {
    font-size:10px;
    color:#888;
    text-transform:uppercase;
    letter-spacing:0.5px;
    margin-top:10px;
    margin-bottom:6px;
}

.pc-ask-chip-current {
    border-color:#7fc8ff;
    background:#1a3a4a;
}

.pc-ask-store-hint {
    font-size:11px;
    color:#666;
    margin-top:10px;
}

.pc-ask-bubble-result {
    align-self:flex-start;
    background:#1a1a1a;
    border:1px solid #333;
    border-radius:14px 14px 14px 2px;
    max-width:90%;
    padding:14px;
    font-size:13px;
}

.pc-ask-result-title {
    color:#7fc8ff;
    font-weight:600;
    margin-bottom:8px;
}

.pc-ask-result-date-inline {
    color:#888;
    font-weight:400;
    font-size:12px;
}

.pc-ask-result-date-mobile {
    display:none;
}

.pc-ask-result-table {
    width:100%;
    border-collapse:collapse;
    font-size:12px;
}

.pc-ask-result-table th {
    padding:4px 6px;
    text-align:center;
    color:#888;
    font-weight:500;
}

.pc-ask-result-table td {
    padding:4px 6px;
    text-align:center;
}

.pc-ask-result-mismatch {
    background:#3a1a1a;
    color:#ff8080;
}

.pc-ask-input-row {
    display:flex;
    gap:8px;
    margin-top:16px;
}

.pc-ask-input-row input {
    flex:1;
    padding:10px 12px;
    background:#222;
    border:1px solid #444;
    color:#fff;
    border-radius:8px;
    font-size:13px;
}

/* =====================================
   MOBILE (phones and narrow screens)
===================================== */

@media (max-width: 600px) {

    /* iOS Safari automatically zooms the whole page in when you tap into
       any input/select with text smaller than 16px — this is very
       likely the real cause of "text gets bigger, horizontal scroll
       appears" after touching a dropdown. Forcing every form element to
       at least 16px on mobile tells iOS the text is already legible
       enough, so it won't auto-zoom at all. */
    #price-checker-wrapper input,
    #price-checker-wrapper select,
    #price-checker-wrapper textarea {
        font-size:16px !important;
    }

    #price-checker-wrapper {
        /* The topbar (brand names + Hi/Logout) is position:fixed and
           sits ABOVE this content. On mobile the two brand names can
           wrap onto more lines than on desktop, needing more clearance
           here — too little and page content scrolls up underneath the
           fixed bar instead of stopping below it. */
        padding-top:120px;
        padding-left:12px;
        padding-right:12px;
    }

    .pc-title {
        font-size:22px;
        text-align:center;
    }

    .brand-main,
    .brand-sub {
        font-size:18px;
        white-space:normal;
    }

    /* Card — no longer a fixed 650px, fits the actual screen width */
    .pc-card {
        width:100%;
        max-width:100%;
        padding:20px;
        margin-bottom:40px;
        box-sizing:border-box;
    }

    /* Region buttons and mode toggle — wrap instead of overflowing */
    .pc-region,
    .pc-mode-toggle {
        flex-wrap:wrap;
        gap:8px;
    }

    .region-btn,
    .mode-btn {
        font-size:13px;
        padding:6px 12px;
    }

    /* Single Check input row — stack instead of squeezing 4 fields
       into one line */
    .pc-row {
        flex-direction:column;
        max-width:100%;
        gap:10px;
    }

    .pc-row input,
    .pc-row select {
        width:100%;
        box-sizing:border-box;
    }

    /* Button rows (Search/Clear/Clear Screen, Run check/Clear, etc.) —
       stack full-width instead of forcing 3 fixed-width buttons onto
       one line */
    .pc-clear-row {
        flex-direction:column;
        gap:10px;
    }

    .pc-btn {
        width:100%;
        box-sizing:border-box;
    }

    .pc-search-wrap {
        width:100%;
        display:flex;
        justify-content:center;
    }

    .source-select-wrap {
        width:100%;
    }

    #source-select {
        width:100%;
        box-sizing:border-box;
        max-width:100%;
    }

    /* Result box — extra containment specifically here, since this is
       the element that only appears AFTER a search runs (matching the
       report that horizontal scroll came back specifically once a
       result was showing) */
    .pc-result {
        max-width:100%;
        box-sizing:border-box;
        word-wrap:break-word;
        overflow-wrap:break-word;
    }

    .pc-result p {
        word-wrap:break-word;
        overflow-wrap:break-word;
    }

    /* Batch check — reduce the minimum field width slightly further
       for very narrow phones (already wraps via flex-wrap) */
    .pc-batch-item-fields input,
    .pc-batch-item-fields select {
        min-width:80px;
    }

    /* Batch results table can genuinely have many columns (Main Server
       + up to 5 stores) — a real data table doesn't compress well into
       a single mobile column, so let it scroll horizontally instead of
       squeezing unreadable columns or overflowing the page */
    .pc-batch-table {
        display:block;
        overflow-x:auto;
        white-space:nowrap;
    }

    /* Ask a Question */
    .pc-ask-bubble-user,
    .pc-ask-bubble-app,
    .pc-ask-bubble-result {
        max-width:90%;
    }

    .pc-ask-input-row {
        flex-direction:column;
        gap:10px;
    }

    .pc-ask-input-row input,
    .pc-ask-input-row button {
        width:100%;
        box-sizing:border-box;
    }

    .pc-ask-result-table {
        display:block;
        overflow-x:auto;
        white-space:nowrap;
    }

    .pc-ask-header {
        flex-wrap:wrap;
        gap:8px;
    }

    /* The title line (article + colour/size + date, all inline) gets
       too crowded on a narrow phone screen and wraps awkwardly mid-date.
       Give the date its own line instead, matching how Multiple Checks
       already shows "Price Date:" separately. Desktop keeps the inline
       version unchanged. */
    .pc-ask-result-date-inline {
        display:none;
    }

    .pc-ask-result-date-mobile {
        display:block;
        color:#888;
        font-size:11px;
        margin-bottom:8px;
    }

}