/* Override styles for the stageshow plugin */

/* THEME OVERRIDE: header action buttons match height (Export Emails + Add Door Sale) */
.cp-postcontent .ssbox-header-actions .ssbox-header-action-btn,
.cp-postcontent .ssbox-header-actions #ssbox-add-door-sale-form-toggle {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    min-height: 38px !important;
    line-height: 1.2 !important;
}

/* ============================================================================
   IPAD FORM STYLES OVERRIDE (EXISTING)
   ============================================================================ */

/* iPad Form Styles Override */
@supports (-webkit-touch-callout: none) {
    /* Form spacing */
    .ssbox-add-form {
        gap: 0 !important;
    }
    
    .ssbox-form-row {
        margin-bottom: 12px !important;
    }

    .ssbox-form-row:last-child {
        margin-bottom: 0 !important;
    }

    .ssbox-total {
        margin: 12px 0 !important;
    }

    /* Button group reset */
    .ssbox-btn-group {
        display: flex !important;
        gap: 5px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .ssbox-seg-btn {
        margin: 0 !important;
        padding: 6px 21px !important;
    }

    /* Input spacing */
    .ssbox-form input,
    .ssbox-form select {
        margin: 0 !important;
    }

    /* Submit button */
    .ssbox-btn-submit {
        margin-top: 12px !important;
    }
}


/* Original button styles - override cp-responsive styles with higher specificity */
.stageshow-boxoffice-add input[type="submit" i],
.stageshow-boxoffice-add .stageshow-trolley-button,
td.stageshow-boxoffice-add input[type="submit" i],
td.stageshow-boxoffice-add .stageshow-trolley-button,
.stageshow-trolley-checkout input,
.stageshow-trolley-remove input 
{
	border: none !important; 
	border-radius: 3px !important;
	background: #741f11 !important;
	color: white !important;
	padding: 6px 10px !important;
	box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3) !important;
	font-size: 16px !important;
	cursor: pointer !important;   
    /*margin: 10px 0 !important;*/
}

.stageshow-boxoffice-add input:hover,
.stageshow-boxoffice-add .stageshow-trolley-button:hover:not(:disabled),
td.stageshow-boxoffice-add input:hover,
td.stageshow-boxoffice-add .stageshow-trolley-button:hover:not(:disabled),
.stageshow-trolley-remove:hover,
.stageshow-trolley-checkout:hover {
	background: #a22b18 !important;
}

td.stageshow-boxoffice-add input[disabled],
td.stageshow-boxoffice-add .stageshow-trolley-button:disabled,
.stageshow-boxoffice-add input[disabled],
.stageshow-boxoffice-add .stageshow-trolley-button:disabled
{
	background-color: light-dark(rgba(239, 239, 239, 0.3), rgba(19, 1, 1, 0.3)) !important;
	color: light-dark(rgba(16, 16, 16, 0.3), rgba(255, 255, 255, 0.3)) !important;
	box-shadow: none !important;
	border: 1px solid silver !important; 
	cursor: not-allowed !important;
	opacity: 0.65 !important;
}

.stageshow-boxoffice-add input[type="number"],
.stageshow-boxoffice-add input[type="text"]{
	width:28px; 
	text-align:center; 
	padding: 6px; 
	border:1px solid gray; 
	border-radius:2px; 
	box-shadow:none; background:white;
	cursor:auto;
}

/* Table header and row styling - handle nested table structure */
.stageshow-boxoffice-header td,
.stageshow-boxoffice-header .responsive-table td,
.stageshow-trolley-titles td,
.stageshow-trolley-totalrow td 
{
	background-color: #e0e0e0 !important;
	padding: 6px 4px !important;
	color: #741f11 !important;
	font-weight: bold !important;
}

/* Ensure nested tables display correctly on desktop with fixed column widths */
.stageshow-boxoffice-table .responsive-table {
	display: table !important;
	width: 100% !important;
	table-layout: fixed !important;
	border-collapse: collapse !important;
}

.stageshow-boxoffice-table .responsive-table tbody {
	display: table-row-group !important;
}

.stageshow-boxoffice-table .responsive-table tr {
	display: table-row !important;
}

.stageshow-boxoffice-table .responsive-table td {
	display: table-cell !important;
}

/* Data row cells in nested tables */
.stageshow-boxoffice-data .responsive-table td {
	padding: 10px 8px !important;
	text-align: center !important;
	vertical-align: middle !important;
}

.stageshow-boxoffice-data .responsive-table td.stageshow-boxoffice-datetime {
	text-align: left !important;
}

/* Column width alignment - desktop only (fixed layout); Date & Time needs room for full perf strings */
@media screen and (min-width: 768px) {
	.stageshow-boxoffice-header .responsive-table td.stageshow-boxoffice-datetime,
	.stageshow-boxoffice-data .responsive-table td.stageshow-boxoffice-datetime {
		width: 32% !important;
		min-width: 11.5em !important;
		white-space: nowrap !important;
		text-align: left !important;
	}

	.stageshow-boxoffice-header .responsive-table td.stageshow-boxoffice-type,
	.stageshow-boxoffice-data .responsive-table td.stageshow-boxoffice-type {
		width: 18% !important;
		text-align: center !important;
	}

	.stageshow-boxoffice-header .responsive-table td.stageshow-boxoffice-price,
	.stageshow-boxoffice-data .responsive-table td.stageshow-boxoffice-price {
		width: 14% !important;
		text-align: center !important;
	}

	.stageshow-boxoffice-header .responsive-table td.stageshow-boxoffice-qty,
	.stageshow-boxoffice-data .responsive-table td.stageshow-boxoffice-qty {
		width: 14% !important;
		text-align: center !important;
	}

	.stageshow-boxoffice-header .responsive-table td.stageshow-boxoffice-add,
	.stageshow-boxoffice-data .responsive-table td.stageshow-boxoffice-add {
		width: 18% !important;
		text-align: center !important;
	}

	.stageshow-boxoffice-data .responsive-table td.stageshow-boxoffice-soldout {
		width: 32% !important;
		text-align: center !important;
	}
}

