* { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: sans-serif; }

/* 電腦大螢幕 */
@media screen and (min-width: 1025px) {
  .container, main, section { max-width: 1200px; margin: 0 auto; }
  nav ul { display: flex; }
}

/* 平板 */
@media screen and (max-width: 1024px) and (min-width: 769px) {
  body { font-size: 16px; }
  img { max-width: 100%; height: auto; }
}

/* 手機 */
@media (max-width: 768px) {
  /* 1. 公司名一行顯示 */
  .logo {
    flex-direction: row !important;       /* 強制水平 */
    flex-wrap: nowrap;                    /* 絕不換行 */
    align-items: center;
  }
  
  .logo span {
    font-size: 1rem;                      /* 縮小字體 */
    white-space: nowrap;                  /* 強制不換行 */
    padding-left: 0.3rem;
  }
  
  .logo img {
    height: 40px !important;              /* 更小 logo */
    flex-shrink: 0;                       /* logo 不壓縮 */
  }

  /* 2. 所有圖片置中 */
  .product-hero-image,
  .product-gallery {
    display: block !important;
    margin: 0 auto !important;            /* 水平置中 */
    text-align: center;
  }
  
  .product-hero-image img,
  .product-gallery img {
    margin: 0 auto;                       /* 圖片置中 */
    display: block;
  }

  /* 3. 橫圖完整顯示（不裁切） */
  .product-hero-image img,
  .product-gallery img {
    height: auto !important;              /* 自動高度 */
    width: 100%;                          /* 全寬 */
    max-width: 100%;                      /* 不超出 */
    object-fit: contain !important;       /* 完整顯示，空白留邊 */
    object-position: center;              /* 置中對齊 */
  }
}


@media (max-width: 768px) {
  nav > div {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  nav a {
    margin: 0 0.5rem 0 0 !important;      /* 水平間距 */
    font-size: 0.9rem;
  }
}


.product-gallery {
  display: flex;              /* 水平排列 */
  flex-direction: row;        /* 由左至右 */
  flex-wrap: wrap;            /* 自動換行 */
  gap: 16px;                  /* 圖片間距，取代 margin */
  justify-content: flex-start; /* 左對齊 */
  align-items: flex-start;    /* 上對齊 */
}

.product-gallery img {
  height: 480px;              /* 固定高度 */
  object-fit: cover;          /* 保持比例 */
  flex: 1 1 300px;            /* 彈性寬度，最小 300px */
  min-width: 250px;           /* 手機不壓縮過小 */
  margin: 0;                  /* 移除舊 margin */
}
