/* PC Layout */
@media screen and (min-width: 768px) {

  /* list-view-rightに合わせて絶対配置するための設定 */
  .list-view .list-view-right {
    position: relative;
  }

  .list-view .festaBannerWrap {
    display: flex !important;
    justify-content: flex-start !important;
    margin-top: 0;
    width: 100%;
  }

  .list-view .festaBannerWrap picture,
  .list-view .festaBannerWrap img {
    margin: 0 !important;
  }

  .list-view-container.has-banner .list-view-left {
    padding-top: 35px;
  }

  /* SP-only arrow should be hidden on PC */
  .go-detail-arrow-sp {
    display: none !important;
  }
}

@media screen and (max-width: 767px) {
  .festaBannerWrap {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    position: relative;
  }

  .festaBannerWrap.width-100 {
    width: 100%;
  }

  .list-view .festaBannerWrap {
    margin-bottom: 8px;
  }

  .festaBannerWrap picture {
    width: calc(50% - 4px) !important;
    margin: 0 !important;
    position: relative;
  }

  .festaBannerWrap::after {
    content: "";
    display: block;
    width: calc(100% - 8.1px);
    height: 1px;
    background-color: #EF6D00;
    position: absolute;
    bottom: -1px;
    left: 0;
  }

  .festaBannerWrap picture img {
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
  }
}

li.shopListType.list-view {
  position: relative;
  padding-top: 30px;
  padding-bottom: 30px;
  border: none !important;
  border-bottom: 1px solid #C2C2C2 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  cursor: pointer;
}

