/* =============================================
   responsive.css - Mobile First Responsive Design
   for 100dreams.co.jp
   ============================================= */

/* --- Base: Mobile First (default = small screens) --- */

/* Viewport box-sizing reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Override fixed widths to be fluid */
#wrapper {
  min-width: 0 !important;
  width: 100% !important;
  overflow-x: clip;
}
/* Fallback for browsers that don't support overflow:clip */
@supports not (overflow-x: clip) {
  #wrapper {
    overflow-x: hidden;
    overflow-y: auto;
  }
}

#content,
#content2,
div#list {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 12px;
}

/* --- Header: Mobile --- */
#header {
  height: auto !important;
  padding: 8px 12px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
}

#header_info {
  float: none !important;
  width: auto;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

#header #logo,
#logo {
  float: none !important;
  padding-right: 0 !important;
}

#header #logo img,
#logo img {
  max-width: 200px;
  height: auto;
}

/* Hide search on mobile by default */
#search_set {
  display: none;
}

/* Header nav links - hide on mobile */
#header > ul,
#header_info + ul {
  display: none;
}

#header #slogan,
#slogan {
  display: none;
}

/* --- Hamburger Menu Button --- */
.hamburger-btn {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  position: relative;
}

.hamburger-btn span {
  display: block;
  width: 26px;
  height: 3px;
  background: #333;
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-radius: 2px;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Mobile Navigation Overlay --- */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.97);
  z-index: 1000;
  padding: 60px 20px 20px;
  overflow-y: auto;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100% !important;
}

.mobile-nav li {
  display: block !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-bottom: 1px solid #eee;
}

.mobile-nav li a {
  display: block !important;
  width: auto !important;
  padding: 14px 16px !important;
  margin: 0 !important;
  font-size: 16px !important;
  text-decoration: none;
  color: #333 !important;
  background: none !important;
  white-space: normal !important;
}

.mobile-nav li a:hover,
.mobile-nav li a:active {
  background: #f0f0f0 !important;
}

.mobile-nav .mobile-nav-section {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 2px solid #ccc;
}

.mobile-nav .mobile-nav-section-title {
  font-size: 12px;
  color: #999;
  padding: 0 16px 6px;
  text-transform: uppercase;
}

/* --- Global Navigation: Hide on mobile --- */
#global_navi {
  display: none;
}

/* --- Main Content: Mobile --- */
#main_content {
  margin: 16px 0 0 0 !important;
  padding: 0 4px;
}

/* --- Images: Responsive --- */
img {
  max-width: 100%;
  height: auto;
}

/* --- Float layouts: Stack on mobile --- */
.picture,
.picture1,
.picture1b,
.picture1c,
.picture2,
.cphoto,
.cphoto_s,
.cphoto_b,
#gphoto,
#rphoto {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 10px 0 !important;
  text-align: center;
}

/* .left class: don't stretch images, just center them */
.left {
  float: none !important;
  margin: 10px auto !important;
  text-align: center;
}

img.left {
  width: auto !important;
  max-width: 100% !important;
  display: block;
  margin: 10px auto !important;
}

.cphoto img,
.cphoto_s img,
.cphoto_b img,
#gphoto img,
#rphoto img {
  max-width: 100%;
  height: auto;
}

/* --- Section 1 (Top page hero): Fix absolute positioning --- */
#section_1 {
  position: static !important;
  height: auto !important;
  padding: 10px 0;
}

#section_1 h1 {
  position: static !important;
  font-size: 1.4em;
  line-height: 1.4em;
  margin: 0 0 10px 0;
  font-weight: bold !important;
  text-align: center;
  color: #e30000;
}

#section_1 img {
  display: block;
  margin: 0 auto 10px;
}

/* --- Goods description: Center on mobile --- */
#main_content {
  text-align: center;
}

#main_content div[style*="float:left"] {
  float: none !important;
  width: 100% !important;
  margin: 10px auto !important;
  text-align: center;
}

#main_content div[style*="float:left"] img {
  display: inline-block;
}

