/**
 * Product Card - Frontend Display Styles
 * Full-width side-by-side layout: left 30% portrait / right 70% forced equal height
 */

/* ===== Card Container ===== */
.product-card-single {
    max-width: 860px;
    margin: 0 auto;
    padding: 30px 0;
}

.pc-card-wrapper {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 30px;
    position: relative;
    background: var(--main-bg-color, #fff);
    border-radius: 12px 12px 0 0;
    padding: 0;
}

/* ===== Full-width footer (score box, comments, etc.) ===== */
.pc-card-footer {
    background: var(--main-bg-color, #fff);
    border-radius: 0;
    padding: 20px 30px 24px;
    margin-top: 0;
}

/* Last footer gets the bottom rounded corners */
.product-card-single > .pc-card-footer:last-child {
    border-radius: 0 0 12px 12px;
}

/* ===== Left Bottle Image (9:20 portrait container) =====
   ::before padding creates aspect ratio, row height determined by it
   Image centered with contain, no crop or compression */
.pc-card-left {
    width: 100%;
    min-height: 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--muted-bg-color, #f5f5f5);
}

.pc-card-left::before {
    content: '';
    display: block;
    padding-bottom: 222.22%; /* 20/9 = 222.22% */
}

.pc-bottle-image {
    position: absolute;
    inset: 0;
}

.pc-card-left .pc-bottle-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Right Text Area (absolute anchor, forced equal height with left) ===== */
.pc-card-right {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: calc(30% + 30px); /* Column Width + gap */
    min-width: 0;
    overflow-y: auto;
    padding-right: 15px;
}

/* Variety Title */
.pc-card-wrapper .pc-variety-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--main-color, #333);
    margin: 0 0 5px 0;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

/* ===== General section ===== */
.pc-section {
    margin-top: 25px;
}

.pc-card-wrapper .pc-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted-2-color, #999);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #8B1A2B;
    display: inline-block;
}

/* ===== Aroma & Flavor Grid ===== */
.pc-flavors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.pc-flavor-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.pc-flavor-item:hover {
    background: var(--muted-bg-color, #f9f9f9);
}

.pc-flavor-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pc-flavor-icon svg {
    width: 100%;
    height: 100%;
}

.pc-flavor-emoji {
    font-size: 18px;
    line-height: 1;
}

.pc-flavor-name {
    font-size: 13px;
    color: var(--main-color, #555);
    line-height: 1.3;
    word-break: break-word;
}

/* ===== Taste Profile Progress Bar ===== */
.pc-profile-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pc-profile-bar-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pc-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pc-bar-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--main-color, #444);
}

.pc-bar-track {
    width: 100%;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
}

.pc-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B1A2B, #C41E3A);
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ===== List Summary ===== */
.pc-excerpt-variety {
    font-weight: 600;
    color: #8B1A2B;
}

/* ===== Responsive: maintain side-by-side layout across devices, reduce padding/gap/font size ===== */
@media (max-width: 768px) {
    .product-card-single {
        padding: 20px 0;
    }

    .pc-card-wrapper {
        gap: 15px;
        border-radius: 8px;
    }

    /* Right anchor position follows gap changes */
    .pc-card-right {
        left: calc(30% + 15px);
    }

    .pc-card-wrapper .pc-variety-title {
        font-size: 16px;
        margin-bottom: 3px;
        line-height: 1.2;
    }

    .pc-section {
        margin-top: 10px;
    }

    .pc-card-wrapper .pc-section-title {
        font-size: 12px;
        letter-spacing: 1px;
        margin-bottom: 4px;
        padding-bottom: 3px;
    }

    /* Aroma & Flavors: single row, emoji icons only */
    .pc-flavors-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
    }

    .pc-flavor-item {
        flex-shrink: 0;
        padding: 2px;
    }

    .pc-flavor-icon {
        width: 24px;
        height: 24px;
    }

    .pc-flavor-emoji {
        font-size: 18px;
    }

    .pc-flavor-name {
        display: none;
    }

    .pc-profile-bars {
        gap: 8px;
    }

    .pc-bar-name {
        font-size: 11px;
    }

    .pc-bar-track {
        height: 5px;
    }
}

@media (max-width: 480px) {
    .pc-card-wrapper {
        gap: 10px;
        border-radius: 0;
    }

    .pc-card-right {
        left: calc(30% + 10px);
    }

    .pc-card-wrapper .pc-variety-title {
        font-size: 14px;
    }

    .pc-section {
        margin-top: 8px;
    }

    .pc-card-wrapper .pc-section-title {
        font-size: 12px;
        letter-spacing: 0.5px;
        margin-bottom: 3px;
        padding-bottom: 2px;
    }

    .pc-flavors-grid {
        gap: 6px;
    }

    .pc-flavor-icon {
        width: 20px;
        height: 20px;
    }

    .pc-flavor-emoji {
        font-size: 15px;
    }

    .pc-profile-bars {
        gap: 6px;
    }

    .pc-bar-name {
        font-size: 10px;
    }

    .pc-bar-track {
        height: 4px;
    }
}

/* ===== Override theme image styles (scoped to Product Card only) ===== */
.product-card-single .wp-posts-content img,
.product-card-single img[class*="pc-"] {
    object-fit: cover;
}

/* ===== Score Box (Zibll 论坛评分集成) ===== */
.pc-card-footer .score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pc-card-footer .score-box .score-btns {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
}

.pc-card-footer .score-box .score-btns text {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--main-color, #333);
}

.pc-card-footer .score-box .btn-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all .2s ease;
    color: var(--muted-2-color, #999);
}

.pc-card-footer .score-box .btn-score svg {
    width: 18px;
    height: 18px;
}

.pc-card-footer .score-box .btn-score.extra:hover,
.pc-card-footer .score-box .btn-score.extra.active {
    color: #f44336;
    background: rgba(244,67,54,.08);
}

.pc-card-footer .score-box .btn-score.deduct:hover,
.pc-card-footer .score-box .btn-score.deduct.active {
    color: #2196F3;
    background: rgba(33,150,243,.08);
}

.pc-card-footer .score-box .score-box-detail {
    margin-top: 10px;
    text-align: center;
}

.pc-card-footer .score-box .score-box-detail .desc {
    font-size: 12px;
}

.pc-card-footer .score-box .score-users {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    justify-content: center;
}

.pc-card-footer .score-box .score-user-item {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: visible;
    flex-shrink: 0;
    position: relative;
}

.pc-card-footer .score-box .score-user-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Allow +1/-1 badge to overflow avatar container */
.pc-card-footer .score-box .score-user-item .avatar-icontag {
    z-index: 3;
    pointer-events: none;
}

/* ===== Info Footer (Serving Tips & Food Pairing) ===== */
.pc-card-footer--info {
    margin-top: -1px; /* collapse border gap between consecutive footers */
}

.pc-card-footer--info .pc-info-section + .pc-info-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--main-border-color, #e8e8e8);
}

.pc-card-footer--info .pc-info-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--main-color, #333);
    margin-bottom: 10px;
}

.pc-card-footer--info .pc-info-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted-3-color, #666);
    margin: 0;
}

/* Mobile tweak */
@media (max-width: 640px) {
    .pc-card-footer .score-box {
        margin-top: 16px;
        padding-top: 12px;
    }
    .pc-card-footer .score-box .btn-score {
        width: 28px;
        height: 28px;
    }
    .pc-card-footer .score-box .btn-score svg {
        width: 16px;
        height: 16px;
    }
}
