/**
 * フロントエンドスタイル
 *
 * @package Offering
 */

/* 商品一覧コンテナ */
.offering-products-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* カテゴリーセクション */
.offering-category-section {
    margin-bottom: 60px;
}

.offering-category-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.offering-category-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* 商品グリッド */
.offering-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

/* 商品アイテム */
.offering-product-item {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.offering-product-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.offering-product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.offering-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.offering-product-item:hover .offering-product-image img {
    transform: scale(1.05);
}

.offering-product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.offering-product-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.offering-product-price {
    font-size: 16px;
    color: #666;
    margin-bottom: 16px;
    flex-grow: 1;
}

.offering-product-price .price-amount {
    font-size: 20px;
    font-weight: 700;
    color: #d32f2f;
    margin-left: 8px;
}

/* カート追加ボタン */
.offering-add-to-cart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.offering-add-to-cart-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.offering-add-to-cart-btn:active {
    transform: translateY(0);
}

.offering-add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ショッピングカートウィジェット */
.offering-cart-widget {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 40px;
    position: sticky;
    top: 20px;
    z-index: 100;
    scroll-margin-top: 20px;
}

/* カートへスクロールボタン */
.offering-scroll-to-cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

.offering-scroll-to-cart-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.offering-scroll-to-cart-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.offering-scroll-to-cart-btn:active {
    transform: translateY(0);
}

.offering-scroll-to-cart-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cart-btn-text {
    white-space: nowrap;
}

/* レスポンシブ - カートスクロールボタン */
@media (max-width: 768px) {
    .offering-scroll-to-cart-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .offering-scroll-to-cart-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .cart-btn-text {
        display: none;
    }
}

.offering-cart-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}

.offering-cart-count {
    font-size: 16px;
    font-weight: 400;
    color: #666;
}

.cart-item-count {
    font-weight: 600;
    color: #667eea;
}

.offering-cart-content {
    min-height: 100px;
}

.offering-cart-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    margin: 0;
}

