/**
 * assets/css/rental-product.css
 * レンタル商品詳細ページ専用スタイル
 * WooCommerceデフォルトCSSと共存するための追加スタイル
 *
 * 読み込み: functions-wc-rental.php の wp_enqueue_scripts で自動追加済み
 */

/* =========================================================
   WooCommerce デフォルト要素の上書き（最小限）
   ========================================================= */

/* WCが挿入するカート追加フォームを非表示（独自UIを使用） */
.woocommerce div.product form.cart,
.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product .product_meta,
.woocommerce div.product p.price,
.woocommerce div.product .woocommerce-product-gallery {
  display: none !important;
}

/* WCのsingle-product.phpを使う場合はページ全体のwrapを調整 */
.woocommerce #content div.product,
.woocommerce div.product,
.woocommerce-page div.product {
  margin: 0;
  padding: 0;
}

/* =========================================================
   商品動画表示の調整
   ========================================================= */

.rental-delivery-product .product-assets .video-card {
  padding: 0;
  min-height: 0;
  background: transparent;
  border-radius: 0;
}

.rental-delivery-product .product-assets .video-card .ratio {
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.rental-delivery-product .product-assets .video-card iframe,
.rental-delivery-product .product-assets .video-card video {
  border-radius: 0;
  background: transparent;
}

/* =========================================================
   規約・サインセクション
   ========================================================= */
.rental-conditions {
  margin-top: 24px;
  padding: 20px;
  background: #f8f8f8;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.rental-conditions h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.rental-conditions textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  resize: vertical;
  cursor: default;
}

.form-check {
  margin: 16px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check-input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4CAF50;
  flex-shrink: 0;
}

.form-check-label {
  font-size: 14px;
  cursor: pointer;
  color: #333;
}

/* 署名フィールド（チェック前は薄く表示） */
.signature {
  margin-top: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.signature--active {
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76,175,80,0.15);
}

.signature .rc-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #555;
}

.signature .rc-required {
  color: #e53e3e;
  margin-left: 4px;
}

.signature .form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 15px;
}

.signature .form-control:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76,175,80,0.15);
}

.signature span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #e53e3e;
}

/* =========================================================
   予約済み日グレーアウト
   ========================================================= */
.rc-calendar__cell--booked {
  opacity: .3 !important;
  text-decoration: line-through;
  pointer-events: none !important;
  cursor: not-allowed;
}

/* =========================================================
   お気に入りアクティブ状態
   ========================================================= */
.btn-fav--active svg path {
  fill: #DA4636;
}

/* =========================================================
   カートボタン disabled状態
   ========================================================= */
.btn-cart:disabled {
  opacity: .6;
  cursor: not-allowed;
  color: #fff;
}

/* =========================================================
   カートページ
   ========================================================= */
.cart-page { padding: 0 0 40px; }

.cart-subtotal-box {
  background: var(--color-background-secondary);
  border: 1px solid var(--color-border-tertiary);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-subtotal-box__inner { display: flex; flex-direction: column; gap: 4px; }
.cart-subtotal-box__amount { font-size: 15px; color: var(--color-text-primary); }
.cart-subtotal-box__amount strong { color: #e53e3e; font-size: 18px; }
.cart-subtotal-box__note { font-size: 13px; color: var(--color-text-secondary); }
.cart-subtotal-box__note--free { color: var(--color-text-success); font-weight: 500; }

.cart-item {
  background: var(--color-background-primary);
  border: 1px solid var(--color-border-tertiary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
}
.cart-item__type { margin-bottom: 12px; }
.cart-item__badge {
  display: inline-block;
  padding: 3px 10px;
  background: #e8f4eb;
  color: #2d6a35;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.cart-item__body { display: flex; gap: 12px; margin-bottom: 16px; }
.cart-item__img { width: 64px; height: 64px; flex-shrink: 0; }
.cart-item__img img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.cart-item__name { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.cart-item__unit { font-size: 13px; color: var(--color-text-secondary); }

.cart-item__detail { border-top: 1px solid var(--color-border-tertiary); padding-top: 12px; }
.cart-item__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border-tertiary);
}
.cart-item__row:last-of-type { border-bottom: none; }
.cart-item__row span:first-child { color: var(--color-text-secondary); }
.cart-item__row--total { font-weight: 500; }
.cart-item__total { color: #e53e3e; font-size: 16px; font-weight: 600; }
.cart-item__note { font-size: 12px; color: var(--color-text-tertiary); text-align: right; margin-top: 4px; }

.cart-item__qty-wrap { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--color-border-secondary);
  background: var(--color-background-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--color-text-primary);
}
.qty-val { min-width: 24px; text-align: center; font-size: 14px; }

.cart-item__remove {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: none;
  border: 1px solid var(--color-border-secondary);
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.cart-item__remove:hover { background: var(--color-background-danger); color: var(--color-text-danger); }

.cart-register {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-tertiary);
}
.cart-register__title { font-size: 16px; font-weight: 500; margin-bottom: 12px; }
.cart-register__note { font-size: 13px; color: var(--color-text-secondary); margin-top: 8px; }

.cart-back {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
}
.cart-back:hover { color: var(--color-text-primary); }

/* =========================================================
   チェックアウトページ
   ========================================================= */
.checkout-page { padding: 0 0 40px; }

.checkout-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 24px 0 32px;
}
.checkout-stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.checkout-stepper__dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--color-border-secondary);
  border: 2px solid var(--color-border-secondary);
}
.checkout-stepper__step--active .checkout-stepper__dot {
  background: #4CAF50;
  border-color: #4CAF50;
}
.checkout-stepper__label { font-size: 12px; color: var(--color-text-secondary); }
.checkout-stepper__step--active .checkout-stepper__label { color: #4CAF50; font-weight: 500; }
.checkout-stepper__line {
  width: 60px; height: 2px;
  background: var(--color-border-tertiary);
  margin-bottom: 18px;
}

.checkout-section {
  background: var(--color-background-primary);
  border: 1px solid var(--color-border-tertiary);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.checkout-section__title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-tertiary);
}

