/* Global Styles */
:root {
  --joshin-red: #da291c;
  --joshin-yellow: #ffcc00;
  --joshin-dark: #333;
  --text-color: #333;
  --bg-color: #f5f5f5;
  --card-bg: #fff;
  --border-color: #e0e0e0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
}

/* ===== Header ===== */
.site-header {
  background: #fff;
  border-bottom: 2px solid var(--joshin-red);
}

.header-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.joshin-logo {
  font-size: 1.8rem;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  color: var(--joshin-red);
  letter-spacing: -0.02em;
}

.magokoro-logo {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--joshin-red);
  display: flex;
  align-items: center;
  gap: 4px;
}

.heart-icon {
  font-size: 1.2rem;
}

.header-utils {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.8rem;
}

.header-utils a {
  color: #333;
  text-decoration: none;
  font-weight: bold;
}

/* Toilet specific tags */
.product-desc-tag {
  font-size: 0.75rem;
  color: #666;
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 6px;
}

.header-utils a:hover {
  text-decoration: underline;
}

.reserve-btn {
  border: 1px solid #ccc;
  padding: 6px 12px;
  border-radius: 4px;
  background: #fdfdfd;
}

.reserve-btn:hover {
  background: #f0f0f0;
  text-decoration: none !important;
}

/* ===== Hero Banner ===== */
.hero-banner {
  background: linear-gradient(135deg, #fff 0%, #fef3e8 100%);
  padding: 30px 20px;
  text-align: center;
  border-bottom: 3px solid var(--joshin-red);
}

.hero-inner h1 {
  font-size: 1.6rem;
  color: var(--joshin-red);
  margin-bottom: 4px;
}

.hero-inner p {
  font-size: 0.85rem;
  color: #888;
}

/* ===== Global Navigation ===== */
.global-nav {
  background: var(--joshin-red);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.gnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-start;
}

.gnav-item {
  color: #fff;
  text-decoration: none;
  padding: 14px 24px;
  font-size: 0.9rem;
  font-weight: bold;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gnav-item:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.gnav-item:hover {
  background: rgba(0, 0, 0, 0.15);
}

.gnav-item.active {
  background: #b71c1c;
  /* darker red for active state */
}

.consult-btn {
  background: #fff;
  color: var(--joshin-red);
  margin-left: auto;
  /* Push to the right */
  border: none;
  font-size: 0.95rem;
  padding: 14px 30px;
}

.consult-btn:hover {
  background: #f0f0f0;
  color: var(--joshin-red);
}

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== Filter Section ===== */
.filter-section {
  background: #fff;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.filter-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-weight: bold;
  font-size: 0.85rem;
  color: #555;
  white-space: nowrap;
}

.filter-group select,
.filter-group input[type="text"] {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  background-color: #fff;
}

.filter-group select:hover,
.filter-group input[type="text"]:focus {
  border-color: #aaa;
  outline: none;
}

.filter-group input[type="text"] {
  width: 160px;
}

.filter-result-count {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
  color: #888;
}

/* ===== Maker Sections ===== */


/* ===== Product Grid ===== */
#product-grid {
  display: grid;
  gap: 15px 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.product-maker {
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  background: var(--joshin-red);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
}

/* ===== Product Card ===== */
.product-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s ease-in-out;
  position: relative;
}

.product-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

/* Image Wrapper */
.product-image-wrapper {
  display: block;
  position: relative;
}

.product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: #eee;
}

/* Rating Badge */
.rating-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255, 255, 255, 0.92);
  padding: 2px 6px;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--text-color);
}

.rating-badge .star {
  color: var(--joshin-yellow);
  font-size: 0.85rem;
}

/* Info Summary */
.product-info-summary {
  padding: 8px 10px 10px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.title-bullet {
  color: var(--joshin-red);
  margin-right: 3px;
  font-size: 0.7rem;
}

.product-name {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 8px;
  font-weight: bold;
}

.product-link {
  color: #333;
  text-decoration: none;
  transition: color 0.2s;
}

.product-link::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.product-link:hover {
  color: var(--joshin-red);
  text-decoration: underline;
}

/* ===== Prices ===== */
.product-prices {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding-bottom: 3px;
  border-bottom: 1px dotted #ddd;
}

.price-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.price-label {
  color: #444;
}

.price-value {
  font-weight: bold;
  color: #d32f2f;
  font-size: 0.9rem;
}

/* ===== Price Table ===== */
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin-top: 5px;
  table-layout: auto;
}

.price-table th {
  color: #666;
  font-weight: normal;
  text-align: right;
  padding: 2px 2px 4px;
  white-space: nowrap;
  font-size: 0.7rem;
}

.price-table td {
  text-align: right;
  padding: 4px 2px;
  border-top: 1px dotted #ddd;
}

.price-table td:first-child {
  text-align: left;
  width: 65px;
  white-space: nowrap;
}

.price-table td.price-value {
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
}

/* ===== Price Tags ===== */
.tag-house {
  display: inline-block;
  background-color: #e65100;
  color: white;
  font-size: 0.6rem;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

.tag-mansion {
  display: inline-block;
  background-color: #0066cc;
  color: white;
  font-size: 0.6rem;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 40px;
  background: #fff;
  border-top: 1px solid #ddd;
}

.footer-nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 0;
  border-bottom: 1px solid #eee;
}

.footer-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 25px;
  text-decoration: none;
  color: #555;
  font-size: 0.75rem;
  transition: color 0.2s;
}

.footer-nav-item:hover {
  color: var(--joshin-red);
}

.footer-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.footer-bottom {
  text-align: center;
  padding: 15px;
  background: var(--joshin-dark);
  color: #fff;
  font-size: 0.8rem;
}

/* ===== Responsive Design (Mobile) ===== */
@media (max-width: 768px) {
  
  .header-utils {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }

  /* Horizontal scrollable navigation */
  .gnav-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .gnav-item {
    white-space: nowrap;
    padding: 12px 18px;
    font-size: 0.85rem;
  }

  .consult-btn {
    padding: 12px 20px;
    margin-left: 0;
  }

  .hero-banner {
    padding: 80px 15px 20px;
  }

  .hero-inner h1 {
    font-size: 1.3rem;
  }

  /* Stack filter items */
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .filter-group {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 4px;
  }

  .filter-group input[type="text"],
  .filter-group select {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    /* Prevent zoom on iOS */
  }

  /* Single column product grid */
  #product-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* 2x2 Footer Navigation */
  .footer-nav {
    flex-wrap: wrap;
  }

  .footer-nav-item {
    width: 50%;
    box-sizing: border-box;
    padding: 12px;
    border-bottom: 1px solid #eee;
  }

  .footer-nav-item:nth-child(odd) {
    border-right: 1px solid #eee;
  }
}