/**
 * 買取カゴ CSS - リニューアルサイト用
 * 
 * 仕様書なし・画像のみから推測実装
 * 2025/07/01 作成
 */

/* ===========================================
   モーダル基本スタイル
=========================================== */
.kaitori-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kaitori-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.kaitori-modal-content {
    position: relative;
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===========================================
   モーダルヘッダー
=========================================== */
.kaitori-modal-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.kaitori-modal-header h2 {
    color: white;
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.kaitori-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.kaitori-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ===========================================
   モーダルボディ
=========================================== */
.kaitori-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.05);
}

.empty-cart {
    text-align: center;
    color: white;
    font-size: 18px;
    padding: 40px 20px;
}

/* ===========================================
   カゴアイテム
=========================================== */
.cart-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.cart-item:hover {
    transform: translateY(-2px);
}

.cart-item-main {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.cart-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.3;
}

.cart-item-jan {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-family: monospace;
}

.cart-item-quantity {
    flex-shrink: 0;
    margin-right: 10px;
}

.cart-item-quantity select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
}

.cart-item-details {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
}

/* ===========================================
   コントロール部分
=========================================== */
.cart-item-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.state-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.state-control label {
    font-weight: bold;
    color: #333;
    min-width: 40px;
}

.state-control select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
}

/* ===========================================
   条件選択
=========================================== */
.condition-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.condition-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.condition-group > label {
    font-weight: bold;
    color: #333;
    min-width: 60px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    text-align: center;
}

.condition-group:nth-child(1) > label {
    background: #fff59d;
    color: #f57f17;
}

.condition-group:nth-child(2) > label {
    background: #fff59d;
    color: #f57f17;
}

.condition-group:nth-child(3) > label {
    background: #fff59d;
    color: #f57f17;
}

.condition-options {
    display: flex;
    gap: 10px;
}

.condition-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 15px;
    background: white;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.condition-options label:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.condition-options input[type="radio"] {
    margin: 0;
}

.condition-options input[type="radio"]:checked + label,
.condition-options label:has(input[type="radio"]:checked) {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
}

/* ===========================================
   備考欄
=========================================== */
.memo-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.memo-group label {
    font-weight: bold;
    color: #333;
}

.memo-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    min-height: 60px;
    font-size: 14px;
    font-family: inherit;
}

.memo-group textarea::placeholder {
    color: #999;
}

/* ===========================================
   アクション部分
=========================================== */
.cart-item-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.remove-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.remove-btn:hover {
    background: #d32f2f;
}

.cart-item-toggle {
    flex-shrink: 0;
}

.toggle-btn {
    background: #2196f3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.toggle-btn:hover {
    background: #1976d2;
}

/* ===========================================
   合計表示
=========================================== */
.kaitori-total-count {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
    border: 2px solid #ff5722;
}

.kaitori-total-count strong {
    font-size: 18px;
    color: #d84315;
}

/* ===========================================
   モーダルフッター
=========================================== */
.kaitori-modal-footer {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.kaitori-submit-btn {
    width: 100%;
    background: linear-gradient(45deg, #ffeb3b, #ffc107);
    color: #333;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.kaitori-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.6);
}

/* ===========================================
   ヘッダーカゴアイコン
=========================================== */
.cart-header-icon {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* ===========================================
   通知
=========================================== */
.kaitori-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
}

.kaitori-notification.show {
    transform: translateX(0);
}

.notification-content {
    background: #4caf50;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 300px;
}

.notification-content button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.notification-content button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===========================================
   買取カゴボタン
=========================================== */
.kaitori-add-btn {
    background: linear-gradient(45deg, #ff5722, #ff3d00);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(255, 87, 34, 0.3);
}

.kaitori-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.5);
}

/* ===========================================
   レスポンシブ対応
=========================================== */
@media (max-width: 768px) {
    .kaitori-modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 15px;
    }
    
    .kaitori-modal-header {
        padding: 15px;
    }
    
    .kaitori-modal-header h2 {
        font-size: 20px;
    }
    
    .kaitori-modal-body {
        padding: 15px;
        max-height: 70vh;
    }
    
    .cart-item {
        padding: 15px;
    }
    
    .cart-item-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
        align-self: flex-start;
    }
    
    .cart-item-info {
        width: 100%;
    }
    
    .cart-item-quantity,
    .cart-item-actions,
    .cart-item-toggle {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .condition-controls {
        padding: 10px;
    }
    
    .condition-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .condition-group > label {
        min-width: auto;
    }
    
    .condition-options {
        width: 100%;
        justify-content: space-around;
    }
    
    .condition-options label {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    
    .kaitori-notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }
    
    .notification-content {
        max-width: none;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cart-item-controls {
        gap: 10px;
    }
    
    .memo-group textarea {
        min-height: 50px;
        font-size: 13px;
    }
    
    .kaitori-submit-btn {
        font-size: 16px;
        padding: 12px;
    }
    
    .cart-item-name {
        font-size: 14px;
    }
    
    .cart-item-jan {
        font-size: 11px;
    }
}

/* ===========================================
   印刷用スタイル
=========================================== */
@media print {
    .kaitori-modal {
        position: static;
        width: auto;
        height: auto;
    }
    
    .kaitori-modal-overlay {
        display: none;
    }
    
    .kaitori-modal-content {
        background: white;
        box-shadow: none;
        max-width: none;
        width: 100%;
    }
    
    .kaitori-modal-header,
    .kaitori-modal-footer {
        background: white;
        border: none;
    }
    
    .kaitori-modal-close,
    .remove-btn,
    .kaitori-submit-btn {
        display: none;
    }
}