/* WC標準フォームのスタイル上書き */
.woocommerce-billing-fields .form-row,
.woocommerce-shipping-fields .form-row {
  margin-bottom: 16px;
}
.woocommerce-billing-fields label,
.woocommerce-shipping-fields label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  display: block;
}
.woocommerce-billing-fields input,
.woocommerce-shipping-fields input,
.woocommerce-billing-fields select,
.woocommerce-shipping-fields select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border-secondary);
  border-radius: 6px;
  font-size: 14px;
  background: var(--color-background-primary);
  color: var(--color-text-primary);
}

/* =========================================================
   ボタン共通
   ========================================================= */
.btn--full { width: 100%; text-align: center; }
.btn--lg { padding: 16px 24px; font-size: 16px; }


/* =============================================
   カートページ
   ============================================= */
.cart-page { padding: 0 0 40px; }

.cart-subtotal-box {
  display: flex; flex-direction: column; gap: 6px;
  background: #f8f8f5; border: 1px solid #e0e0e0;
  border-radius: 8px; padding: 16px 20px; margin-bottom: 16px;
}
.cart-subtotal-box__amount { font-size: 15px; }
.cart-subtotal-box__amount strong { color: #e53e3e; font-size: 18px; }
.cart-subtotal-box__note { font-size: 13px; color: #666; }
.cart-subtotal-box__note--free { color: #2d6a35; font-weight: 500; }

.cart-item {
  background: #fff; border: 1px solid #e0e0e0;
  border-radius: 12px; padding: 20px; margin-bottom: 16px; position: relative;
}
.cart-item__type { margin-bottom: 12px; }
.cart-item__badge {
  display: inline-block; padding: 3px 12px;
  background: #e8f4eb; color: #2d6a35;
  border-radius: 4px; font-size: 12px; font-weight: 500;
}
.cart-item__body { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.cart-item__img { width: 80px; height: 80px; flex-shrink: 0; }
.cart-item__img img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.cart-item__name { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.cart-item__unit { font-size: 13px; color: #666; }
.cart-item__detail { border-top: 1px solid #e8e8e8; padding-top: 12px; }
.cart-item__row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 14px; border-bottom: 1px solid #f0f0f0;
}
.cart-item__row:last-of-type { border-bottom: none; }
.cart-item__row > span:first-child { color: #666; min-width: 100px; }
.cart-item__row--total { font-weight: 500; padding-top: 12px; }
.cart-item__total { color: #e53e3e; font-size: 16px; font-weight: 600; }
.cart-item__note { font-size: 12px; color: #999; text-align: right; margin-top: 4px; }
.cart-item__qty-wrap { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 30px; height: 30px; border: 1px solid #ddd; background: #f5f5f5;
  border-radius: 4px; cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: #e8e8e8; }
.qty-val { min-width: 28px; text-align: center; font-size: 15px; font-weight: 500; }
.cart-item__remove {
  display: block; margin-top: 12px; background: none;
  border: 1px solid #ddd; border-radius: 4px; padding: 4px 14px;
  font-size: 12px; color: #999; cursor: pointer;
}
.cart-item__remove:hover { background: #fff0f0; color: #e53e3e; border-color: #e53e3e; }
.btn--full { width: 100%; }
.btn--lg { padding: 16px 24px; font-size: 16px; border-radius: 8px; }

/* =============================================
   チェックアウトページ（WC標準 + テーマデザイン上書き）
   ============================================= */

/* WCデフォルトのチェックアウトページでタイトル・日付を非表示 */
.woocommerce-checkout .entry-title,
.woocommerce-checkout .posted_on { display: none !important; }

/* WCフォームの見た目調整 */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout #order_review_heading {
  font-size: 18px; font-weight: 500;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid #e8e8e8;
}
.woocommerce-checkout form.checkout .form-row { margin-bottom: 16px; }
.woocommerce-checkout form.checkout label {
  font-size: 13px; font-weight: 500; color: #555; display: block; margin-bottom: 6px;
}
.woocommerce-checkout form.checkout input[type=text],
.woocommerce-checkout form.checkout input[type=email],
.woocommerce-checkout form.checkout input[type=tel],
.woocommerce-checkout form.checkout input[type=password],
.woocommerce-checkout form.checkout select,
.woocommerce-checkout form.checkout textarea {
  width: 100%; padding: 10px 14px; border: 1px solid #ddd;
  border-radius: 6px; font-size: 14px; box-sizing: border-box;
}
.woocommerce-checkout #payment {
  background: #f8f8f5; border-radius: 8px; padding: 20px;
}
.woocommerce-checkout #place_order {
  width: 100%; padding: 16px; font-size: 16px; font-weight: 500;
  background: #e53e3e; color: #fff; border: none; border-radius: 8px;
  cursor: pointer; margin-top: 16px;
}
.woocommerce-checkout #place_order:hover { background: #c53030; }

/* =============================================
   レンタル商品詳細 規約・サイン
   ============================================= */
.rental-conditions {
  margin-top: 24px; padding: 20px;
  background: #f8f8f5; border-radius: 8px; border: 1px solid #e0e0e0;
}
.rental-conditions h4 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.rental-conditions textarea {
  width: 100%; min-height: 120px; padding: 12px;
  border: 1px solid #ccc; border-radius: 4px;
  background: #fff; font-size: 14px; line-height: 1.6; resize: vertical; cursor: default;
}
.form-check { margin: 16px 0 12px; display: flex; align-items: center; gap: 8px; }
.form-check-input { width: 18px; height: 18px; cursor: pointer; accent-color: #4CAF50; flex-shrink: 0; }
.form-check-label { font-size: 14px; cursor: pointer; }
.signature {
  margin-top: 16px; padding: 16px;
  background: #fff; border: 1px solid #ddd; border-radius: 6px;
}
.signature--active { border-color: #4CAF50; box-shadow: 0 0 0 2px rgba(76,175,80,.15); }
.signature .rc-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.signature .rc-required { color: #e53e3e; margin-left: 4px; }
.signature .form-control:focus { outline: none; border-color: #4CAF50; }
.signature span { display: block; margin-top: 8px; font-size: 12px; color: #e53e3e; }

/* =============================================
   予約済み日グレーアウト
   ============================================= */
.rc-calendar__cell--booked {
  opacity: .3 !important; text-decoration: line-through;
  pointer-events: none !important; cursor: not-allowed;
}

/* =============================================
   お気に入りアクティブ
   ============================================= */
.btn-fav--active svg path { fill: #DA4636; }
.btn-cart:disabled { opacity: .6; cursor: not-allowed; }

/* =========================================================
   patch v14 – prefecture lead-time calendar lock
   ========================================================= */
.rc-calendar__cell--locked {
  opacity: .35;
  pointer-events: none !important;
  cursor: not-allowed;
}

.rc-calendar__cell--locked .rc-calendar__num,
.rc-calendar__cell--locked .rc-calendar__label {
  color: #9aa1a6 !important;
}

.rc-leadtime-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #3d5f51;
}


/* =========================================================
   patch v15 – lead-time lock visual polish
   ========================================================= */
.rc-calendar__cell--locked,
.rc-calendar__cell--booked {
  background: #f1f4f1;
}

.rc-leadtime-note {
  padding-left: 2px;
}