#main_content div[style*="float:left"] h2 {
  margin-left: auto !important;
  margin-right: auto !important;
}

#main_content p[style*="margin:20px 130px"] {
  text-align: left;
}

#main_content h2.line,
#main_content ul {
  text-align: left;
}

/* --- Shop: Fix absolute-positioned elements overflowing on mobile --- */
#ctext {
  position: static !important;
  overflow: hidden;
}

#ctext div[style*="position:absolute"],
#ctext p[style*="position:absolute"] {
  position: static !important;
  left: auto !important;
  top: auto !important;
  margin: 10px 0;
  text-align: center;
}

/* Goods detail pages: same fix for #goods container */
#goods[style*="position:relative"] {
  position: static !important;
}

#goods div[style*="position:absolute"],
#goods p[style*="position:absolute"] {
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  margin: 10px 0;
  text-align: center;
}

/* --- Text content: Fluid widths --- */
#ctext p,
#ctext p.description,
#gtext p,
#rtext p,
p.description {
  width: auto !important;
  max-width: 100%;
}

.listtitle,
.listtitle2 {
  width: auto !important;
  max-width: 100%;
}

/* --- Tables: Responsive --- */
table {
  max-width: 100%;
}

/* --- Company Info (aboutus): div-based layout --- */
#company {
  padding: 20px 16px;
  text-align: left;
}

#company > div {
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  line-height: 1.7em;
  font-size: 14px;
}

#company > div:first-child {
  font-size: 16px;
  font-weight: bold;
  color: #1b2c73;
  border-bottom: 2px solid #1b2c73;
  padding-bottom: 12px;
  margin-bottom: 4px;
}

#company > div:last-of-type {
  border-bottom: none;
}

#company table {
  width: 100% !important;
  max-width: 100%;
  margin-top: 16px;
}

#company table th,
#company table td {
  display: block;
  width: 100% !important;
  text-align: left;
  padding: 6px 0;
}

#company table th {
  font-weight: bold;
  color: #1b2c73;
  padding-top: 12px;
}

/* Profile section (aboutus) */
#content > table[summary="ご挨拶"],
#content > table[summary] {
  width: 100% !important;
  max-width: 100%;
}

#content > table[summary] tr {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#content > table[summary] th,
#content > table[summary] td {
  display: block;
  width: 100% !important;
  text-align: left;
}

#content > table[summary] th {
  text-align: center;
  padding-bottom: 16px;
}

#content > table[summary] th img {
  max-width: 135px;
  height: auto;
}

#content > table[summary] td {
  line-height: 1.7em;
  font-size: 14px;
  padding: 0 4px;
}

/* Map section */
#content p[style*="width:650px"] {
  width: 100% !important;
  margin: 20px auto !important;
  text-align: center;
}

#content p[style*="width:650px"] img {
  max-width: 100%;
  height: auto;
  float: none !important;
  display: block;
  margin: 10px auto;
}

#sitemap table {
  width: 100% !important;
  max-width: 100%;
}

/* Shop/Cart tables */
table.basket,
table.delivery_address,
table.pay_method {
  width: 100% !important;
  max-width: 100%;
}

table.shiharai {
  width: 100% !important;
}

/* --- Fixed-width elements from various sections --- */
h3 {
  width: auto !important;
  max-width: 100%;
}

/* --- Footer: Mobile --- */
#footer,
div#footer {
  padding: 10px 12px;
}

div#footnavi {
  width: auto !important;
  max-width: 100%;
  text-align: center !important;
}

div#footnavi ul.dividelinklist01 {
  text-align: center !important;
}

div#copyright {
  width: auto !important;
  max-width: 100%;
  text-align: center !important;
}

/* --- Breadcrumb: Wrap --- */
ul.shopcrumb {
  padding-left: 10px !important;
}

/* --- Goods list page inline widths --- */
div[style*="float:left"] {
  float: none !important;
  width: 100% !important;
}

/* Float images/paragraphs: stack vertically on mobile */
p[style*="float:left"] {
  float: none !important;
  max-width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 20px;
  text-align: center;
}

