/* ==========================================================================
   Product Archive Cards Styles
   ========================================================================== */

/* Product List Cards Container */
.product-list-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Product Card Horizontal */
.product-card-horizontal {
    background: var(--bg-white);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.3s ease;
}

.product-card-horizontal:hover {
    box-shadow: var(--shadow-md);
}

.product-card-horizontal.card--verified {
    border-color: #108D52;
    border-width: 1px;
}

/* Product Card Wrapper */
.product-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* ==========================================================================
   Header Row: Badges + Title
   ========================================================================== */

.product-card-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-badges-horizontal {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    margin-bottom: 0;
}

/* Hide badges container when empty (no badges) */
.product-badges-horizontal:empty,
.product-badges-horizontal:not(:has(.badge)) {
    display: none;
    margin-bottom: 0;
}

/* Badge styles are now in components/badge.css */
.badge-verified svg,
.badge--verified svg {
    flex-shrink: 0;
}

.product-title-horizontal {
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    color: var(--color-primary);
    margin: 0;
    flex: 1;
}

.product-title-link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.product-title-link:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* ==========================================================================
   Body: Gallery + Content + Profile (3 columns)
   ========================================================================== */

.product-card-body {
    display: flex;
    align-items: stretch;
}

/* Left & Middle Columns Wrapper */
.product-card-left-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-width: 0;
    border-right: 1px solid #ECECEC;
    padding-right: 36px;
}

/* Gallery + Main Content Row */
.product-card-content-row {
    display: flex;
    gap: 12px;
    flex: 1;
}

/* ==========================================================================
   Left Column: Image Gallery
   ========================================================================== */

.product-card-gallery {
    flex-shrink: 0;
    width: 206px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-gallery-main {
    background: var(--bg-gray-light);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    height: 184px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.product-image-link:hover {
    text-decoration: none;
    opacity: 0.9;
}

.product-image-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-color: #f9f9f9;
}

/* Default placeholder image should use contain */
.product-image[src*="Coming-soon-replacement-image"] {
    object-fit: contain;
}

.product-image.active {
    opacity: 1;
    position: relative;
}

.product-gallery-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    gap: 16px;
}

.gallery-nav-btn {
    border-radius: 24px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 28px;
    height: 28px;
    padding: 0;
}

.gallery-nav-btn.prev {
    background: var(--bg-gray-light);
}

.gallery-nav-btn.prev:hover {
    background: var(--bg-gray);
}

.gallery-nav-btn.next {
    background: var(--color-primary);
}

.gallery-nav-btn.next:hover {
    background: var(--color-primary-dark);
}


.gallery-counter {
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    color: var(--color-text-tertiary);
}

.gallery-counter .current-image {
    font-weight: 500;
    color: var(--color-primary);
}

/* ==========================================================================
   Middle Column: Features, Actions, Tags
   ========================================================================== */

.product-card-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: flex-start;
    min-width: 0;
}

/* Product price styles are now in components/product-price.css */

/* Features Description */
.product-features-horizontal {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.features-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 100px;
    overflow: hidden;
}

.feature-text {
    margin: 0;
    padding: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: var(--color-text-tertiary);
    padding-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.features-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.12);
    width: 100%;
}

