/* 
 * SUZURI Store Plugin CSS
 * Cocoonテーマ対応スタイル
 */

/* 基本グリッドレイアウト */
.suzuri-products-grid {
    display: grid;
    gap: 24px;
    margin: 32px 0;
    padding: 0;
    list-style: none;
}

.suzuri-grid-columns-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.suzuri-grid-columns-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.suzuri-grid-columns-4 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* 商品アイテム */
.suzuri-product-item {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

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

/* Cocoonテーマのダークモード対応 */
body.dark-theme .suzuri-product-item {
    background: #2c2c2c;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

body.dark-theme .suzuri-product-item:hover {
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
}

/* 商品画像 */
.suzuri-product-image {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background: #f8f9fa;
}

.suzuri-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* 商品コンテンツ */
.suzuri-product-content {
    padding: 20px;
}

.suzuri-product-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 12px 0;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark-theme .suzuri-product-title {
    color: #ecf0f1;
}

.suzuri-product-description {
    font-size: 14px;
    line-height: 1.5;
    color: #6c757d;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark-theme .suzuri-product-description {
    color: #bdc3c7;
}

.suzuri-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #e74c3c;
    margin: 0 0 16px 0;
}

body.dark-theme .suzuri-product-price {
    color: #e67e22;
}

/* 購入ボタン */
.suzuri-buy-button {
    display: inline-block;
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white !important;
    text-decoration: none !important;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.suzuri-buy-button:hover {
    background: linear-gradient(135deg, #2980b9, #1f639a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    color: white !important;
    text-decoration: none !important;
}

.suzuri-buy-button:active {
    transform: translateY(0);
}

/* 単一商品表示 */
.suzuri-single-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 32px 0;
    align-items: start;
}

.suzuri-product-image-large {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
}

.suzuri-product-image-large img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suzuri-product-details {
    padding: 20px 0;
}

.suzuri-product-details .suzuri-product-title {
    font-size: 28px;
    margin-bottom: 20px;
}

.suzuri-product-details .suzuri-product-description {
    font-size: 16px;
    -webkit-line-clamp: unset;
    margin-bottom: 24px;
}

.suzuri-product-price-large {
    font-size: 24px;
    font-weight: 700;
    color: #e74c3c;
    margin: 0 0 24px 0;
}

body.dark-theme .suzuri-product-price-large {
    color: #e67e22;
}

.suzuri-buy-button-large {
    width: auto;
    padding: 16px 32px;
    font-size: 16px;
    display: inline-block;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .suzuri-products-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 16px;
        margin: 24px 0;
    }
    
    .suzuri-product-content {
        padding: 16px;
    }
    
    .suzuri-product-title {
        font-size: 14px;
    }
    
    .suzuri-product-description {
        font-size: 13px;
    }
    
    .suzuri-product-price {
        font-size: 16px;
    }
    
    .suzuri-buy-button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .suzuri-single-product {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .suzuri-product-details .suzuri-product-title {
        font-size: 24px;
    }
    
    .suzuri-product-details .suzuri-product-description {
        font-size: 15px;
    }
    
    .suzuri-product-price-large {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .suzuri-products-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
        margin: 20px 0;
    }
    
    .suzuri-product-content {
        padding: 12px;
    }
    
    .suzuri-product-title {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .suzuri-product-description {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .suzuri-product-price {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .suzuri-buy-button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Cocoonテーマ特有のスタイル調整 */
.suzuri-products-grid .suzuri-product-item {
    box-sizing: border-box;
}

/* Cocoonのカードデザインとの統一 */
.skin-cocoon .suzuri-product-item {
    border: 1px solid #e9ecef;
}

body.dark-theme.skin-cocoon .suzuri-product-item {
    border: 1px solid #495057;
}

/* ローディングアニメーション */
.suzuri-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.suzuri-loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: suzuri-spin 1s linear infinite;
}

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

/* エラーメッセージ */
.suzuri-error {
    background: #f8d7da;
    color: #721c24;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

body.dark-theme .suzuri-error {
    background: #722f37;
    color: #f1b2ba;
}

/* カテゴリフィルター */
.suzuri-category-filter {
    margin: 20px 0;
    text-align: center;
}

.suzuri-category-filter button {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 16px;
    margin: 0 4px 8px 4px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suzuri-category-filter button:hover,
.suzuri-category-filter button.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

body.dark-theme .suzuri-category-filter button {
    background: #495057;
    border-color: #6c757d;
    color: #adb5bd;
}

body.dark-theme .suzuri-category-filter button:hover,
body.dark-theme .suzuri-category-filter button.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* ページネーション */
.suzuri-pagination {
    display: flex;
    justify-content: center;
    margin: 40px 0;
    gap: 8px;
}

.suzuri-pagination button {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suzuri-pagination button:hover,
.suzuri-pagination button.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.suzuri-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.dark-theme .suzuri-pagination button {
    background: #495057;
    border-color: #6c757d;
    color: #adb5bd;
}

body.dark-theme .suzuri-pagination button:hover,
body.dark-theme .suzuri-pagination button.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* AMP対応 */
@media (prefers-reduced-motion: reduce) {
    .suzuri-product-item,
    .suzuri-product-image img,
    .suzuri-buy-button {
        transition: none;
    }
    
    .suzuri-product-item:hover {
        transform: none;
    }
    
    .suzuri-product-item:hover .suzuri-product-image img {
        transform: none;
    }
}

/* 印刷用スタイル */
@media print {
    .suzuri-buy-button {
        display: none;
    }
    
    .suzuri-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .suzuri-product-item {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}