/**
 * カスタム商品リスト用CSS
 * チケット販売サイト向けスタイル
 */

/* ========== 基本レイアウト ========== */

.custom-product-list-wrapper {
    margin: 0;
    font-family: inherit;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}
.custom-product-list-wrapper ul{
	padding: 0;
}

.custom-product-list {
    list-style: none;
    margin: 0;
    padding: 0;
    /* 外枠を削除 */
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    width: 100%;
    max-width: 100%;

}

.custom-product-item {
    border-bottom: 1px solid #ddd;
    padding: 15px 2em;
    transition: background-color 0.2s ease;
    position: relative;
    margin-bottom: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
	align-items: flex-start;
}

.custom-product-item:last-child {
    border-bottom: none;
}

.custom-product-item:hover {
    background-color: #f8f9fa;
}

/* ========== 商品ヘッダー ========== */

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 0;
}

.product-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
    min-width: 200px;
}

.product-price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: #e47911;
    white-space: nowrap;
}

.product-price .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
}

/* ========== 在庫情報 ========== */
/* 在庫情報は非表示（要望により削除）
.stock-info {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: normal;
}

.stock-info.low-stock {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}
*/

/* ========== 商品説明 ========== */

.product-description {
    margin: 10px 15px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007cba;
}

.product-description p {
    margin: 0 0 8px 0;
}

.product-description p:last-child {
    margin-bottom: 0;
}

/* ========== カート追加エリア ========== */

.product-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 15px;
}

/* ========== ボタンスタイル ========== */

.custom-add-to-cart-button,
.sold-out-button {
    padding: 20px 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 120px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* カート追加ボタン（通常状態） */
.custom-add-to-cart-button {
/*     background-color: #007cba; */
    color: white;
/*     border: 2px solid #007cba; */
}

.custom-add-to-cart-button:hover:not(:disabled) {
    background-color: #005a87;
    border-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,124,186,0.3);
}

.custom-add-to-cart-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,124,186,0.3);
}

/* カート数量表示スタイル */
.custom-add-to-cart-button.has-quantity {
    background-color: #28a745;
    border-color: #28a745;
}

.custom-add-to-cart-button.has-quantity:hover:not(:disabled) {
    background-color: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40,167,69,0.3);
}

/* 追加時のアニメーション */
.custom-add-to-cart-button.added-animation {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    transform: scale(1.05);
    transition: all 0.3s ease;
}

/* メッセージ表示アニメーション */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 処理中状態 */
.custom-add-to-cart-button:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
	padding: 20px 10px;
}

/* 売り切れボタン */
.sold-out-button {
    background-color: #6c757d;
    color: white;
    border: 2px solid #6c757d;
    cursor: not-allowed;
    opacity: 0.8;
}

/* ========== ローディングスピナー ========== */

.loading-spinner {
    display: none;
    font-size: 13px;
    color: white;
}

.loading-spinner::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 5px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== 商品カウント表示 ========== */

.product-count {
    font-size: 12px;
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: none;
}

/* ========== メッセージ表示 ========== */

.custom-message {
    margin: 15px 0;
    padding: 12px 15px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.custom-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.custom-message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ========== 商品なし表示 ========== */

.no-products {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    font-size: 16px;
}
/* ========== 商品補足 ========== */
.custom-product-list .product-header{
  display:flex; align-items:flex-start; justify-content:space-between; gap:1rem;
}
.custom-product-list .product-header__main{ flex:1 1 auto; min-width:0; }
.custom-product-list .product-header__price{ flex:0 0 auto; }

/* 補足の見た目 */
.custom-product-list .product-note{
  margin:0 0 .25rem; line-height:1.4; color:#333;padding: 0;font-weight: 600;
}
.custom-product-list .product-note--top{ font-size:.8125rem; }     /* 小さめ */
.custom-product-list .product-title{ font-size:1rem; font-weight:700; margin:0 0 .25rem; }
.custom-product-list .product-note--bottom{ font-size:.875rem; color:#333; }

/* 価格 */
.custom-product-list .product-header__price .product-price{ display:inline-block; }

/* スマホでは価格を下に回す */
@media (max-width: 767px){
  .custom-product-list .product-header{ flex-direction:column; }
  .custom-product-list .product-header__price{ margin-top:.25rem; }
}

/* ========== レスポンシブ対応 ========== */

@media (max-width: 768px) {
    .custom-product-item {
        padding: 12px 2em;
        margin-bottom: 0;
    }
    
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 0 ;
    }
    
    .product-price-wrapper {
        align-items: flex-start;
        width: 100%;
    }
    
    .product-title {
        font-size: 15px;
        min-width: auto;
    }
    
    .product-add-to-cart {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 0 12px;
    }
    
    .custom-add-to-cart-button,
    .sold-out-button {
        width: 100%;
/*         min-width: auto; */
    }
    
    .product-description {
        margin: 8px 12px;
        padding: 8px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .custom-product-list-wrapper {
    }
    
    .custom-product-list {
        border-radius: 0;
    }
	
    
    .custom-product-item {
        padding: 10px 2em;
    }
    
    .product-header {
        padding: 0px;
    }
    
    .product-add-to-cart {
        padding: 0 10px;
		padding-right: 0;
    }
    
    .product-description {
        margin: 8px 10px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 16px;
    }
}

/* ========== 印刷用スタイル ========== */

@media print {
    .custom-add-to-cart-button,
    .sold-out-button,
    .custom-message {
        display: none !important;
    }
    
    .custom-product-list {
        box-shadow: none;
        border: none;
    }
    
    .custom-product-item {
        break-inside: avoid;
        border-bottom: 1px solid #000;
        box-shadow: none;
        background: transparent;
    }
    
    .product-title {
        font-weight: bold;
    }
    
    .product-price {
        color: #000;
    }
}

/* ========== アクセシビリティ対応 ========== */

.custom-add-to-cart-button:focus,
.sold-out-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* ハイコントラストモード対応 */
@media (prefers-contrast: high) {
    .custom-product-list {
        border-color: #000;
    }
    
    .custom-product-item {
        border-bottom-color: #000;
    }
    
    .custom-add-to-cart-button {
        border-width: 3px;
    }
}