.list-view {
  display: block;
  width: 100%;
  margin-bottom: 20px;
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

.list-view .list-view-container {
  display: flex;
  flex-direction: row;
  background: #fff;
  border-radius: 6px;
  padding-right: 54px;
  /* Space for arrow */
  position: relative;
  gap: 24px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.list-view .list-view-container:hover {
  opacity: 0.9;
}

.list-view .list-view-left {
  width: 340px;
  /* Slightly narrower to give more space to text */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-view .list-view-left .shopImg {
  width: 100%;
  height: 255px;
  /* Adjusted height */
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.list-view .list-view-left .shopImg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.list-view .list-view-left .cs-pro-badge {
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
}

.list-view .list-view-left .cs-pro-badge img {
  width: 100%;
}

.list-view .list-view-left .iconList {
  width: 337.5px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-left: 2.5px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.list-view .list-view-left .iconGeneral {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  width: auto !important;
  /* Force auto width */
}



.list-view .list-view-left .iconOthers {
  justify-content: flex-end;
}

.list-view .list-view-left .iconGeneral li {
  width: auto !important;
  height: auto !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
}

.list-view .list-view-left .iconGeneral li img {
  height: 30px;
  width: auto;
}





.list-view .list-view-right {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  margin-bottom: 8px;
  gap: 20px;
}

.list-view .shop-header {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.list-view .shopSubName {
  font-family: 'Noto Sans', sans-serif !important;
  font-style: normal;
  font-weight: 700 !important;
  font-size: 16px !important;
  line-height: 22px !important;
  color: #333 !important;
  display: block;
}

.list-view .shopMainName {
  height: auto;
  font-family: 'Noto Sans', sans-serif !important;
  font-style: normal;
  font-weight: 700 !important;
  font-size: 24px !important;
  line-height: 33px !important;
  color: #333 !important;
  display: inline-block;
}

.list-view .shopMainNameLink {
  position: relative;
  z-index: 2;
  color: inherit;
  text-decoration: none;
}

.list-view .shopMainNameLink:hover {
  text-decoration: underline;
}

.list-view .shop-stats {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  padding: 0px !important;
  gap: 11px !important;
  height: 19.13px !important;
  font-family: 'Noto Sans', sans-serif !important;
  font-style: normal;
  font-weight: 700 !important;
  font-size: 14px !important;
  line-height: 19px !important;
  color: #333333 !important;
}



.list-view .shopcs {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 0px !important;
  gap: 11px !important;
  margin-top: 0 !important;
  height: 19.13px !important;
}

.list-view .list-view-right .shopcsStar {
  display: flex !important;
  align-items: center;
  position: static !important;
  bottom: auto !important;
  margin-right: 0 !important;
  height: auto !important;
}

.list-view .shopcsStar img {
  width: 20.72px !important;
  height: 19.13px !important;
  margin-right: 1px;
}

.list-view .review-count {
  text-decoration: none;
  color: inherit !important;
  /* Inherit styles */
}

.list-view .shop-details {
  font-family: 'Noto Sans', sans-serif !important;
  font-size: 14px !important;
  color: #333 !important;
  line-height: 18px !important;
  font-style: normal;
  font-weight: 400 !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-view .detail-row {
  display: flex;
  align-items: center;
  flex-direction: row;
}

.list-view .shopAddress {
  display: flex;
  align-items: center;
}

.list-view .map-icon {
  width: 12px;
  margin-right: 6px;
  vertical-align: middle;
  margin-right: 6px;
  vertical-align: middle;
  padding: 0;
}

.list-view .tel-icon {
  width: 14px;
  height: 14px;
  margin-right: 5px;
}

.list-view .icon-clock {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  margin-right: 6px;
  vertical-align: middle;
  align-self: flex-start;
}

.list-view .area-label {
  font-weight: bold;
  margin-right: 10px;
  white-space: nowrap;
}

.list-view .clamp-text-1 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
}

.list-view .shop-actions {
  display: flex;
  gap: 15px;
  margin-top: auto;
  width: 100%;
}

.list-view .auto-quote-btn,
.list-view .inquiry-btn {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex !important;
  justify-content: center;
  align-items: center;
  height: 44px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 15px !important;
  color: #fff !important;
  text-decoration: none;
  position: relative;
  line-height: 1;
  transition: opacity 0.2s;
  box-shadow: none !important;
  margin: 0 !important;
  width: 100% !important;
}

.list-view .auto-quote-btn:hover,
.list-view .inquiry-btn:hover {
  opacity: 0.8;
}

.list-view .auto-quote-btn {
  background-color: #EF6D00;
  border: none;
}

.list-view .disable-color {
  background-color: #ccc !important;
  cursor: not-allowed;
}

.list-view .inquiry-btn {
  background-color: #6CAF4F;
  border: none;
}

.list-view .calculator-icon,
.list-view .mail-icon {
  margin-left: 8px;
  height: 16px;
  width: auto;
}

.list-view .go-detail-arrow {
  position: absolute;
  z-index: 2;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background-color: #EF6D00;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.list-view .go-detail-arrow:hover {
  background-color: #d95e00;
}

/* SP Layout */
@media screen and (max-width: 767px) {
  .list-view .list-view-container {
    display: none !important;
  }

  .list-view .list-view-sp-container {
    display: block !important;
    background: #fff;
    padding-right: 16px;
    margin-left: 16px;
    position: relative;
    cursor: pointer;
    border: none;
    box-shadow: none;
    padding-bottom: 32px;
    border-bottom: none;
  }

  .list-view .list-view-sp-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -30px;
    width: 100vw;
    border-bottom: 1px solid #C2C2C2;
  }

  .list-view .shopOutline {
    display: flex;
    flex-direction: row;
    gap: 3px;
    position: relative;
  }

  /* New Left Column */
  #mainArea article .list-view .shopBlock-sp .shopOutline .shop-left-column-sp {
    width: 31.3vw !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
    gap: 16px !important;
    position: relative;
  }

  #mainArea article .list-view .shopBlock-sp .shopOutline .shop-left-column-sp::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #EF6D00;
  }

  /* Override global margin on shopOutline children */
  #mainArea article .list-view .shopBlock-sp .shopOutline>div {
    margin: 0 !important;
  }

  /* Shop Image becomes full width of the left column */
  #mainArea article .list-view .shopBlock-sp .shopOutline .shopImg {
    width: 100% !important;
    height: 23.475vw !important;
    aspect-ratio: 4/3 !important;
    margin: 0 !important;
    position: relative;
    text-align: left !important;
    display: block !important;
    padding-top: 0 !important;
  }

  /* ... Icon styles ... */

  /* Icon List Styles */
  .shopBlock-sp .iconList-sp {
    width: 100%;
  }

  .shopBlock-sp .icon-subsidy-sp {
    width: 100%;
    margin-bottom: 4px;
  }

  /* 123px at 393px = 31.3vw (Full Width of Column) */
  .shopBlock-sp .icon-subsidy-sp img {
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    object-fit: contain;
    display: block;
  }

  .shopBlock-sp .iconList-sp .iconGeneral {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0;
    margin: 0;
    justify-content: flex-start;
    /* Stack from left */
  }

  .shopBlock-sp .iconList-sp .iconGeneral .icon-item {
    width: auto;
    /* Allow auto width based on height */
    margin: 0;
  }

  /* 24.75px at 393px = ~6.3vw */
  .shopBlock-sp .iconList-sp .iconGeneral .icon-item img {
    width: 6.3vw !important;
    height: auto !important;
    display: block;
  }

  #mainArea article .list-view .shopBlock-sp .shopOutline .shopImg img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 4px !important;
    margin: 0 !important;
    max-width: none !important;
    min-width: 0 !important;
    object-fit: contain !important;
  }

  .shopBlock-sp .cs-pro-badge-sp {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
  }

  .shopBlock-sp .cs-pro-badge-sp img {
    width: 100%;
  }

  /* Override global margin for shop info specifically */
  #mainArea article .list-view .shopBlock-sp .shopOutline .sp-shop-info {
    margin-left: 10px !important;
  }

  .shopBlock-sp .sp-shop-info {
    flex-grow: 1;
    width: 65%;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .shopBlock-sp .shop-header-sp .shopSubName {
    font-size: 12px !important;
    margin-bottom: 0;
  }

  .shopBlock-sp .shop-header-sp .shopMainName {
    font-size: 14px !important;
    font-weight: bold !important;
    line-height: 1.3 !important;
  }

  .shopBlock-sp .shop-stats-sp {
    font-size: 12px;
    margin-bottom: 8px;
    color: #666;
  }

  /* Overwrite global/other CSS margin */
  #mainArea article .list-view .shopBlock-sp .shopOutline .sp-shop-info .construction-count {
    margin-right: 0 !important;
  }

  #mainArea article .list-view .shopBlock-sp .shopOutline .sp-shop-info .shopcsScore {
    font-family: 'Inter', sans-serif !important;
    font-style: normal;
    font-weight: 700 !important;
    font-size: 12px !important;
    line-height: 15px !important;
    color: #333333 !important;
  }

  /* Use Flexbox for container, Block for rows as requested */
  .shopBlock-sp .stats-group-sp {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    margin-top: 0 !important;
  }

  .shopBlock-sp .stats-group-sp .construction-count {
    font-family: 'Inter', sans-serif !important;
    font-style: normal;
    font-weight: 700 !important;
    font-size: 12px !important;
    line-height: 15px !important;
    color: #333333 !important;
    margin-right: 0 !important;
    /* Explicitly ensure 0 as per previous task */
  }

  .shopBlock-sp .shop-details-sp {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    font-size: 12px;
    line-height: 1.5;
    color: #333;
  }

  .shopBlock-sp .shop-details-sp .detail-row {
    display: block !important;
    gap: 0 !important;
    margin: 0 !important;
    font-size: 14px;
  }

  /* Prevent wrapping in shop stats */
  #mainArea article .list-view .shopBlock-sp .shopOutline .sp-shop-info .shopcs {
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  #mainArea article .list-view .shopBlock-sp .shopOutline .sp-shop-info .shopcsStar {
    margin-right: 0 !important;
  }

  /* 16.25px width, 15px height at 393px = 4.13vw, 3.82vw */
  /* High specificity to ensure override */
  #mainArea article .list-view .shopBlock-sp .shopOutline .sp-shop-info .shopcsStar img {
    width: 4.13vw !important;
    height: 3.82vw !important;
  }

  .shopBlock-sp .shop-details-sp .map-icon,
  .shopBlock-sp .shop-details-sp .icon-clock,
  .shopBlock-sp .shop-details-sp .tel-icon {
    margin-right: 8px !important;
    vertical-align: middle;
    margin-top: 1px;
  }

  .shopBlock-sp .shop-details-sp .icon-clock {
    width: 14px;
    height: 14px;
    margin-top: 4px;
  }

  .shopBlock-sp .shop-details-sp .tel-icon {
    margin-top: -1px;
  }

  .shopBlock-sp .shop-details-sp .detail-row {
    margin-bottom: 2px;
  }

  .shopBlock-sp .clamp-text-1 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
  }

  .shopBlock-sp .shop-details-sp .shopAddress,
  .shopBlock-sp .shop-details-sp .shopTime {
    font-size: 14px;
    margin: 0 !important;
    display: flex;
    align-items: flex-start;
  }

  /* Target Parent specifically for width */
  .shopBlock-sp .shop-details-sp div.shopAddress,
  .shopBlock-sp .shop-details-sp div.shopTime {
    width: 45.5vw;
  }

  /* p tag inherits margin:0 from .shopAddress class */
  .shopBlock-sp .shop-details-sp .shopAddress p,
  .shopBlock-sp .shop-details-sp .shopTime p {
    margin: 0 !important;
    flex: 1;
    min-width: 0;
    word-break: break-all;
  }

  .shopBlock-sp .clamp-text-2,
  .shopBlock-sp .shop-details-sp .shopAddress .clamp-text-2,
  .shopBlock-sp .shop-details-sp .shopTime .clamp-text-2 {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }

  .shopBlock-sp .area-row {
    display: flex !important;
    flex-direction: column !important;
    margin-top: 22px !important;
    gap: 4px !important;
    align-items: flex-start;
  }

  .shopListType .go-detail-arrow-sp {
    position: absolute;
    z-index: 2;
    right: 0;
    top: 45%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-color: #EF6D00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
  }

  .shopBlock-sp .iconList-sp .iconGeneral {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .shopBlock-sp .iconList-sp .iconGeneral li {
    width: auto !important;
    height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
  }

  .shopBlock-sp .iconList-sp .iconGeneral li img {
    height: 100%;
    width: auto;
  }

  .shopBlock-sp .shop-actions-sp {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    width: 100%;
  }

  /* Specific fix for SP buttons in list view */
  .shopBlock-sp .shop-actions-sp .auto-quote-btn,
  .shopBlock-sp .shop-actions-sp .inquiry-btn {
    position: relative;
    z-index: 2;
    height: 40px;
    font-size: 13px !important;
    width: auto !important;
    /* Flex grow to fill space */
    flex: 1;
    margin: 0 !important;
  }

  /* Remove styling from the wrapper li on SP */
  li.shopListType.list-view {
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    padding: 0 !important;
  }
}

@media print,
screen and (min-width: 768px) {
  .list-view .list-view-sp-container {
    display: none !important;
  }
}

/* Phone number underline (List View Only) */
a.detail-text[href^="tel"],
.detail-row a[href^="tel"] {
  text-decoration: underline !important;
}
