/* Shared product grid cards (list + search pages) */
.pc-product-media {
    width: 100%;
    background: #f8f9fa;
}

.pc-product-media__cover {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-product-media__cover-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.35s ease;
}

.product-item:hover .pc-product-media__cover-img {
    transform: none;
}

.pc-product-media__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 2;
    max-width: calc(100% - 16px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-product-media__thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 6px 8px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}

.pc-product-media__thumb {
    flex: 0 0 auto;
    border-radius: 4px;
    overflow: hidden;
    background: #f3f4f6;
    cursor: pointer;
    box-sizing: border-box;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.pc-product-media__thumb.is-active {
    border-color: #9e6c15;
}

.pc-product-media__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pc-product-media--grid .pc-product-media__cover {
    height: 245px;
}

.pc-product-media--grid .pc-product-media__thumbs {
    gap: 6px;
    padding: 8px 10px;
}

.pc-product-media--grid .pc-product-media__thumb {
    width: calc((100% - 30px) / 6);
    max-width: 32px;
    height: 32px;
}

.pc-product-media--trending .pc-product-media__cover {
    height: 260px;
}

.pc-product-media--trending .pc-product-media__thumb {
    width: calc((100% - 25px) / 6);
    max-width: 28px;
    height: 28px;
}

/* legacy alias - keep badge positioning for old markup if any */
.product-item-no {
    position: absolute;
    top: 9px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 3;
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-list {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

/* 分类列表页布局 */
main.index .page-left {
    width: 285px;
    left: 5px;
}

main.index .page-right {
    width: calc(100% - 290px);
    max-width: none;
    margin-left: 290px;
    padding: 10px 48px 24px;
    box-sizing: border-box;
}

main.index .page-right .product-list {
    width: 96% !important;
    max-width: none !important;
    margin: 10px 0 0 !important;
    padding: 0 !important;
    gap: 14px;
}

@media (min-width: 769px) and (max-width: 1399px) {
    main.index .page-right .product-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1400px) {
    main.index .page-right .product-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.product-item {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.product-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.product-item-info {
    padding: 12px 14px 14px;
}

.info-item-title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.info-item-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #333;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 0;
    font-weight: 600;
}

.info-item-promo-tag {
    flex-shrink: 0;
    margin-top: 1px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #ff2d55 0%, #ff0033 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    border-radius: 6px;
    white-space: nowrap;
}

.info-item-no {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    margin: 0 0 4px;
    line-height: 1.35;
}

.info-item-mater {
    font-size: 12px;
    color: #9e6c15;
    font-weight: 500;
    margin: 0 0 10px;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 12px;
    line-height: 1.3;
}

.price-current {
    font-size: 20px;
    font-weight: 700;
    color: #9e6c15;
}

.price-original {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    text-decoration: line-through;
}

.info-item-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-to-cart-btn {
    flex: 1;
    min-height: 42px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #9e6c15 0%, #d4af37 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(158, 108, 21, 0.4);
}

.btn-favorite {
    width: 42px;
    height: 42px;
    padding: 0;
    background: #fff;
    border: 1.5px solid #e8e0d0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #b8a88a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-favorite:hover {
    background: #fffaf3;
    border-color: #d4af37;
    color: #9e6c15;
    transform: translateY(-1px);
}

.btn-favorite.active {
    background: linear-gradient(135deg, #fff8f0 0%, #fdebd0 100%);
    border-color: #9e6c15;
    color: #9e6c15;
    box-shadow: 0 2px 8px rgba(158, 108, 21, 0.18);
}

.btn-favorite.active svg,
.btn-favorite.active .favorite-icon {
    fill: #9e6c15;
    stroke: #9e6c15;
}

.btn-favorite svg {
    width: 20px;
    height: 20px;
    transition: all 0.25s ease;
}

@media (max-width: 768px) {
    .product-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 8px;
    }

    .product-item {
        width: 100%;
        margin-top: 0;
        padding-bottom: 12px;
        box-shadow: 0 4px 16px rgba(106, 72, 31, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
        border: 1px solid rgba(106, 72, 31, 0.06);
        touch-action: manipulation;
    }

    .product-item:active {
        transform: scale(0.97);
        box-shadow: 0 2px 8px rgba(106, 72, 31, 0.12);
    }

    .add-to-cart-btn {
        width: 32px;
        height: 32px;
        padding: 0;
        border-radius: 50%;
        flex: 0 0 32px;
        box-shadow: 0 2px 8px rgba(255, 146, 51, 0.4);
    }

    .add-to-cart-btn svg {
        width: 18px;
        height: 18px;
    }

    .add-to-cart-btn .btn-label {
        display: none;
    }
}