/* Separator - hide for now */
.stageshow-boxoffice-data .responsive-table tr:has(td.stageshow-boxoffice-separator),
.stageshow-boxoffice-data .responsive-table td.stageshow-boxoffice-separator {
	display: none !important;
}

.stageshow-boxoffice-header td.stageshow-boxoffice-add {
    width: 100% !important;
}

div.stageshow-boxoffice .stageshow-boxoffice-qty input {
	border-radius: 3px;
	width: 60px !important;
	font-size: 16px;
	border-width: 1px;
}
div.stageshow-boxoffice .stageshow-boxoffice-add {
    text-align: left !important;
}

tr.stageshow-boxoffice-row-CHILD\/CONC td.stageshow-boxoffice-data {
	border-bottom: 1px solid #741f11 !important;
}

/* Ensure table rows display correctly */
.stageshow-boxoffice-table > tbody > tr {
	display: table-row !important;
}

.stageshow-boxoffice-table > tbody > tr > td {
	display: table-cell !important;
	padding: 0 !important;
}

/* Row styling for nested structure */
.stageshow-boxoffice-row {
	border: 1px solid #dee2e6 !important;
	border-top: none !important;
}

.stageshow-boxoffice-oddrow {
	background: #fff !important;
}

.stageshow-boxoffice-evenrow {
	background: #f8f9fa !important;
}

.stageshow-trolley-header {
    margin: 30px 0 20px 0;
}

/* ============================================================================
   TROLLEY/CART TABLE - DESKTOP OVERRIDES (Desktop only - min-width: 768px)
   ============================================================================ */

/* Only apply these desktop overrides on larger screens */
@media screen and (min-width: 768px) {
	/* Ensure trolley table displays as table on desktop (not mobile block layout) */
	.stageshow-trolley-table {
		display: table !important;
		width: 100% !important;
		border-collapse: collapse !important;
		table-layout: auto !important;
	}

	.stageshow-trolley-table tbody {
		display: table-row-group !important;
	}

	.stageshow-trolley-table tr {
		display: table-row !important;
	}

	/* Ensure trolley row displays as table row */
	.stageshow-trolley-table tbody tr.stageshow-trolley-row {
		display: table-row !important;
	}

	.stageshow-trolley-table td,
	.stageshow-trolley-table th {
		display: table-cell !important;
	}

	/* Override cp-responsive mobile styles that force block display */
	.stageshow-trolley-table tbody tr:not(.stageshow-trolley-row) td {
		display: table-cell !important;
		width: auto !important;
		border: inherit !important;
		background: inherit !important;
		padding: 20px 8px !important;
		margin: 0 !important;
		font-size: inherit !important;
	}

	/* Ensure trolley row cells display as table cells (not blocks) */
	.stageshow-trolley-table tbody tr.stageshow-trolley-row td {
		display: table-cell !important;
		width: auto !important;
		border: none !important;
		background: #fff !important;
	}

	/* Trolley row styling */
	.stageshow-trolley-titles td {
		background-color: #e0e0e0 !important;
		padding: 12px 8px !important;
		color: #741f11 !important;
		font-weight: bold !important;
		text-align: center !important;
		display: table-cell !important;
		vertical-align: middle !important;
	}

	.stageshow-trolley-titles td.stageshow-trolley-show {
		text-align: left !important;
	}

	.stageshow-trolley-row td {
		display: table-cell !important;
		padding: 15px 8px !important;
		text-align: center !important;
		vertical-align: middle !important;
		width: auto !important;
		border: inherit !important;
		background: inherit !important;
		min-height: 40px !important;
	}

	.stageshow-trolley-row td.stageshow-trolley-show,
	.stageshow-trolley-row td.stageshow-trolley-datetime {
		text-align: left !important;
	}

	/* Total row - ensure it displays as table row with table cells */
	.stageshow-trolley-table tbody tr.stageshow-trolley-totalrow {
		display: table-row !important;
	}

	.stageshow-trolley-totalrow td {
		display: table-cell !important;
		padding: 15px 8px !important;
		text-align: center !important;
		font-weight: bold !important;
		width: auto !important;
		border: inherit !important;
		background: inherit !important;
		vertical-align: middle !important;
	}

	/* Align total value with price column - center aligned to match prices */
	.stageshow-trolley-totalrow td:nth-child(5),
	.stageshow-trolley-totalrow td.stageshow-trolley-total {
		text-align: center !important;
	}

	.stageshow-trolley-total {
		font-weight: bold !important;
		color: #741f11 !important;
		font-size: 18px !important;
	}

	/* Override cp-responsive mobile styles for total cell */
	.stageshow-trolley-table tbody tr td.stageshow-trolley-total {
		font-size: 18px !important;
		color: #741f11 !important;
		text-align: center !important;
		width: 100% !important;
	}

	/* Checkout button row */
	.stageshow-trolley-table tbody tr.stageshow-trolley-buttons {
		display: table-row !important;
	}

	.stageshow-trolley-buttons td {
		display: table-cell !important;
		text-align: center !important;
		padding: 20px 0 !important;
		width: 100% !important;
	}

	.stageshow-trolley-checkout {
		text-align: center !important;
		display: block !important;
		width: 100% !important;
	}

	.stageshow-trolley-checkout input {
		display: inline-block !important;
		margin: 0 auto !important;
		width: 150px !important;
	}
}