p[style*="float:left"] img {
  max-width: 100%;
  height: auto;
}

/* --- Inline style overrides for common patterns --- */
p[style*="width:770px"] {
  width: auto !important;
  max-width: 100%;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

ul[style*="margin-left:320px"] {
  margin-left: 20px !important;
}

p[style*="margin:20px 130px"],
p[style*="margin:20px 80px"] {
  margin-left: 10px !important;
  margin-right: 10px !important;
}

/* --- Utility: Hide on mobile --- */
.hide-mobile {
  display: none !important;
}

/* --- Utility: Hide on desktop --- */
.hide-desktop {
  display: block;
}

/* --- Shop control pages (admin) --- */
div.shop_info {
  float: none !important;
  margin: 10px 0 !important;
}

/* --- Inside navi (tabs) override --- */
ul#top_inside_navi {
  width: 100% !important;
  height: auto !important;
}

ul#top_inside_navi li {
  float: none !important;
}

ul#top_inside_navi li a,
ul#top_inside_navi li#mark a,
ul#top_inside_navi li#top a,
ul#top_inside_navi li#school a,
ul#top_inside_navi li#man_to_man a,
ul#top_inside_navi li#shop a,
ul#top_inside_navi li#eds a,
ul#top_inside_navi li#job a,
ul#top_inside_navi li#library a {
  width: auto !important;
  float: none !important;
  display: block;
  padding: 10px 16px !important;
  background: none !important;
  border-bottom: 1px solid #eee;
}

/* --- Error pages --- */
body.error-page #content {
  width: 100% !important;
  padding: 0 12px;
}


/* --- Japan Now (en/japan_now) pages: Mobile overrides --- */

/* Menu bar: stack vertically on mobile */
p.menu {
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-wrap: wrap;
}

p.menu a {
  float: none !important;
  width: 50% !important;
  padding: 10px 0 !important;
  border-right: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

/* Contents wrapper: fluid on mobile */
.contents {
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 12px;
}

/* Photo sections: unstack on mobile */
#photo img {
  float: none !important;
  display: block;
  margin: 0 auto 10px !important;
  max-width: 100%;
  height: auto;
}

/* Fixed-width headings: fluid */
h4, h5 {
  width: auto !important;
  max-width: 100%;
  margin-left: 0 !important;
}

/* About Us table: responsive */
.contents table {
  width: 100% !important;
  margin-left: 0 !important;
}

.contents table th,
.contents table td {
  display: block;
  width: 100% !important;
}

.contents table th {
  padding-top: 10px;
  font-weight: bold;
}


/* =============================================
   Tablet and up (768px+)
   ============================================= */
@media screen and (min-width: 768px) {

  #content,
  #content2 {
    padding: 0 20px;
  }

  #main_content {
    margin: 30px 0 0 30px !important;
  }

  /* Allow some float layouts on tablet */
  .cphoto,
  .cphoto_b {
    float: left !important;
    width: auto !important;
    max-width: 50%;
    margin-right: 18px !important;
    text-align: left;
  }

  #section_1 h1 {
    font-size: 1.4em;
  }

  /* Japan Now: restore float on tablet */
  #photo img {
    float: left !important;
    margin-right: 20px !important;
    display: inline !important;
  }

  .contents table th,
  .contents table td {
    display: table-cell;
    width: auto !important;
  }

  /* Two-column goods layout */
  .left {
    float: left !important;
    width: auto !important;
    max-width: 40%;
    margin-right: 20px !important;
  }

}


/* =============================================
   Desktop (950px+)
   ============================================= */