/* カートアイテム */
.offering-cart-items {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.offering-cart-item {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.offering-cart-item:last-child {
    border-bottom: none;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-quantity {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    min-width: 50px;
    text-align: center;
}

.cart-item-price {
    font-size: 16px;
    font-weight: 600;
    color: #d32f2f;
    white-space: nowrap;
    min-width: 100px;
    text-align: right;
}

.offering-remove-from-cart-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.offering-remove-from-cart-btn:hover {
    background: #ffebee;
    color: #d32f2f;
    border-color: #d32f2f;
}

/* カートフッター */
.offering-cart-footer {
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.offering-cart-subtotal {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: right;
    margin-bottom: 16px;
}

.cart-total-amount {
    font-size: 24px;
    color: #d32f2f;
    margin-left: 8px;
}

.offering-checkout-btn {
    width: 100%;
    background: #d32f2f;
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.offering-checkout-btn:hover:not(:disabled) {
    background: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
}

.offering-checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .offering-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .offering-category-title {
        font-size: 24px;
    }
    
    .offering-product-image {
        height: 200px;
    }
    
    .offering-cart-item {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 10px 12px;
    }
    
    .cart-item-name {
        flex: 1;
        min-width: 0;
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .cart-item-quantity {
        font-size: 12px;
        min-width: 40px;
    }
    
    .cart-item-price {
        font-size: 14px;
        min-width: 80px;
    }
    
    .offering-remove-from-cart-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
}

/* ローディングアニメーション */
.offering-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.offering-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: offering-spin 0.6s linear infinite;
}

@keyframes offering-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 成功メッセージ */
.offering-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.offering-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
    display: block;
}

.offering-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
    display: block;
}

/* 注文画面 */
.offering-checkout-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.offering-checkout-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.offering-checkout-empty {
    text-align: center;
    padding: 60px 20px;
}

.offering-checkout-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.offering-checkout-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* 注文アイテム */
.offering-order-items {
    margin-bottom: 30px;
}

.offering-order-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.offering-order-item:last-child {
    margin-bottom: 0;
}

.order-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.order-item-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.order-item-info {
    display: flex;
    gap: 16px;
    align-items: center;
}

.order-item-quantity {
    font-size: 14px;
    color: #666;
}

.order-item-price {
    font-size: 18px;
    font-weight: 600;
    color: #d32f2f;
}

/* 名札名入力 */
.order-item-nameplates {
    margin-top: 16px;
}

.order-item-nameplate {
    margin-bottom: 20px;
}

.order-item-nameplate:last-child {
    margin-bottom: 0;
}

.nameplate-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.required-mark {
    color: #d32f2f;
    margin-left: 4px;
}

.nameplate-input {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
    box-sizing: border-box !important;
}

.nameplate-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.nameplate-input.error {
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* お届け先情報・ご依頼主様セクション */
.offering-delivery-section,
.offering-client-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.section-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.form-field {
    margin-bottom: 20px;
}

.form-field:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-input {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    box-sizing: border-box !important;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.form-input-small {
    width: 80px !important;
    max-width: 80px !important;
    flex-shrink: 0;
    box-sizing: border-box !important;
}

.form-prefix {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.form-suffix {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.form-separator {
    font-size: 14px;
    color: #666;
}

/* 確認画面の情報表示 */
.confirm-info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.confirm-info-row:last-child {
    border-bottom: none;
}

.confirm-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 150px;
    flex-shrink: 0;
}

.confirm-value {
    font-size: 14px;
    color: #666;
    flex: 1;
}

.nameplate-description {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

/* 確認画面 */
.offering-confirm-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.confirm-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    padding: 16px;
    background: #f0f7ff;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.order-item-nameplates-confirm {
    margin-top: 16px;
}

.order-item-nameplate-confirm {
    margin-bottom: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.order-item-nameplate-confirm:last-child {
    margin-bottom: 0;
}

.order-item-nameplate-confirm .nameplate-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: block;
}

.order-item-nameplate-confirm .nameplate-content {
    font-size: 14px;
    color: #333;
    line-height: 2rem;
    white-space: normal;
    word-break: break-word;
    text-align: left;
}

.offering-confirm-form {
    margin-top: 30px;
}

/* 注文サマリー */
.offering-order-summary {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 16px;
}

.order-summary-row.order-total {
    font-size: 20px;
    font-weight: 600;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid #333;
}

.summary-label {
    color: #666;
}

.summary-value {
    color: #333;
    font-weight: 600;
}

.order-total .summary-value {
    color: #d32f2f;
    font-size: 24px;
}

/* 税込表記のスタイル */
.tax-label {
    font-weight: normal;
    color: #333;
}

/* 注文アクション */
.offering-checkout-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 30px;
}

.offering-back-to-cart-btn,
.offering-back-to-checkout-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.offering-back-to-cart-btn:hover,
.offering-back-to-checkout-btn:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.offering-submit-order-btn {
    background: #d32f2f;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.offering-submit-order-btn:hover:not(:disabled) {
    background: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
}

.offering-submit-order-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* レスポンシブ - 注文画面 */
@media (max-width: 768px) {
    .offering-checkout-form {
        padding: 20px;
    }
    
    .order-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .order-item-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .offering-checkout-actions {
        flex-direction: column;
    }
    
    .offering-back-to-cart-btn,
    .offering-submit-order-btn {
        width: 100%;
    }
}

/* 注文受付完了画面 */
.offering-completion-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px 20px;
}

.offering-completion-content {
    text-align: center;
    background: #fff;
    padding: 60px 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.completion-icon {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.completion-icon svg {
    animation: checkmark 0.6s ease-in-out;
}

@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.completion-title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.completion-message {
    font-size: 18px;
    line-height: 1.8;
    color: #666;
    margin-bottom: 40px;
}

.completion-actions {
    margin-top: 40px;
}

.offering-back-to-top-btn {
    display: inline-block;
    padding: 15px 40px;
    background-color: #4CAF50;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.offering-back-to-top-btn:hover {
    background-color: #45a049;
}

/* レスポンシブ - 完了画面 */
@media (max-width: 768px) {
    .offering-completion-container {
        margin: 40px auto;
        padding: 20px 10px;
    }
    
    .offering-completion-content {
        padding: 40px 20px;
    }
    
    .completion-title {
        font-size: 24px;
    }
    
    .completion-message {
        font-size: 16px;
    }
    
    .offering-back-to-top-btn {
        width: 100%;
        padding: 12px 20px;
    }
}
