/* ===== Responsive CSS - fotosvatebka.cz ===== */

/* Fluid images globally */
img {
  max-width: 100%;
  height: auto;
}

/* Mobile toggle buttons — hidden on desktop */
.mobile-controls {
  display: none;
}

.nav-toggle,
.login-toggle {
  cursor: pointer;
  border: none;
  border-radius: 3px;
  line-height: 1;
  vertical-align: middle;
}

.nav-toggle {
  background: #681738;
  color: #fff;
  font-size: 22px;
  padding: 7px 11px;
  margin: 5px 3px 0 0;
}

.login-toggle {
  background: #a8432d;
  color: #fff;
  font-size: 13px;
  padding: 7px 10px;
  margin: 5px 2px 0 0;
}

/* Catalog overview thumbnails: consistent size on all devices */
.rightcolom td[width="110"] img,
.rightcolom td[width="110"] a img {
  width: 100px;
  height: 70px;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* ===== LARGE SCREEN — make wrapper fluid from 1060px down ===== */
@media screen and (max-width: 1060px) {
  #wrapper {
    width: 100%;
    max-width: 1060px;
    overflow-x: hidden;
  }

  #wrapper #header {
    width: auto;
  }

  #wrapper #header .topnav {
    width: 100%;
  }

  #wrapper #content {
    width: auto;
  }

  #wrapper #content .rightcolom {
    width: calc(100% - 240px);
  }

  #footer .footermid {
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
  }

  #footer .footermid .copyright,
  #footer .footermid ul {
    width: 100%;
  }
}

