
/* Allow StageShow datetime headers to exceed 100% width for proper spanning */
.stageshow-boxoffice-datetime {
    max-width: none !important;
    font-size: large !important; /* Ensure datetime headers are large enough to read */
}


/* StageShow Plugin Mobile Responsiveness */
/* Hide the main table header row */
.stageshow-boxoffice-header {
    display: none !important;
}

/* Override desktop StageShow border styling for mobile */
tr.stageshow-boxoffice-evenrow td.stageshow-boxoffice-data td {
    border-bottom: none !important;
}


/* Override any general table border styling for StageShow mobile */
.stageshow-boxoffice-table tbody tr td,
.stageshow-boxoffice-table tbody tr th,
.stageshow-boxoffice-data tbody tr td,
.stageshow-boxoffice-data tbody tr th,
.stageshow-trolley-table tbody tr td,
.stageshow-trolley-table tbody tr th {
    border-bottom: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

/* Comprehensive StageShow mobile border override */
.tablepress.stageshow-boxoffice-table tbody tr td,
.tablepress.stageshow-boxoffice-table tbody tr th,
.tablepress tbody.row-striping tr td,
.tablepress tbody.row-hover tr td,
.tablepress tbody tr.stageshow-boxoffice-evenrow td,
.tablepress tbody tr.stageshow-boxoffice-oddrow td,
.stageshow-boxoffice-data .tablepress tbody tr td,
.stageshow-boxoffice-data .tablepress tbody tr th,
.tablepress.stageshow-trolley-table tbody tr td,
.tablepress.stageshow-trolley-table tbody tr th,
.tablepress tbody tr.stageshow-trolley-row td,
.stageshow-trolley-table .tablepress tbody tr td,
.stageshow-trolley-table .tablepress tbody tr th {
    border: none !important;
    border-bottom: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

/* Super-specific mobile override for inline StageShow plugin styles */
body tr.stageshow-boxoffice-evenrow td.stageshow-boxoffice-data td,
html body tr.stageshow-boxoffice-evenrow td.stageshow-boxoffice-data td,
.cp-sheet tr.stageshow-boxoffice-evenrow td.stageshow-boxoffice-data td,
.cp-postcontent tr.stageshow-boxoffice-evenrow td.stageshow-boxoffice-data td,
tr.stageshow-boxoffice-evenrow td.stageshow-boxoffice-data td.stageshow-boxoffice-type,
tr.stageshow-boxoffice-evenrow td.stageshow-boxoffice-data td.stageshow-boxoffice-price,
tr.stageshow-boxoffice-evenrow td.stageshow-boxoffice-data td.stageshow-boxoffice-qty,
tr.stageshow-boxoffice-evenrow td.stageshow-boxoffice-data td.stageshow-boxoffice-add,
body tr.stageshow-trolley-row td,
html body tr.stageshow-trolley-row td,
.cp-sheet tr.stageshow-trolley-row td,
.cp-postcontent tr.stageshow-trolley-row td,
tr.stageshow-trolley-row td.stageshow-trolley-show,
tr.stageshow-trolley-row td.stageshow-trolley-datetime,
tr.stageshow-trolley-row td.stageshow-trolley-type,
tr.stageshow-trolley-row td.stageshow-trolley-seat,
tr.stageshow-trolley-row td.stageshow-trolley-price,
tr.stageshow-trolley-row td.stageshow-trolley-remove {
    border: none !important;
    border-bottom: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

/* Main StageShow table styling */
.stageshow-boxoffice-table {
    width: 100% !important;
    display: block !important;
    border: none !important;
    overflow-x: hidden !important;
    max-width: 100% !important;
}

.stageshow-boxoffice-table tbody {
    display: block !important;
    width: 100% !important;
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* Hide separator rows completely - ONLY target the separator cells, never the parent rows */
.stageshow-boxoffice-separator {
    display: none !important;
}

td.stageshow-boxoffice-separator {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
}

/* More specific selectors for the separator cell - NO :has() selectors */
.stageshow-boxoffice-data table tbody tr td.stageshow-boxoffice-separator,
table tbody tr td.stageshow-boxoffice-separator,
tbody tr td.stageshow-boxoffice-separator {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
}

/* Try to force the parent tr to collapse when it contains a separator */
.stageshow-boxoffice-data table tbody tr {
    position: relative !important;
}

.stageshow-boxoffice-data table tbody tr:empty,
.stageshow-boxoffice-data table tbody tr[style*="display: none"] {
    display: none !important;
    height: 0 !important;
    visibility: hidden !important;
}

/* Style each performance group */
.stageshow-boxoffice-row {
    display: block !important;
    width: 100% !important;
    position: relative !important;
}

/* Container for ticket data */
.stageshow-boxoffice-data {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    max-width: 100% !important;
}

.stageshow-boxoffice-data tr {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 12px !important;
    margin-bottom: 2px !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
    position: relative !important;
    box-sizing: border-box !important;
    gap: 0 !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

/* Ensure datetime cells ALWAYS take full width and create a line break */
.stageshow-boxoffice-data tr .stageshow-boxoffice-datetime {
    flex: 1 1 100% !important;
    width: 100% !important;
    order: 0 !important;
    margin: -10px -12px 8px -12px !important;
    background: var(--cp-background-red) !important;
    color: #fff !important;
    font-weight: bold !important;
    text-align: center !important;
    padding: 12px !important;
    border-radius: 6px 6px 0 0 !important;
    display: block !important;
    white-space: normal !important;
}

/* Force line breaks after datetime cells using pseudo-elements */
.stageshow-boxoffice-data td.stageshow-boxoffice-datetime::after {
    content: '' !important;
    display: block !important;
    width: 100% !important;
    height: 0 !important;
    flex-basis: 100% !important;
    order: 0 !important;
}

/* Grid area assignments */

.stageshow-boxoffice-datetime {
    grid-area: datetime !important;
    width: 100% !important;
    margin: -10px -12px 8px -12px !important;
    justify-self: stretch !important;
    background: var(--cp-background-red) !important;
    color: #fff !important;
    font-weight: bold !important;
    text-align: center !important;
    padding: 12px !important;
    border-radius: 6px 6px 0 0 !important;
    order: 0 !important;
    flex-basis: 100% !important;
    display: block !important;
    white-space: normal !important;
    grid-column: 1 / -1 !important;
    align-self: stretch !important;
}

.stageshow-boxoffice-data td.stageshow-boxoffice-datetime {
    order: 0 !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    margin-bottom: 8px !important;
    background: var(--cp-mobile-red) !important;
    color: #fff !important;
    font-weight: bold !important;
    font-size: var(--cp-h3-mobile) !important;
    text-align: center !important;
    padding: var(--cp-padding-medium) !important;
    border-radius: 6px 6px 0 0 !important;
    display: block !important;
    white-space: normal !important;
    align-self: stretch !important;
    /* Force datetime to be alone on its line */
    flex-basis: 100% !important;
    min-width: 100% !important;
}

.stageshow-boxoffice-type {
    grid-area: type !important;
    justify-self: start !important;
    font-weight: bold !important;
    color: #333 !important;
    font-size: 13px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    line-height: 1.2 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    width: 100% !important;
}

.stageshow-boxoffice-data td.stageshow-boxoffice-type {
    order: 2 !important;
    flex: 0 0 38% !important;
    width: 38% !important;
    min-width: 38% !important;
    max-width: 38% !important;
    font-weight: bold !important;
    color: #333 !important;
    font-size: var(--cp-font-size-content-mobile) !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    line-height: var(--cp-line-height-mobile) !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    display: inline-block !important;
    width: auto !important;
    text-align: left !important;
}

.stageshow-boxoffice-data td.stageshow-boxoffice-price {
    order: 3 !important;
    flex: 0 0 27% !important;
    width: 27% !important;
    min-width: 27% !important;
    max-width: 27% !important;
    font-weight: bold !important;
    color: var(--cp-background-red) !important;
    font-size: var(--cp-font-size-content-mobile) !important;
    text-align: right !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    width: auto !important;
}

.stageshow-boxoffice-qty {
    grid-area: qty !important;
    justify-self: end !important;
    text-align: right !important;
    padding: 3px !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
}

.stageshow-boxoffice-data td.stageshow-boxoffice-qty {
    order: 4 !important;
    flex: 0 0 35% !important;
    width: 35% !important;
    min-width: 35% !important;
    max-width: 35% !important;
    text-align: right !important;
    padding: 3px !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    display: inline-block !important;
    width: 80px !important;
}

.stageshow-boxoffice-add {
    grid-area: add !important;
    max-width: none !important;
    margin: 0 !important; /*6px -12px -10px -12px !important;*/
    justify-self: stretch !important;
    text-align: right !important;
    padding: 15px 0 5px 0 !important;
    border-radius: 0 0 6px 6px !important;
    border: none !important;
}

.stageshow-boxoffice-data td.stageshow-boxoffice-add {
    order: 5 !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    margin-top: 6px !important;
    margin-right: var(--cp-margin-medium) !important;
    text-align: right !important;
    padding: 15px 5px 5px 0 !important;
    border-radius: 0 0 6px 6px !important;
    border: none !important;
    display: block !important;
    flex-basis: 100% !important;
    min-width: 100% !important;
}

/* Button styling moved to main stageshow-boxoffice.css for consistency */

tr.stageshow-boxoffice-evenrow td.stageshow-boxoffice-data td.stageshow-boxoffice-add {
    text-align: right !important;
}

/* Hide datetime cells that contain only &nbsp; (non-breaking space) */
.stageshow-boxoffice-datetime:empty {
    display: none !important;
}

/* Hide datetime cells that contain only whitespace or &nbsp; */
.stageshow-boxoffice-datetime:not(:has(*)):not([data-has-content]) {
    display: none !important;
}

/* Hide CHILD/CONC datetime cells to group tickets under ADULT date */
.stageshow-boxoffice-row-CHILD\/CONC .stageshow-boxoffice-datetime {
    display: none !important;
}

.stageshow-boxoffice-price:before {
    content: "£" !important;
}

/* Hide empty Add button cells (containing only &nbsp;) */
.stageshow-boxoffice-add:empty {
    display: none !important;
}

/* ADULT rows: reserve the same Add row space as CHILD (StageShow only renders Add on last type) */
.stageshow-boxoffice-row-ADULT .stageshow-boxoffice-add {
    display: block !important;
    flex: 1 1 100% !important;
    flex-basis: 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    order: 5 !important;
}

.stageshow-boxoffice-row-ADULT .stageshow-boxoffice-add:empty {
    display: block !important;
    min-height: 2.75rem;
}

/* Ensure CHILD/CONC rows appear directly after ADULT rows */
.stageshow-boxoffice-row-CHILD\/CONC .stageshow-boxoffice-data tr {
    margin-top: 0 !important;
    border-radius: 0 0 6px 6px !important;
    border-top: none !important;
}

/* Adjust ADULT row styling to connect with CHILD/CONC rows */
.stageshow-boxoffice-row-ADULT + .stageshow-boxoffice-row-CHILD\/CONC .stageshow-boxoffice-data tr {
    border-radius: 0 0 6px 6px !important;
    margin-top: -2px !important;
}

.stageshow-boxoffice-row-ADULT .stageshow-boxoffice-data tr {
    border-radius: 6px 6px 0 0 !important;
    margin-bottom: 0 !important;
}

/* Add spacing between performance groups */
.stageshow-boxoffice-row-ADULT:not(:first-child) {
    margin-top: 20px !important;
}

/* Override stageshow-boxoffice-add padding */
.stageshow-boxoffice-add {
    padding: 0 !important;
}