/* Actions */
.product-actions-horizontal {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Inquiry Action Wrapper */
.product-inquiry-action-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.product-inquiry-action-wrapper a {
    font-size: 12px;
}
/* Button styles are now in components/button.css */

/* SVG Icon Hover States - Tự quản lý bằng CSS */
.btn-chat:hover .icon-chat {
    color: #108D52 !important;
}

.btn-share:hover .icon-share {
    color: #108D52 !important;
}

/* Tags */
.product-tags-horizontal {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    column-gap: 8px;
}

.tag-link {
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.tag-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.tag-separator {
    width: 1px;
    height: 12px;
    background: var(--border-color-light);
}

/* ==========================================================================
   Right Column: Product & Supplier Profile
   ========================================================================== */

.product-card-profile {
    flex-shrink: 0;
    width: 258px;
    max-width: 328px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.supplier-profile-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.supplier-profile-link {
    text-decoration: none;
    display: block;
    width: 100%;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.supplier-profile-link:hover .supplier-name {
    text-decoration: underline;
}

.supplier-profile-link:hover .supplier-avatar {
    cursor: pointer;
}

.product-profile-link {
    text-decoration: none;
    display: block;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.product-profile-link:hover {
    opacity: 0.8;
}

.product-profile-link:hover .product-name {
    text-decoration: underline;
}

.product-profile-link:hover .supplier-avatar {
    cursor: pointer;
}

.supplier-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.supplier-avatar {
    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;
    max-width: 58px;
    max-height: 58px;
    border-radius: 30px;
    background: var(--border-color-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 500;
    line-height: 36px;
    color: var(--color-text-dark);
    overflow: hidden;
}

.supplier-avatar-image {
    border: 2px solid var(--border-color-light);
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
}

.supplier-avatar-initials {
    font-size: 24px;
    font-weight: 500;
    line-height: 36px;
    color: var(--color-text-dark);
}

.supplier-info-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 20px;
    color: var(--color-primary);
    text-align: center;
    margin: 0;
    width: 100%;
}

.supplier-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 18px;
    color: var(--color-primary);
    text-align: center;
    margin: 0;
}

.product-rating-stars {
    display: flex;
    gap: 0;
    align-items: center;
    justify-content: center;
}

.product-rating-stars .star {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Partial star styling */
.product-rating-stars .star.partial {
    position: relative;
}

.product-rating-stars .star.partial .star-partial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    height: 100%;
}

.product-rating-stars .star.partial .star-partial-overlay svg {
    display: block;
    flex-shrink: 0;
}

.product-rating-stars .star.partial .star-partial-overlay svg path {
    fill: var(--color-warning);
}


.supplier-location-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.supplier-location-info .location-flag {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.supplier-location-info span {
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    color: var(--color-text-tertiary);
}

.supplier-quotations-count {
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    color: var(--color-error);
    text-align: center;
    margin-top: 4px;
}

.supplier-contact-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.contact-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-success-light);
    padding: 4px;
}

.contact-item span {
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: var(--color-text-tertiary);
    word-break: break-word;
}

.product-pricing {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.pricing-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px;
    border-radius: 14px;
}

.pricing-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-success-light);
    padding: 4px;
}


.pricing-item span {
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    color: var(--color-primary);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet and below: max 1024px */
@media (max-width: 1024px) {
    .product-card-header-row {
        flex-wrap: nowrap;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .product-card-body {
        gap: 20px;
    }

    .product-card-gallery {
        width: 180px;
    }

    .product-gallery-main {
        height: 160px;
    }
}

/* Mobile: max 768px */
@media (max-width: 768px) {
    .product-card-horizontal {
        padding: 12px;
    }

    .product-card-wrapper {
        gap: 10px;
    }

    .product-card-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .product-card-body {
        flex-direction: column;
        gap: 12px;
    }

    .product-card-left-content {
        border-right: none;
        border-bottom: 1px solid var(--border-color-light);
        padding-right: 0;
        padding-bottom: 12px;
        margin-bottom: 0;
    }

    .product-card-content-row {
        flex-direction: column;
        gap: 10px;
    }

    .product-card-gallery {
        width: 100%;
    }

    .product-gallery-main {
        height: 200px;
    }

    .product-gallery-nav {
        width: auto;
        justify-content: center;
        gap: 12px;
    }

    .product-card-main {
        height: auto;
        gap: 12px;
    }

    .product-actions-horizontal {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .product-inquiry-action-wrapper {
        flex: 1;
        width: 100%;
    }

    .product-inquiry-action-wrapper .btn-inquiry-now {
        width: 100%;
    }

    .product-card-profile {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    .supplier-profile-card {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .supplier-profile-header {
        flex-direction: row;
        align-items: flex-start;
        width: 100%;
    }

    .supplier-avatar {
        width: 58px;
        height: 58px;
        min-width: 58px;
        min-height: 58px;
        max-width: 58px;
        max-height: 58px;
        font-size: 18px;
        flex-shrink: 0;
    }

    .supplier-info-group {
        align-items: flex-start;
        flex: 1;
        gap: 6px;
    }

    .product-name {
        text-align: left;
        font-size: 12px;
        line-height: 16px;
    }

    .supplier-name {
        text-align: left;
        font-size: 12px;
        line-height: 16px;
    }

    .product-rating-stars {
        justify-content: flex-start;
    }

    .supplier-location-info {
        justify-content: flex-start;
        order: 1;
    }

    .supplier-location-info span {
        font-size: 12px;
        line-height: 16px;
    }

    .supplier-quotations-count {
        font-size: 12px;
        line-height: 16px;
        text-align: left;
        margin-top: 0;
        order: 1;
    }

    .product-pricing {
        flex-direction: row;
        gap: 10px;
        width: 100%;
    }

    .supplier-contact-info {
        display: flex;
        flex-direction: row;
        gap: 0;
        align-items: center;
        width: 100%;
        flex-wrap: nowrap;
    }

    .contact-item {
        justify-content: flex-start;
        gap: 6px;
        padding: 2px 0;
        white-space: nowrap;
        flex: 0 1 auto;
        min-width: 0;
    }

    .contact-item:last-child {
        margin-left: auto;
    }

    .contact-item-icon {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        padding: 3px;
    }

    .contact-item span {
        font-size: 12px;
        line-height: 16px;
        font-weight: 500;
        text-align: left;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pricing-item {
        justify-content: flex-start;
        flex: 0 1 auto;
        min-width: 0;
        max-width: 48%;
    }

    .pricing-item span {
        font-size: 12px;
        line-height: 16px;
        word-break: break-all;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Badge responsive styles are now in components/badge.css */

    .product-title-horizontal {
        font-size: 14px;
        line-height: 18px;
    }

    .features-list {
        font-size: 10px;
        line-height: 16px;
        max-height: 96px;
        height: auto;
    }

    .features-list li {
        padding-left: 14px;
        text-indent: -14px;
        line-height: 16px;
    }
}

/* Tablet: 769px - 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .product-card-profile {
        width: auto;
        flex: 0 0 auto;
        padding: 22px 12px 20px 0;
    }

    .supplier-profile-card {
        align-items: flex-start;
        gap: 12px;
    }

    .supplier-profile-header {
        width: auto;
        gap: 10px;
        flex: 0 0 auto;
    }

    .supplier-avatar {
        width: 56px;
        height: 56px;
        font-size: 22px;
        line-height: 32px;
        flex-shrink: 0;
    }

    .supplier-info-group {
        align-items: center;
        gap: 6px;
        flex: 0 1 auto;
        min-width: 0;
    }

    .product-name {
        font-size: 16px;
        line-height: 20px;
        text-align: left;
    }

    .supplier-name {
        font-size: 14px;
        line-height: 18px;
        text-align: left;
    }

    .product-rating-stars {
        justify-content: flex-start;
    }

    .product-rating-stars .star {
        width: 14px;
        height: 14px;
    }

    .supplier-location-info span {
        font-size: 12px;
    }

    .product-pricing {
        flex-direction: column;
        gap: 4px;
        align-items: flex-end;
        width: auto;
    }

    .pricing-item {
        justify-content: flex-end;
    }

    .pricing-item span {
        font-size: 12px;
        text-align: right;
    }
}
