:root {
  --wine: #4b0e12;
  --wine-dark: #2b070a;
  --wine-mid: #6d1c1f;
  --gold: #b99148;
  --gold-light: #d3b36e;
  --paper: #fffaf1;
  --cream: #f7efe3;
  --line: #e3d4bd;
  --text: #3b2923;
  --muted: #8a7568;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(90deg, #fbf7ed 0, #fffdf8 9%, #fffdf8 91%, #fbf7ed 100%);
  color: var(--text);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.6;
}

.endo-top-page .layout_wrapper {
  width: 100%;
  max-width: none;
  background: transparent;
}

.endo-top-page .layout_header,
.endo-top-page .layout_footer {
  display: none;
}

.endo-top-page .layout_container {
  width: 100%;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ========== Top Alert ========== */
.top-alert {
  background: var(--wine-dark);
  color: #fff;
  text-align: center;
  font-size: 13px;
  letter-spacing: .04em;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top-alert a:hover { text-decoration: underline; }

/* ========== Header ========== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}

.header-inner {
  width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px minmax(540px, 1fr) 350px;
  align-items: center;
  gap: 20px;
  padding: 18px 0 12px;
}

.brand img {
  height: 70px;
  width: 230px;
  object-fit: contain;
  object-position: left center;
}

.header-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.header-benefits .benefit {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #6f5650;
  font-size: 12px;
  line-height: 1.35;
  min-width: 0;
}

.header-benefits .benefit span {
  display: block;
  min-width: 0;
}

.header-benefits img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 50%;
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.search {
  display: flex;
  border: 1px solid var(--line);
  height: 38px;
  background: #fff;
  min-width: 190px;
}

.search input {
  border: 0;
  padding: 0 10px;
  width: 150px;
  outline: 0;
  color: var(--text);
}

.search button {
  width: 36px;
  border: 0;
  background: #fff;
  color: var(--wine);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.tool {
  font-size: 12px;
  color: #5d4540;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  position: relative;
  white-space: nowrap;
}

.tool span { font-size: 19px; height: 20px; }

.tool.cart em {
  position: absolute;
  right: 2px;
  top: -8px;
  background: #9b101b;
  color: #fff;
  border-radius: 50%;
  font-style: normal;
  font-size: 10px;
  line-height: 16px;
  width: 16px;
  height: 16px;
  text-align: center;
}

.tool.cart em:empty { display: none; }

/* ========== Global Nav ========== */
.global-nav {
  border-top: 1px solid var(--line);
  width: 1180px;
  margin: 0 auto;
  height: 46px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: center;
  text-align: center;
}

.global-nav a {
  border-left: 1px solid #eee1cd;
  padding: 13px 4px;
  color: #3a2b26;
  font-size: 13px;
  font-weight: 600;
}

.global-nav a:last-child { border-right: 1px solid #eee1cd; }
.global-nav a:hover { background: #fbf3e6; color: var(--wine); }

/* ========== Page Shell (3-column layout) ========== */
.page-shell {
  width: 1180px;
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: 180px 1fr 145px;
  gap: 16px;
  align-items: start;
}

.left-sidebar, .right-sidebar { position: relative; }

/* ========== Left Sidebar ========== */
.side-free-shipping {
  height: 64px;
  background: linear-gradient(135deg, #681016, #8a1c20);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.side-free-shipping:before {
  content: "\25B0";
  font-size: 22px;
  position: absolute;
  margin-left: -120px;
}

.side-free-shipping span { font-size: 11px; }
.side-free-shipping strong { font-size: 21px; letter-spacing: .16em; }

.side-box {
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.side-box h2,
.right-ranking h2,
.side-banners h2 {
  margin: 0;
  background: var(--wine);
  color: #fff;
  font-size: 13px;
  padding: 8px 12px;
  letter-spacing: .03em;
}

.side-box ul {
  list-style: none;
  margin: 0;
  padding: 7px 10px;
}

.side-box li + li { border-top: 1px solid #f1e7d9; }

.side-box a {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  color: #4c3a35;
}

.side-box a:after { content: "\203A"; color: #9d7f52; }

.side-card {
  background: #fff;
  border: 1px solid var(--line);
  display: block;
  margin-bottom: 12px;
  padding: 10px;
  text-align: center;
  font-size: 12px;
}

.side-card img {
  height: 42px;
  width: 42px;
  object-fit: contain;
  margin: 0 auto 5px;
}

.side-card b {
  display: block;
  background: var(--wine);
  color: #fff;
  padding: 6px;
  margin-top: 8px;
}

.guide {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 8px;
  text-align: left;
  align-items: center;
}

.guide img { margin: 0; }

.vineyard {
  display: block;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0;
}

.vineyard img {
  height: 120px;
  width: 100%;
  object-fit: cover;
}

/* ========== Main Content ========== */
.content { min-width: 0; }

.hero-block { background: #fff; }

.hero {
  display: block;
  border: 1px solid var(--line);
}

.hero img {
  width: 100%;
  height: 270px;
  object-fit: cover;
  object-position: center;
}

.small-banners {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 16px;
}

.small-banners a {
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}

.small-banners img {
  height: 92px;
  width: 100%;
  object-fit: cover;
}

/* ========== Section Title ========== */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin: 0 0 8px;
}

.section-title h2 {
  margin: 0;
  color: #6c2f2b;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: .08em;
}

.section-title a {
  font-size: 12px;
  color: #755a4d;
  padding-top: 10px;
}

.section-title.center {
  justify-content: center;
  position: relative;
}

.section-title.center h2 {
  font-size: 22px;
  text-align: center;
  background: #fffdf8;
  padding: 0 18px;
}

.section-title.center a {
  position: absolute;
  right: 0;
  bottom: 4px;
}

/* ========== Tabs ========== */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 0;
  border-left: 1px solid var(--line);
}

.tabs button {
  background: #f8f0e3;
  border: 1px solid var(--line);
  border-left: 0;
  color: #7b6257;
  padding: 8px 0;
  font-size: 12px;
}

/* ========== Product Grid ========== */
.product-grid {
  display: grid;
  background: #fff;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.product-grid.five { grid-template-columns: repeat(5, 1fr); }
.product-grid.six { grid-template-columns: repeat(6, 1fr); }

.product-card {
  position: relative;
  text-align: center;
  min-width: 0;
  padding: 12px 10px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.product-card img {
  height: 158px;
  width: 100%;
  object-fit: contain;
  margin-bottom: 8px;
}

.product-card .product-link {
  color: inherit;
  display: block;
  text-decoration: none;
}

.product-card .product-link:hover h3 { color: var(--wine); }

.product-card h3 {
  font-size: 12px;
  line-height: 1.35;
  margin: 0 auto 4px;
  min-height: 34px;
  color: #49332d;
  font-weight: 600;
}

.product-card .price {
  margin: 0;
  color: #7a1116;
  font-size: 16px;
  font-weight: 700;
}

.product-card small { font-size: 10px; color: #7f6a61; }

.product-card .tag {
  display: inline-block;
  font-size: 10px;
  background: #f8ece8;
  color: #8b3a33;
  border: 1px solid #e4cec5;
  padding: 1px 5px;
  margin-top: 5px;
}

/* ========== Ranking Badges ========== */
.crown {
  position: absolute;
  top: 7px;
  left: 9px;
  color: #b68b39;
  font-size: 20px;
}

.crown.silver { color: #b6b2aa; }
.crown.bronze { color: #bd7544; }

.rank {
  position: absolute;
  top: 34px;
  right: 10px;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
}

.rank.red { background: #8d1618; }
.rank.green { background: #7f9a7b; }
.rank.gold { background: #a78a4a; border-radius: 12px; width: auto; padding: 0 6px; }

.label {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #9b171c;
  color: #fff;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 10px;
}

.label.gold { background: #b18a3a; }

.product-grid.compact .product-card img { height: 132px; }

/* ========== Feature Row ========== */
.feature-row {
  display: grid;
  gap: 8px;
  margin: 16px 0 18px;
}

.feature-row.three { grid-template-columns: repeat(3, 1fr); }
.feature-row.two { grid-template-columns: 1fr 1fr; }

.feature-row a {
  border: 1px solid var(--line);
  overflow: hidden;
  background: #fff;
}

.feature-row.three img { height: 105px; width: 100%; object-fit: cover; }
.feature-row.two img { height: 210px; width: 100%; object-fit: cover; }

/* ========== Wine Sets ========== */
.sets .section-title { margin-top: 20px; }
.set-grid .product-card img { height: 120px; }

.round {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #d7a94d;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1.2;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* ========== Food Pairing ========== */
.food-section { margin-top: 22px; }

.food-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.food-grid a {
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  padding-bottom: 8px;
}

.food-grid img { width: 100%; height: 100px; object-fit: cover; }
.food-grid strong { display: block; font-size: 13px; color: #6b2f2b; margin: 6px 2px 0; }
.food-grid span { font-size: 11px; color: #7f665b; }

/* ========== Info Grid ========== */
.info-grid {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.info-area,
.top-info,
.middle-info,
.bottom-info {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-area,
.bottom-info { margin-bottom: 18px; }

.info-card {
  background: #fffdf8;
  border: 1px solid var(--line);
  padding: 14px;
  min-height: 168px;
  position: relative;
  overflow: hidden;
}

.info-card h3 {
  margin: 0 0 7px;
  color: #6b2f2b;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: .03em;
}

.info-card h3 span { font-size: 10px; color: #917869; margin-left: 5px; }
.info-card p, .info-card li { font-size: 12px; line-height: 1.7; margin: 0 0 4px; color: #5b453d; }
.info-card ul { margin: 5px 0 0; padding-left: 15px; }

.info-card a {
  display: inline-block;
  background: var(--wine);
  color: #fff;
  font-size: 12px;
  padding: 5px 15px;
  margin-top: 8px;
  position: relative;
}

.top-info .media-card,
.info-area .media-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
}

.top-info .media-card img,
.info-area .media-card img { height: 124px; width: 96px; object-fit: cover; }

.middle-info .info-card.store,
.bottom-info .info-card,
.info-area .info-card.store,
.info-area .info-card.line,
.info-area .info-card.mail {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
}

.info-card.store img { height: 102px; width: 104px; object-fit: cover; }

.payment img {
  height: 34px;
  width: 100%;
  object-fit: contain;
  object-position: left center;
  margin: 8px 0 7px;
}

.faq p { border-bottom: 1px dotted #d9c9b5; padding: 4px 0; }

.line img, .mail img {
  height: 76px !important;
  width: 76px !important;
  object-fit: contain !important;
}

.bottom-info .info-card,
.info-area .line,
.info-area .mail {
  grid-template-columns: 86px minmax(0, 1fr);
}
.bottom-info .info-card h3,
.info-area .line h3,
.info-area .mail h3 { font-size: 16px; }
.bottom-info .info-card p, .bottom-info .info-card li,
.info-area .line p, .info-area .line li,
.info-area .mail p, .info-area .mail li { font-size: 12px; }
.bottom-info .mail-form,
.info-area .mail-form {
  width: 100%;
  max-width: 260px;
}

.mail-form {
  display: flex;
  margin-top: 10px;
  border: 1px solid var(--line);
  height: 36px;
  min-width: 0;
  background: #fff;
}

.mail-form input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 0 8px;
  background: #fff;
}

.mail-form button {
  flex: 0 0 82px;
  border: 0;
  background: var(--wine);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

/* ========== Right Sidebar ========== */
.right-note {
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
  margin-bottom: 12px;
  padding: 10px 7px;
}

.right-note h2 { font-size: 12px; color: #6a5149; margin: 0; }
.right-note p { color: #8a1116; font-size: 16px; margin: 4px 0 0; font-weight: 700; }

.right-ranking {
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.right-ranking ol {
  list-style: none;
  counter-reset: r;
  margin: 0;
  padding: 8px;
}

.right-ranking li {
  counter-increment: r;
  border-bottom: 1px solid #eee1d1;
  padding: 7px 0;
}

.right-ranking li a {
  display: grid;
  grid-template-columns: 24px 42px 1fr;
  gap: 5px;
  align-items: center;
}

.right-ranking li a:before {
  content: counter(r);
  background: #bd8f3a;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 11px;
}

.right-ranking img { height: 46px; width: 42px; object-fit: contain; }
.right-ranking span { font-size: 10px; line-height: 1.35; }
.right-ranking b { color: #7d1117; }
.right-ranking .more { display: block; text-align: center; font-size: 11px; padding: 7px; color: #6b2f2b; }

.side-banners {
  background: #fff;
  border: 1px solid var(--line);
  padding-bottom: 8px;
}

.side-banners a { display: block; margin: 8px; }
.side-banners img { width: 100%; height: 68px; object-fit: cover; border: 1px solid #eadfce; }
.side-banners a:last-child img { height: 135px; }

/* ========== Footer ========== */
.footer {
  background: linear-gradient(135deg, #331014, #43151a 50%, #2a0b0e);
  color: #f9efe6;
  margin-top: 0;
}

.footer-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 1.35fr) repeat(3, minmax(105px, .75fr)) minmax(210px, 1fr);
  gap: 26px;
  padding: 30px 24px 24px;
  box-sizing: border-box;
}

.footer-brand img {
  width: 230px;
  height: 76px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 8px;
}

.footer p, .footer a, .footer address {
  font-size: 12px;
  color: #f1dbd2;
  font-style: normal;
}

.footer address {
  align-self: stretch;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(30, 7, 10, .76);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 4px;
  padding: 14px 16px;
  line-height: 1.75;
}

.footer address p {
  margin: 0 0 12px;
  color: #f8e9dd;
}

.footer address p:last-child {
  margin-bottom: 0;
}

.sns { display: flex; gap: 12px; margin-top: 14px; }
.sns img { width: 26px; height: 26px; }

.footer h3 { font-size: 15px; margin: 0 0 8px; color: #fff; }
.footer-nav a { display: block; padding: 2px 0; }
.footer a:hover { text-decoration: underline; }

.copyright {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding: 12px 0 18px;
  font-size: 11px;
  color: #d7c5bf;
}

/* ========== Tablet (max-width: 1220px) ========== */
@media (max-width: 1220px) {
  .header-inner,
  .global-nav,
  .page-shell,
  .footer-inner {
    width: 96%;
  }

  .header-inner {
    grid-template-columns: 230px minmax(500px, 1fr) 325px;
    gap: 14px;
  }

  .page-shell {
    grid-template-columns: 165px 1fr 135px;
    gap: 12px;
  }

  .hero img { height: 260px; }
  .product-card img { height: 145px; }
  .product-grid.compact .product-card img { height: 124px; }
}

/* ========== Mobile Landscape (max-width: 900px) ========== */
@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brand img { margin: 0 auto; }
  .header-benefits { display: none; }

  .header-tools {
    justify-content: center;
    flex-wrap: wrap;
  }

  .global-nav {
    width: 100%;
    overflow: auto;
    display: flex;
  }

  .global-nav a { min-width: 130px; }

  .page-shell { grid-template-columns: 1fr; }
  .left-sidebar, .right-sidebar { display: none; }

  .hero img { height: 230px; }

  .small-banners,
  .feature-row.three,
  .feature-row.two,
  .top-info,
  .middle-info,
  .bottom-info {
    grid-template-columns: 1fr;
  }

  .product-grid.five,
  .product-grid.six {
    grid-template-columns: repeat(2, 1fr);
  }

  .food-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ========== Mobile Portrait (max-width: 520px) ========== */
@media (max-width: 520px) {
  .product-grid.five,
  .product-grid.six,
  .food-grid {
    grid-template-columns: 1fr;
  }

  .search { width: 100%; }

  .header-tools {
    display: grid;
    grid-template-columns: 1fr repeat(2, auto);
    gap: 8px;
  }

  .footer-inner { grid-template-columns: 1fr; }
  .hero img { height: 180px; }
  .feature-row.two img { height: 160px; }
  .small-banners img { height: 76px; }
}
