/* ============================
   Seatplan stylesheet (modernized, conservative)
   - Keep class names & behaviors
   - Use CSS vars to avoid repeating sizes across breakpoints
   - Make containers fluid; remove hard-coded widths per breakpoint
   ============================ */


/* Legend + price cubes */
.legend ul { padding-left: 0; }

/* NOTE: This hits ALL .plan_* classes instead of trying "span.plan_" (which doesn’t wildcard) */
span.cube {
  display: inline-block;
  height: 18px;
  width: 18px;
  min-width: 18px;     /* ?? prevents shrinking */
  min-height: 18px;    /* ?? keeps height */
  margin-bottom: 3px;
  border-radius: 0;
  flex-shrink: 0;      /* ?? critical fix */
}
span[class^="plan_"] { background: none; border: 1px solid grey; }  /* NEW base for plan_* */
span.plan_red      { background-color: #fa9c9f; }
span.plan_blue     { background-color: #c0ffff; }
span.plan_green    { background-color: #80ff80; }
span.plan_fuchsia  { background-color: #ffc0ff; }
span.plan_yellow   { background-color: #ffffc0; }
span.plan_salmon   { background-color: #FA8072; }
span.plan_skyblue  { background-color: #87CEEB; }
span.plan_teal     { background-color: #04aca9; }
span.plan_thistle  { background-color: #D8BFD8; }
span.plan_palegreen{ background-color: #98FB98; }
span.plan_orange   { background-color: #FFA500; }
span.plan_incart   { background-color: #FF00FF; border-color: #808080; }
span.plan_reserved { background-color: #808080; border-color: #808080; }
span.plan_locked   { background-color: #8080C0; border-color: #808080; }
span.plan_own      { background-color: #FFFFFF; border-color: #808080; }

/* Old Opera outline fixes kept as-is (harmless) */
body.opera ul.r li,
body.opera ul.r li.ltr { outline: 0; }

/* Seat color classes (unchanged except minor cleanups) */
ul.r li.bl, ul#ajax_cart li.bl { background-color: #C0FFFF; }
ul.r li.rd, ul#ajax_cart li.rd { background-color: #FFC0C0; }
ul.r li.gr                      { background: #80FF80 url('../../images/wheelchair.svg') no-repeat center top; }
ul.r li.or, ul#ajax_cart li.or { background-color: #FFA500; }
ul.r li.fu, ul#ajax_cart li.fu { background-color: #FFC0FF; }
ul.r li.ye, ul#ajax_cart li.ye { background-color: #FFFFC0; }
ul.r li.sa, ul#ajax_cart li.sa { background-color: #FA8072; }
ul.r li.sb, ul#ajax_cart li.sb { background-color: #87CEEB; }
ul.r li.te, ul#ajax_cart li.te { background-color: #008080; }
ul.r li.th, ul#ajax_cart li.th { background-color: #D8BFD8; }
ul.r li.pg, ul#ajax_cart li.pg { background-color: #98FB98; }

ul.r li.o { color: #000; background-color: #FFF; cursor: default; }
ul.r li.x { color: #FFF; background-color: #808080; cursor: default; }
ul.r li.y { color: #FFF; background-color: #FF00FF; cursor: pointer; }
ul.r li.z { color: #FFF; background-color: #8080C0; cursor: default; }
ul.r li.s:hover { background-color: #000; color: #FFF; }


/* Buttons (kept) 
.btn-ga {
  background: blue;
  border: 2px solid #2F312F;
  color: #2F312F !important;
  padding: 5px;
}
.btn-ga:hover {
  background: none !important;
  color: #2F312F !important;
  border: 2px solid #2F312F;
}
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
  color: #fff;
  background-color: #555;
}*/


.btn-ga{
	border:4px solid #fff;
	/* text-shadow: 0px 0px #000; */
	white-space: nowrap;
	padding:0 5px;
	border-radius:15px 15px;
	color:white;
}
.btn-ga:hover {
	background: none;
	color: #000;
}
.color_red {
	max-width: 120px;
	background-color: red;
	padding: 3px 10px;
	border: 5px solid white;
	border-radius:15px;
	color: white;
}
.color_orange {
	max-width: 120px;
	background-color: #FFA500;
	padding: 3px 10px;
	border: 5px solid white;
	border-radius:15px;
	color: white;
}
.color_skyblue {
	max-width: 120px;
	background-color: #87CEEB;
	padding: 3px 10px;
	border: 5px solid white;
	border-radius:15px;
	color: white;
}
.color_palegreen {
	max-width: 120px;
	background-color: #98FB98;
	padding: 3px 10px;
	border: 5px solid white;
	border-radius:15px;
	color: white;
}
.color_salmon {
	max-width: 120px;
	background-color: #FA8072;
	padding: 3px 10px;
	border: 5px solid white;
	border-radius:15px;
	color: white;
}
.color_blue {
	max-width: 120px;
	background-color: #c0ffff;
	padding: 3px 10px;
	border: 5px solid white;
	border-radius:15px;
	color: white;
}

:root {
  /* Container sizing */
  --stage-max-w: 1100px;
  --stage-max-h: 170px;         /* NEW: min-height avoids text clipping vs max-height */

  --seatplan-min-h: 500px;      /* Keep adjustable via inline CSS if needed */

  /* Seat sizing (desktop defaults) — we’ll only change these per breakpoint */
  --seat-w: 38px;
  --seat-h: 28px;
  --seat-fs: 16px;
  --seat-br: 0;       /* rounded top corners */
  --seat-q-fs: 40px;
  --seat-q-br: 15px;            /* “q” special */
}

/* ============================
   Stage label
   ============================ */

/* Centered text, fluid width, vertical centering via flex */
/* ---- Stage label: keep your styles, add exact ratio ---- */
#stage_label {
  box-sizing: border-box;
  width: min(100%, var(--stage-max-w));
  /* This line makes the height follow the width using the image’s ratio */
  aspect-ratio: 1100 / 170; /* 17 / 110 also works */

  /* Remove max-height; it prevents responsive scaling */
  /* max-height: var(--stage-max-h);  <-- delete this */

  margin-inline: auto;
  margin-block: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  font-weight: 700;
  line-height: 1.15;
  color: #808080;

  /* Your background set from PHP */
  background-repeat: no-repeat;
  background-position: center bottom;

  /* With aspect-ratio, container matches image ratio; either is fine: */
  background-size: 100% 100%; /* or keep 'contain' */

  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;

  outline: 0px solid red; /* debug */
}

/* Your font-size steps can stay exactly as-is */
#stage_label { font-size: 1.25rem; }
@media (min-width: 576px) { #stage_label { font-size: 1.5rem; } }
@media (min-width: 768px) { #stage_label { font-size: 2rem; } }
@media (min-width: 992px) { #stage_label { font-size: 2.5rem; } }
@media (min-width: 1200px){ #stage_label { font-size: 2.875rem; } }


/* ============================
   Seatplan container
   ============================ */



div.seatplan {
	position: relative !important;
	box-sizing: border-box;
	width: min(100%, var(--stage-max-w));  /* NEW: fluid container */
	/*min-height: var(--seatplan-min-h);      You can comment this out if you prefer PHP to control it */
	margin: auto;
	min-height: 0 !important;
	height: auto !important;                  /* ← kills any fixed height */
	aspect-ratio: 1100 / 500 !important;      /* ← sets the box height from width */
	background-repeat: no-repeat;
	background-position: center top;
	background-size: 100% 100% !important;    /* Switch to 'cover' if you prefer cropping on mobile */
	padding: 0 !important;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	outline:0px solid blue;
}

/* ============================
   Rows & Seats
   ============================ */

ul.hidden { display: none !important; }

.seatplan li[id^="s"] {
  position: absolute !important;
  margin-top: 0 !important;
  transform-origin:50% 100%;
}


ul.r {
  padding: 0;
  margin: 0;
  list-style: none;
  z-index: 1;
  /* LEGACY repeated in every breakpoint ⇒ no need anymore */
}

ul.r li {
  position: absolute;       /* was relative */
  margin-top: 0;            /* remove the pull-up */
  transform-origin: top left;
  width: var(--seat-w);                  /* NEW: use variables instead of repeating per breakpoint */
  height: var(--seat-h);
  font-size: var(--seat-fs);
  padding: 0;
  text-align: center;
  border: 1px solid #808080;
  border-radius: var(--seat-br);         /* NEW: no -webkit- prefix needed */
  box-shadow: 0 2px 2px rgba(0, 0, 0, .2); /* NEW: unprefixed only */
  color: #000;
  cursor: pointer;
  z-index: 10;
}

ul.r li.ltr {
  position: absolute; 
  font-weight: bold;
  color: #f00;
  outline: 0 solid #c0c0c0;
  background-color: transparent;        /* LEGACY: “none” is invalid for background-color */
  cursor: default;
  border: 0 solid #808080;
  box-shadow: none;                      /* LEGACY: was -webkit-box-shadow + box-shadow */
}

/* Before:
ul.r li.q { position: relative; ... }
*/
ul.r li.q {
  position: absolute;       /* keep absolute positioning like other seats */
  font-size: var(--seat-q-fs);
  font-weight: bold;
  color: #808080;
  outline: 0px solid #c0c0c0;
  background-color: transparent;
  cursor: default;
  line-height: 1.5;
  border: 2px solid #808080;
  border-radius: var(--seat-q-br);
  box-shadow: 0 2px 2px rgba(0, 0, 0, .2);
  padding:0;
}


 
@media (max-width: 1200px) {
	:root {
    --seat-w: 36px;
    --seat-h: 30px;
    --seat-fs: 18px;
    --seat-br: 0;
    --seat-q-fs: 40px;
    --seat-q-br: 15px;
    }
	/* div.seatplan{width:935px;height:425px;outline:1px solid yellow;}
	ul.r{padding:0px;margin:0px;list-style-type:none;height:0px;}
	ul.r li{position:relative;width:20px;height:20px;font-size:9px;} */
	div.seatplan{outline:0px solid red;}
} 
@media (max-width: 992px) {	
	:root {
    --seat-w: 22px;
    --seat-h: 21px;
    --seat-fs: 12px;
    --seat-br: 0;
    --seat-q-fs: 36px;
    --seat-q-br: 10px;
    }
/* 	div.seatplan{width:680px;height:309px;outline:1px solid red;}
	ul.r{padding:0px;margin:0px;list-style-type:none;height:0px;}
	ul.r li{position:relative;width:22px;height:21px;font-size:12px;}
	ul.r li.q{border:2px solid #808080;-webkit-border-radius:10px;border-radius:10px;} */
	ul.r li.q {line-height: 1;}
	div.seatplan{outline:0px solid green;}
}
@media (max-width: 768px) {
	:root {
	--seat-w: 20px;
	--seat-h: 18px;
	--seat-fs: 10px;
	--seat-br: 0;
	--seat-q-fs: 28px;
	--seat-q-br: 6px; 
	}
/* 	div.seatplan{width:500px;height:227px;outline:1px solid orange;padding:0px;margin-top:16px}
	ul.r{padding:0px;margin:0px;list-style-type:none;height:0px;}
	ul.r li{position:relative;width:20px;height:18px;font-size:10px;}
	ul.r li.q{border:2px solid #808080;-webkit-border-radius:6px;border-radius:6px;} */
	ul.r li.q {line-height: 1;}
}
/*If you delete a @media here....make sure you also delete the associated @media in the classes/seatplan.php tep_renderSeatplanCSS*/
@media (max-width: 576px) {
  :root {
    --stage-max-w: 250px;   /* now width = min(100%, 250px) */
	--seat-w: 18px;
    --seat-h: 18px;
    --seat-fs: 5px;
    --seat-br: 2px 2px 0 0;
    --seat-q-fs: 12px;
    --seat-q-br: 5px;
  }
	/* div#stage_label{width:250px;}
	div.seatplan{width:250px;} */
}

/* default widths come from :root; override only for pages with columns */
/* clamp seatplan/stage to ~700px whenever this page has side columns */
@media (min-width: 993px) { .seatplan-wrap.has-cols { --stage-max-w: 800px; } }
@media (max-width: 992px) and (min-width: 769px) { .seatplan-wrap.has-cols { --stage-max-w: 500px; } }
@media (max-width: 768px) and (min-width: 577px) { .seatplan-wrap.has-cols { --stage-max-w: 500px; } }
@media (max-width: 576px) { .seatplan-wrap.has-cols { --stage-max-w: 250px; } }




/* Optional: fallback horizontal scrolling if you ever collapse breakpoints too far
.clear { overflow-x: auto; -webkit-overflow-scrolling: touch; } */