/* ---------------------------------------------------------------
   responsive + cleanup layer  -  loaded last, overrides legacy CSS
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body { overflow-x: hidden; }

/* legacy markup carries hard width/height attributes - neutralise them */
img, video, canvas, object, embed { max-width: 100%; height: auto; }
img[width], img[height] { height: auto; }

/* legacy inline "width:600px" boxes */
[style*="width: 600px"], [style*="width:600px"] {
  width: 100% !important;
  max-width: 600px !important;
  height: auto !important;
}

/* fluid embeds: maps, facebook page plugin */
.embed-fluid {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding-top: 56.25%;
  overflow: hidden;
}
.embed-fluid > iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}
.embed-fluid--map { padding-top: 66%; }
.embed-fluid--fb  { padding-top: 0; height: 154px; }
.embed-fluid--fb > iframe { position: static; height: 154px !important; }

@media (max-width: 480px) {
  .embed-fluid--map { padding-top: 80%; }
}

/* legacy layout tables must not force horizontal page scroll */
table { max-width: 100%; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* long unbroken strings (urls, phone numbers) */
.mcont, .module, .artcont, td, li, p { word-wrap: break-word; overflow-wrap: break-word; }

/* tap targets */
a, button, .mbtn, .navbar-toggle { touch-action: manipulation; }
@media (max-width: 767px) {
  .hdmenu2 { float: none; clear: both; font-size: 13px; line-height: 2; }
  .hdmenu2 a { display: inline-block; padding: 6px 2px; }
  .msearch { max-width: 100%; float: none; clear: both; }
  .mnavbar, .mnavbar-header { float: none; }
  .mlogo img { max-width: 60vw; height: auto; }
}

/* never let a fixed-width child blow out the viewport */
.wrap, .minner, .mrow, .mcol { max-width: 100%; }

/* site-wide footer navigation (guarantees every page is one hop away) */
.sitelinks { border-top: 1px solid #e5e5e5; background: #fafafa; padding: 28px 16px 34px; margin-top: 30px; }
.sitelinks-inner { max-width: 1200px; margin: 0 auto; }
.sitelinks h2 { font-size: 15px; margin: 0 0 14px; color: #444; font-weight: 700; }
.sitelinks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 0; }
.sitelinks li { flex: 0 0 auto; }
.sitelinks li + li::before { content: "\00b7"; color: #bbb; margin: 0 10px; }
.sitelinks a { color: #555; font-size: 13px; text-decoration: none; display: inline-block; padding: 4px 0; }
.sitelinks a:hover, .sitelinks a:focus { color: #111; text-decoration: underline; }
@media (max-width: 767px) {
  .sitelinks ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 12px; }
  .sitelinks li + li::before { content: none; }
  .sitelinks a { padding: 8px 0; font-size: 13px; }
}

/* banner slider (dots + autoplay in assets/js/site.js) */
.mads-li.mcarousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.mads-li.mcarousel::-webkit-scrollbar { display: none; }
.mads-li.mcarousel > .figBS { flex: 0 0 100%; scroll-snap-align: start; margin: 0; }
.mads-li.mcarousel img { display: block; width: 100%; height: auto; margin: 0; }
.mcarousel-dots { display: flex; justify-content: center; gap: 4px; margin-top: 6px; }
.mcarousel-dots button { -webkit-appearance: none; appearance: none; box-sizing: content-box; width: 10px; height: 10px; padding: 7px; border: 0; border-radius: 50%; background: #d6d6d6; background-clip: content-box; cursor: pointer; }
.mcarousel-dots button.active { background-color: #ec6952; }

/* 分享 button on store pages (the old icon pointed at the retired CMS) */
.artctrl .share_btn { display: inline-block; padding: 8px 14px 8px 38px; border: 1px solid #ec6952; border-radius: 4px; color: #ec6952; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ec6952' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='M8.6 13.5l6.8 4M15.4 6.5l-6.8 4'/%3E%3C/svg%3E") no-repeat 12px center / 18px 18px; }
.artctrl .share_btn:focus-visible { outline: 2px solid #ec6952; outline-offset: 2px; }

/* contact block that replaced the CMS forms (預約刊登 / 客服中心 / 優惠卡申請 / 好康快報) */
.contact-links { max-width: 760px; }
.contact-lead { margin: 0 0 16px; line-height: 1.8; }
.contact-links ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contact-links a { display: flex; flex-direction: column; justify-content: center; min-height: 64px; padding: 10px 16px; border: 1px solid #e5e5e5; border-left: 4px solid #ec6952; border-radius: 6px; background: #fff; color: #333; text-decoration: none; }
.contact-links a:hover, .contact-links a:focus { border-color: #ec6952; }
.contact-kind { font-size: 13px; color: #777; }
.contact-value { font-size: 17px; font-weight: 700; color: #ec6952; }
.contact-hours { margin: 12px 0 0; font-size: 13px; color: #777; }
.form-terms { max-width: 760px; margin-top: 24px; padding: 16px; background: #fafafa; border-radius: 6px; font-size: 14px; }
@media (max-width: 480px) {
  .contact-links ul { grid-template-columns: 1fr; }
}