/* ===== MOBILE (max 768px) ===== */
@media screen and (max-width: 768px) {

  /* Body & wrapper */
  body {
    background-image: none;
    background-color: #FFF9F1;
  }

  #ft_flower {
    float: none;
  }

  #wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background-image: none;
    overflow-x: hidden;
  }

  /* Show hamburger area */
  .mobile-controls {
    display: block;
    float: right;
    margin: 10px 5px 0 0;
  }

  /* ---- HEADER ---- */
  #wrapper #header {
    width: 100%;
    height: auto;
    min-height: 60px;
    margin: 0;
    padding-bottom: 5px;
    overflow: hidden;
    background: #fff8f0;
    border-bottom: 3px solid #681738;
    box-sizing: border-box;
  }

  #wrapper #header .logo {
    float: left;
    width: auto;
    height: auto;
    margin: 8px 0 0 8px;
  }

  #wrapper #header .logo img {
    max-width: 160px;
    height: auto;
  }

  /* Hide info bar on mobile */
  #wrapper #header .info {
    display: none;
  }

  /* Login box: hidden by default, opens when toggled */
  #wrapper #header .loginbox {
    clear: both;
    float: none;
    display: none;
    width: 100%;
    height: auto;
    background: #fff8f0;
    background-image: none;
    border-top: 1px solid #d1b88a;
    padding: 10px 15px;
    box-sizing: border-box;
    margin: 0;
  }

  #wrapper #header .loginbox.open {
    display: block;
  }

  #wrapper #header .loginbox .mid {
    width: 100%;
    float: none;
    display: block;
  }

  #wrapper #header .loginbox .mid p {
    width: 100%;
    float: none;
    display: block;
    margin: 5px 0;
  }

  #wrapper #header .loginbox .mid p .inputbox,
  #wrapper #header .loginbox .mid p .inputbox1 {
    display: inline-block;
    float: none;
    width: 44%;
    margin-right: 2%;
    box-sizing: border-box;
  }

  /* Navigation: hidden by default, opens when hamburger clicked */
  #wrapper #header .topnav {
    clear: both;
    float: none;
    display: none;
    width: 100%;
    height: auto;
    background: #681738;
    background-image: none;
    margin: 0;
    padding: 0;
  }

  #wrapper #header .topnav.open {
    display: block;
  }

  #wrapper #header .topnav ul {
    padding: 0;
    margin: 0;
    display: block;
  }

  #wrapper #header .topnav ul li {
    display: block;
    float: none;
    font-size: 16px;
    line-height: 1;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin: 0;
  }

  #wrapper #header .topnav ul li a {
    display: block;
    padding: 13px 16px;
    color: #fff;
    text-decoration: none;
  }

  /* Fix "wedding" tab on mobile */
  #wrapper #header .topnav ul li.wedding a {
    float: none;
    background: none;
    background-color: rgba(255,255,255,0.1);
    margin: 0;
    padding: 13px 16px;
    line-height: 1;
    display: block;
    color: #fff;
  }

  #wrapper #header .topnav ul li.wedding a span {
    float: none;
    display: inline;
    background: none;
    padding: 0;
    color: #fff;
  }

  /* ---- CONTENT ---- */
  #wrapper #content {
    width: 100%;
    float: none;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    border-left: none;
    border-right: none;
    margin: 0;
  }

  /* Left sidebar — appears before footer */
  #wrapper #content .leftcol {
    -webkit-order: 2;
    order: 2;
    float: none;
    display: block;
    width: 100%;
    margin: 0;
    background: #fdf5ee;
    border-bottom: 2px solid #d1b88a;
    padding: 8px 15px 12px 15px;
    box-sizing: border-box;
  }

  #wrapper #content .leftcol .listbox {
    float: none;
    width: 100%;
    display: block;
  }

  #wrapper #content .leftcol .listbox ul {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    width: 100%;
    float: none;
    margin: 5px 0;
  }

  #wrapper #content .leftcol .listbox ul li {
    width: 50%;
    font-size: 14px;
    background-position: 5px 8px;
    box-sizing: border-box;
  }

  #wrapper #content .leftcol .listbox .line {
    display: none;
  }

  /* Inline style overrides for left-col boxes */
  #wrapper #content .leftcol .listbox[style],
  #wrapper #content .leftcol div > .listbox {
    width: 100% !important;
  }

  #wrapper #content .leftcol .searchbox {
    float: none;
    width: 100%;
    margin: 5px 0;
    display: block;
  }

  #wrapper #content .leftcol .searchbox p {
    width: 100%;
    float: none;
  }

  /* Main content column */
  #wrapper #content .rightcolom {
    -webkit-order: 1;
    order: 1;
    float: none;
    display: block;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    box-sizing: border-box;
  }

  /* Welcome box */
  #wrapper #content .rightcolom .welcomebox {
    display: block;
    width: 100%;
    float: none;
    background: none;
    overflow-x: hidden;
  }

  /* Safety net: prevent horizontal page scroll */
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }

  #ft_flower,
  #wrapper {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Product image — force fit to screen (img tag has hardcoded width/height HTML attributes) */
  img.gallery {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
  }

  /* All images inside content respect container */
  .rightcolom img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* All tables in rightcolom: prevent overflow (but keep auto layout so tabs/menus work) */
  .rightcolom table {
    max-width: 100% !important;
  }

  /* Product image table: needs fixed layout to constrain the oversized image */
  .mid3 > table,
  .mid3 table[width="97%"] {
    width: 100% !important;
    table-layout: fixed;
  }

  .mid3 > table > tbody > tr > td,
  .mid3 table[width="97%"] > tbody > tr > td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
  }

  /* Override hardcoded pixel widths baked into inline styles (popis, velikost, info bloky) */
  .rightcolom [style*="width:550px"],
  .rightcolom [style*="width: 550px"],
  .rightcolom [style*="width:570px"],
  .rightcolom [style*="width: 570px"],
  .rightcolom [style*="width:680px"],
  .rightcolom [style*="width: 680px"],
  .rightcolom [style*="width:698px"],
  .rightcolom [style*="width: 698px"],
  .rightcolom [style*="width:700px"],
  .rightcolom [style*="width: 700px"],
  .rightcolom [style*="width:720px"],
  .rightcolom [style*="width: 720px"],
  .rightcolom [style*="width:722px"],
  .rightcolom [style*="width: 722px"],
  .rightcolom [style*="width:730px"],
  .rightcolom [style*="width: 730px"],
  .rightcolom [style*="width:750px"],
  .rightcolom [style*="width: 750px"] {
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Override hardcoded pixel margins/paddings */
  .rightcolom [style*="margin-left:100px"],
  .rightcolom [style*="margin-left: 100px"] {
    margin-left: 5px !important;
    margin-right: 5px !important;
  }

  .rightcolom [style*="padding-left:30px"],
  .rightcolom [style*="padding-left: 30px"],
  .rightcolom [style*="padding-left:39px"],
  .rightcolom [style*="padding-left: 39px"],
  .rightcolom [style*="padding-left:40px"],
  .rightcolom [style*="padding-left: 40px"] {
    padding-left: 10px !important;
  }

  /* Override <table width="400"> and similar fixed-pixel table attributes */
  .rightcolom table[width="400"],
  .rightcolom table[width="500"],
  .rightcolom table[width="600"],
  .rightcolom table[width="700"],
  .rightcolom table[width="750"] {
    width: 100% !important;
  }

  /* Override <td width="..." with fixed pixel value> */
  .rightcolom td[width="100"],
  .rightcolom td[width="110"],
  .rightcolom td[width="130"],
  .rightcolom td[width="150"] {
    width: auto !important;
    max-width: 100%;
  }

  #wrapper #content .rightcolom .welcomebox .edge,
  #wrapper #content .rightcolom .welcomebox .mid {
    width: 100%;
    float: none;
  }

  #wrapper #content .rightcolom .welcomebox .mid p {
    width: 100%;
    float: none;
    padding: 5px 0;
  }

  #wrapper #content .rightcolom .welcomebox .mid .bangel,
  #wrapper #content .rightcolom .welcomebox .mid .bangel_con {
    display: none;
  }

  /* Catalogue box inside welcome */
  #wrapper #content .rightcolom .welcomebox .cataloguebox {
    width: 100%;
    margin: 0;
  }

  #wrapper #content .rightcolom .welcomebox .cataloguebox .boxedge,
  #wrapper #content .rightcolom .welcomebox .cataloguebox .boxmid {
    width: 100%;
    float: none;
    box-sizing: border-box;
    border: none;
  }

  #wrapper #content .rightcolom .welcomebox .cataloguebox .boxmid .bookblock {
    width: 48%;
    height: auto;
    margin: 8px 1%;
    box-sizing: border-box;
  }

  /* Main catalog section */
  #wrapper #content .rightcolom .catalog {
    width: 100%;
    float: none;
    margin: 10px 0;
  }

  #wrapper #content .rightcolom .catalog .title {
    width: 100%;
    box-sizing: border-box;
    background: #681738;
    background-image: none;
    padding: 0 0 0 15px;
    font-size: 18px;
  }

  #wrapper #content .rightcolom .catalog .content {
    width: 100%;
    float: none;
    margin: 0;
    box-sizing: border-box;
  }

  #wrapper #content .rightcolom .catalog .content p {
    width: auto;
    float: none;
    display: block;
  }

  /* Wedding photo section */
  #wrapper #content .rightcolom .wedphoto {
    width: 100%;
    float: none;
  }

  #wrapper #content .rightcolom .wedphoto p {
    width: 100%;
    padding: 5px 0;
  }

  #wrapper #content .rightcolom .wedphoto p img {
    float: none;
    display: block;
    margin: 0 auto 10px;
    max-width: 100%;
  }

  /* Mid2 / mid3 content headings */
  #wrapper #content .mid2 h1,
  #wrapper #content .mid3 h1 {
    font-size: 22px;
    padding: 10px;
    margin-top: 10px;
  }

  #wrapper #content .mid2 h2 {
    font-size: 16px;
    padding: 10px;
    margin: 0;
  }

  #wrapper #content .mid2 h3 {
    font-size: 14px;
    padding: 8px 10px;
  }

  #wrapper #content .mid2 p {
    padding: 5px 10px;
  }

  /* Gallery items */
  .galerie {
    width: 48% !important;
    margin: 0 1% !important;
    float: left;
    box-sizing: border-box;
  }

  /* Pagination nav */
  .navigace {
    text-align: center;
    padding: 5px;
  }

  /* Contact box */
  #contactbox2 {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  #contactbox2 .curve,
  #contactbox2 .midcon {
    width: 100%;
    float: none;
    box-sizing: border-box;
  }

  #contactbox2 .midcon .iconbox {
    width: calc(100% - 20px);
    margin: 10px;
    float: none;
  }

  #contactbox2 .midcon .titlebox {
    width: calc(100% - 20px);
    margin: 10px;
    float: none;
    box-sizing: border-box;
  }

  #contactbox2 .midcon .formbox {
    width: calc(100% - 20px);
    margin: 10px;
    float: none;
    box-sizing: border-box;
  }

  #contactbox2 .midcon .formbox label {
    float: none;
    display: block;
    text-align: left;
    width: 100%;
    line-height: 1.6;
    padding: 5px 0 2px 0;
  }

  #contactbox2 .midcon .formbox input,
  #contactbox2 .midcon .formbox .email,
  #contactbox2 .midcon .formbox .phone,
  #contactbox2 .midcon .formbox .menubox {
    width: 100% !important;
    float: none;
    display: block;
    box-sizing: border-box;
    background-image: none;
    background-color: #f5e8e0;
    border: 1px solid #d1a88a;
    height: 36px;
    padding: 5px 10px;
    margin-bottom: 8px;
    border-radius: 3px;
  }

  #contactbox2 .midcon .formbox .msgbox {
    width: 100% !important;
    float: none;
    display: block;
    box-sizing: border-box;
    background-image: none;
    background-color: #f5e8e0;
    border: 1px solid #d1a88a;
    height: 150px;
    padding: 8px;
    border-radius: 3px;
  }

  #contactbox2 .midcon .bookimg {
    display: none;
  }

  /* Tables — horizontal scroll */
  .rightcolom table {
    overflow-x: auto;
    display: block;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* Forms general */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  textarea,
  select {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ---- FOOTER ---- */
  #footer {
    height: auto;
    background: #681738;
    background-image: none;
    padding: 20px 0;
    float: none;
    clear: both;
  }

  #footer .footermid {
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
  }

  #footer .footermid .copyright {
    width: 100%;
    margin: 0;
    color: #ffcec4;
    text-align: center;
    float: none;
  }

  #footer .footermid ul {
    width: 100%;
    margin: 10px 0 0 0;
    float: none;
    text-align: center;
  }

  #footer .footermid ul li {
    float: none;
    display: inline-block;
    font-size: 12px;
    color: #ffcec4;
    padding: 2px 6px;
  }

  #footer .footermid ul li a {
    color: #ffcec4;
  }
}

/* ===== SMALL MOBILE (max 480px) ===== */
@media screen and (max-width: 480px) {

  #wrapper #header .logo img {
    max-width: 130px;
  }

  .nav-toggle {
    font-size: 18px;
    padding: 6px 10px;
  }

  /* Sidebar nav: single column */
  #wrapper #content .leftcol .listbox ul li {
    width: 100%;
  }

  /* Login inputs: full width stacked */
  #wrapper #header .loginbox .mid p .inputbox,
  #wrapper #header .loginbox .mid p .inputbox1 {
    display: block;
    float: none;
    width: 100%;
    margin-bottom: 5px;
    box-sizing: border-box;
  }

  #wrapper #content .mid2 h1,
  #wrapper #content .mid3 h1 {
    font-size: 18px;
  }

  .galerie {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
  }

  /* Book blocks in catalogue: full width */
  #wrapper #content .rightcolom .welcomebox .cataloguebox .boxmid .bookblock {
    width: 100%;
    margin: 8px 0;
  }
}
