/* Affiliate Shop - Grid Styles */

.affiliate-shop-grid {
    display: grid;
    gap: 24px;
    margin: 24px 0;
}

.affiliate-shop-grid.columns-1 {
    grid-template-columns: 1fr;
}

.affiliate-shop-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.affiliate-shop-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.affiliate-shop-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.affiliate-shop-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.affiliate-shop-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

.affiliate-shop-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.affiliate-shop-content {
    padding: 15px;
}

.affiliate-shop-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.affiliate-shop-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.affiliate-shop-price {
    margin: 0 0 15px 0;
    font-weight: 600;
}

.affiliate-shop-price .sale-price {
    color: #e74c3c;
    font-size: 16px;
    margin-right: 8px;
}

.affiliate-shop-price .regular-price {
    color: #999;
    text-decoration: line-through;
    font-size: 14px;
}

.affiliate-shop-price .price {
    color: #333;
    font-size: 16px;
}

.affiliate-shop-button {
    text-align: center;
}

.affiliate-shop-btn {
    display: inline-block;
    background: #007cba;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.affiliate-shop-btn:hover {
    background: #005a87;
    color: #fff;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .affiliate-shop-grid.columns-3,
    .affiliate-shop-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .affiliate-shop-content {
        padding: 12px;
    }
    
    .affiliate-shop-title {
        font-size: 14px;
    }
    
    .affiliate-shop-description {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .affiliate-shop-grid.affiliate-shop-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .affiliate-shop-content {
        padding: 12px !important;
    }
    
    .affiliate-shop-title {
        font-size: 14px !important;
    }
    
    .affiliate-shop-description {
        font-size: 13px !important;
    }
    
    .affiliate-shop-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
}

/* 额外的手机端样式确保生效 */
@media screen and (max-width: 480px) {
    body .affiliate-shop-grid.affiliate-shop-grid.affiliate-shop-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}

/* Widget Styles */
.affiliate-shop-widget {
    margin: 0;
}

.affiliate-shop-widget-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.affiliate-shop-widget-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget-product-image {
    flex-shrink: 0;
    margin-right: 12px;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
}

.widget-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.widget-product-content {
    flex: 1;
    min-width: 0;
}

.widget-product-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px 0;
    line-height: 1.3;
    color: #333;
}

.widget-product-description {
    font-size: 12px;
    color: #666;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.widget-product-price {
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.widget-product-price .sale-price {
    color: #e74c3c;
    margin-right: 5px;
}

.widget-product-price .regular-price {
    color: #999;
    text-decoration: line-through;
}

.widget-btn {
    display: inline-block;
    background: #007cba;
    color: #fff;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.widget-btn:hover {
    background: #005a87;
    color: #fff;
    text-decoration: none;
}

/* 强制手机端两列显示 - 最高优先级 */
@media only screen and (max-width: 480px) {
    .affiliate-shop-grid,
    div.affiliate-shop-grid,
    .affiliate-shop-grid.columns-1,
    .affiliate-shop-grid.columns-2,
    .affiliate-shop-grid.columns-3,
    .affiliate-shop-grid.columns-4 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}

/* 针对可能的主题覆盖 */
@media (max-width: 480px) {
    html body .affiliate-shop-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}