@media screen and (min-width: 950px) {

  /* Restore desktop widths */
  #content {
    width: 950px !important;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
  }

  #content2 {
    width: 800px !important;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
  }

  div#list {
    width: 800px !important;
    margin-left: auto;
    margin-right: auto;
  }

  /* Restore header */
  #header {
    height: 80px;
    padding: 0;
    display: block;
  }

  #header_info {
    float: left;
    display: block;
  }

  #header #logo,
  #logo {
    float: left !important;
    padding-right: 70px !important;
  }

  #header #logo img,
  #logo img {
    max-width: none;
  }

  #search_set {
    display: block !important;
  }

  #header #slogan,
  #slogan {
    display: block !important;
  }

  #header > ul,
  #header_info + ul {
    display: block !important;
    float: right;
  }

  /* Hide hamburger on desktop */
  .hamburger-btn {
    display: none !important;
  }

  .mobile-nav {
    display: none !important;
  }

  /* Restore global navigation - modern CSS horizontal menu */
  #global_navi {
    display: block !important;
    background: #2c3e6b;
    border-bottom: 3px solid #1a2a50;
    clear: both;
    overflow: hidden;
  }

  ul#top_inside_navi {
    width: 950px !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center;
    list-style: none;
  }

  ul#top_inside_navi li {
    float: none !important;
    flex: 1;
    text-align: center;
    position: relative;
  }

  ul#top_inside_navi li a,
  ul#top_inside_navi li#mark a,
  ul#top_inside_navi li#top a,
  ul#top_inside_navi li#school a,
  ul#top_inside_navi li#man_to_man a,
  ul#top_inside_navi li#shop a,
  ul#top_inside_navi li#eds a,
  ul#top_inside_navi li#job a,
  ul#top_inside_navi li#library a {
    display: block !important;
    width: auto !important;
    float: none !important;
    padding: 12px 20px !important;
    margin: 0 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: bold;
    background: none !important;
    border-bottom: none !important;
    transition: background-color 0.2s ease;
    white-space: nowrap !important;
  }

  ul#top_inside_navi li a:hover {
    background: #3d5291 !important;
  }

  /* Active tab (mark) - highlighted */
  ul#top_inside_navi li#mark a {
    background: #e30000 !important;
    color: #ffffff !important;
  }

  ul#top_inside_navi li#mark a:hover {
    background: #ff1a1a !important;
  }

  /* Separator lines between items */
  ul#top_inside_navi li + li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(255,255,255,0.2);
  }

  /* Restore main content margins and left-align */
  #main_content {
    margin: 50px 0 0 50px !important;
    text-align: left;
  }

  #main_content div[style*="float:left"] {
    float: left !important;
    width: auto !important;
    margin: 20px 30px 0px 0px !important;
    text-align: left;
  }

  #main_content div[style*="float:left"] h2 {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Restore section 1 absolute positioning */
  #section_1 {
    position: relative !important;
    height: 160px !important;
  }

  #section_1 h1 {
    position: absolute !important;
    top: 0px;
    left: 160px;
    font-size: 25px;
    text-align: left;
    font-weight: normal;
    line-height: 1.3em;
  }

  /* Restore float layouts */
  .left,
  img.left {
    float: left !important;
    width: auto !important;
    max-width: none;
    margin-right: 20px !important;
    margin-bottom: 10px !important;
    display: inline !important;
  }

  .picture {
    float: left !important;
    width: 275px !important;
  }

  .picture1 {
    float: left !important;
    width: 125px !important;
    margin-left: 20px !important;
    margin-top: 80px !important;
  }

  .picture1b {
    float: left !important;
    width: 220px !important;
    margin-left: 30px !important;
    margin-top: 80px !important;
  }

  .picture1c {
    float: left !important;
    width: 125px !important;
    margin-left: 30px !important;
    margin-top: 60px !important;
  }

  .picture2 {
    float: left !important;
    width: 205px !important;
    margin-left: 20px !important;
  }

  .cphoto {
    float: left !important;
    width: 200px !important;
    margin: 0 18px 2px 0 !important;
  }

  .cphoto_s {
    float: left !important;
    width: 120px !important;
    margin-right: 20px !important;
  }

  .cphoto_b {
    float: left !important;
    width: 265px !important;
    margin: 0 28px 2px 0 !important;
  }

  #gphoto {
    float: left !important;
    width: auto !important;
  }

  #rphoto {
    float: left !important;
    width: auto !important;
  }

  /* Restore ctext positioning */
  #ctext {
    position: relative !important;
    overflow: visible;
  }

  #ctext div[style*="position:absolute"],
  #ctext p[style*="position:absolute"] {
    position: absolute !important;
    left: 500px !important;
    top: 0px !important;
    margin: 0;
    text-align: left;
  }

  /* Restore goods positioning — let inline styles take effect */
  #goods[style*="position:relative"] {
    position: relative !important;
  }

  #goods div[style*="position:absolute"] {
    position: absolute !important;
  }

  #goods p[style*="position:absolute"] {
    position: absolute !important;
  }

  /* Restore text widths */
  #ctext p {
    width: 620px !important;
  }

  .listtitle {
    width: 730px !important;
  }

  .listtitle2 {
    width: 630px !important;
  }

  /* Restore company info (aboutus) for desktop */
  #company {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 30px 0;
    text-align: center;
  }

  #company > div {
    font-size: 15px;
    padding: 8px 0;
  }

  #company > div:first-child {
    font-size: 18px;
  }

  #company table {
    width: 460px !important;
    margin-left: auto;
    margin-right: auto;
  }

  #company table th,
  #company table td {
    display: table-cell;
    width: auto !important;
    padding: 4px 8px;
  }

  /* Restore profile table for desktop */
  #content > table[summary] tr {
    display: table-row;
  }

  #content > table[summary] th,
  #content > table[summary] td {
    display: table-cell;
    width: auto !important;
    vertical-align: top;
  }

  #content > table[summary] th {
    text-align: left;
    padding-right: 20px;
  }

  #content > table[summary] td {
    font-size: 15px;
  }

  /* Restore map section */
  #content p[style*="width:650px"] {
    width: 650px !important;
  }

  #content p[style*="width:650px"] img {
    float: left !important;
    display: inline;
    margin: 0;
  }

  /* Restore inline 770px widths */
  p[style*="width:770px"] {
    width: 770px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  ul[style*="margin-left:320px"] {
    margin-left: 320px !important;
  }

  /* Restore float:left paragraphs */
  p[style*="float:left"] {
    float: left !important;
    margin-left: 0 !important;
    margin-right: 20px !important;
    margin-bottom: 0;
    text-align: left;
  }

  #sitemap table {
    width: 650px !important;
  }

  table.basket,
  table.delivery_address,
  table.pay_method {
    width: 700px !important;
  }

  h3 {
    width: 9em !important;
  }

  /* Restore footer */
  div#footnavi {
    text-align: right !important;
  }

  div#footnavi ul.dividelinklist01 {
    text-align: right !important;
  }

  div#copyright {
    text-align: left !important;
  }

  /* Desktop utility */
  .hide-mobile {
    display: block !important;
  }

  .hide-desktop {
    display: none !important;
  }

  /* Restore inline float:left divs on desktop */
  div[style*="float:left"] {
    float: left !important;
    width: auto !important;
  }

  /* Restore wrapper min-width */
  #wrapper {
    min-width: 950px !important;
  }

  /* --- Japan Now pages: Restore desktop layout --- */
  p.menu {
    width: 564px !important;
    height: 2em !important;
    margin: 30px auto !important;
    display: block;
  }

  p.menu a {
    float: left !important;
    width: 10em !important;
    border-right: solid 1px #ffffff !important;
    border-bottom: none !important;
    padding: 0 !important;
  }

  .contents {
    width: 570px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0;
  }

  #photo img {
    float: left !important;
    margin-right: 20px !important;
    display: inline !important;
  }

  h4 {
    width: 120px !important;
    margin-left: 20px !important;
  }

  h5 {
    width: 200px !important;
    margin-left: 20px !important;
  }

  .contents table {
    margin-left: 20px !important;
    width: auto !important;
  }

  .contents table th,
  .contents table td {
    display: table-cell;
    width: auto !important;
  }

  /* Restore shop_info float */
  div.shop_info {
    float: right !important;
    margin: 0 12px 0 0 !important;
  }
}
