/**
 * 产品卡片基础样式 (Product Card Base CSS)
 * 
 * 包含产品卡片的所有基础样式：
 * - 产品图片容器和悬停切换
 * - 操作按钮（心愿单、购物车）
 * - 产品信息布局
 * - 价格显示
 * - 品牌信息
 * - 变体圆圈
 * - 动态宽度控制
 * 
 * 被 product-list-main.css 自动包含
 * 
 * @package Leahz
 * @version 3.0.0
 */

/* ==========================================================================
   产品卡片基础结构 (Product Card Base)
   ========================================================================== */

/* 产品卡片容器 - 宽度由外部CSS变量控制 */
.leahz-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: none;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    
    /* 宽度由外部通过CSS变量控制 */
    width: var(--card-width, 300px);
    min-width: var(--card-min-width, 300px);
    max-width: var(--card-max-width, none);
    
    /* 在flex布局中的行为 */
    flex: 0 0 var(--card-width, 300px);
    
    /* 基础样式 */
    box-sizing: border-box;
    margin-bottom: 20px;
}

/* ==========================================================================
   产品图片区域 (Product Images)
   ========================================================================== */

/* 产品图片容器 */
.leahz-product-card__image-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 比例 */
    overflow: hidden;
    background-color: #f8f8f8;
}

/* 产品图片基础样式 */
.leahz-product-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* 第一张图片（默认显示） */
.leahz-product-card__image--first {
    opacity: 1;
    z-index: 1;
}

/* 第二张图片（悬停显示） */
.leahz-product-card__image--second {
    opacity: 0;
    z-index: 2;
}

/* 悬停时切换图片 */
.leahz-product-card:hover .leahz-product-card__image--first {
    opacity: 0;
}

.leahz-product-card:hover .leahz-product-card__image--second {
    opacity: 1;
}

/* ==========================================================================
   操作按钮区域 (Action Buttons)
   ========================================================================== */

/* 操作按钮容器 - 匹配首页样式 */
.leahz-product-card__actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 5;
}

/* 悬停时显示操作按钮 */
.leahz-product-card:hover .leahz-product-card__actions {
    opacity: 1;
    visibility: visible;
}

/* 操作按钮基础样式 - 匹配首页样式 */
.leahz-product-card__action-btn {
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 3px;
}

.leahz-product-card__action-btn:hover {
    background: #fff;
}

.leahz-product-card__action-btn svg {
    width: 11px;
    height: 11px;
    fill: none;
    stroke: #555;
    stroke-width: 2;
}

/* 心愿单按钮特殊样式 */
.leahz-product-card__wishlist-btn:hover svg {
    stroke: #e91e63;
    fill: rgba(233, 30, 99, 0.1);
}

/* 购物车按钮特殊样式 */
.leahz-product-card__cart-btn:hover svg {
    stroke: #4caf50;
}

/* 缺货图标样式 */
.leahz-product-card__out-of-stock-icon svg {
    stroke: #999;
}

/* ==========================================================================
   产品信息区域 (Product Info)
   ========================================================================== */

/* 产品信息容器 */
.leahz-product-card__info {
    padding: 15px 0 0 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* 产品详情容器 */
.leahz-product-card__details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 产品信息行 */
.leahz-product-card__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

/* 产品标题 */
.leahz-product-card__title {
    font-size: 11px;
    font-weight: 400;
    margin: 0;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-decoration: none;
}

/* 产品链接样式 */
.leahz-product-card__link {
    text-decoration: none;
    color: inherit;
}

.leahz-product-card__link:hover .leahz-product-card__title {
    color: #333;
}

/* ==========================================================================
   价格显示 (Price Display)
   ========================================================================== */

/* 价格容器 */
.leahz-product-card__price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* 当前价格（粗体） */
.leahz-product-card__price--current {
    font-size: 11px;
    font-weight: 600;
    color: #333;
}

/* 原价（不粗体，删除线） */
.leahz-product-card__price--original {
    font-size: 10px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
}

/* ==========================================================================
   变体显示 (Variants Display)
   ========================================================================== */

/* 变体容器 */
.leahz-product-card__variants {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* 变体圆圈基础样式 */
.leahz-product-card__variant {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 银色变体 */
.leahz-product-card__variant--silver {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 50%, #d1d1d1 100%);
    border-color: #ccc;
}

/* 金色变体 */
.leahz-product-card__variant--gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #f7c52d 100%);
    border-color: #e6c200;
}

/* 变体悬停效果 */
.leahz-product-card__variant:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 选中状态 */
.leahz-product-card__variant--selected {
    border: 1px solid #000;
    box-shadow: 0 0 0 1px #000;
}

/* ==========================================================================
   品牌信息 (Brand Info)
   ========================================================================== */

/* 品牌信息容器 */
.leahz-product-card__brand {
    font-size: 10px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* 品牌前缀 */
.leahz-product-card__brand-prefix {
    font-weight: 400;
}

/* 品牌名称（斜体） */
.leahz-product-card__brand em {
    font-style: italic;
    font-weight: 400;
}

/* ==========================================================================
   响应式设计 (Responsive Design)
   ========================================================================== */

/* 平板设备 */
@media (max-width: 768px) {
    .leahz-product-card__actions {
        top: 8px;
        right: 8px;
        gap: 6px;
    }
    
    .leahz-product-card__action-btn {
        width: 20px;
        height: 20px;
    }

    .leahz-product-card__action-btn svg {
        width: 10px;
        height: 10px;
    }
    
    .leahz-product-card__info {
        padding: 12px 0 0 0;
    }
    
    .leahz-product-card__details {
        gap: 6px;
    }
}

/* 小屏幕设备 */
@media (max-width: 480px) {
    .leahz-product-card__actions {
        top: 6px;
        right: 6px;
        gap: 4px;
    }
    
    .leahz-product-card__action-btn {
        width: 18px;
        height: 18px;
    }

    .leahz-product-card__action-btn svg {
        width: 9px;
        height: 9px;
    }
    
    .leahz-product-card__info {
        padding: 10px 0 0 0;
    }
    
    .leahz-product-card__title {
        font-size: 10px;
    }
    
    .leahz-product-card__price--current {
        font-size: 10px;
    }
    
    .leahz-product-card__price--original {
        font-size: 9px;
    }
    
    .leahz-product-card__brand {
        font-size: 9px;
    }
}
