/**
 * Listing Detail View Styles - Matching Smart Agricultural Monitoring System UI
 * @package     Listing Directory
 * @copyright   Copyright (C) 2025 Vision Technology Consulting. All rights reserved.
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Open+Sans:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ===================================
   Product Title Header
   =================================== */

.listing-detail-view {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.product-title-header {
    margin-bottom: 30px;
}

.product-main-title {
    color: var(--text-body-primary, #222);
    /* H3 */
    font-family: var(--type-font-family-font-family-1, Poppins);
    font-size: var(--fontsize-heading-H3, 40px);
    font-style: normal;
    font-weight: 700;
    line-height: var(--line-height-heading-H3, 44px); /* 110% */
}

.product-meta-line {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #666;
}

.product-label-text {
    font-family: 'Inter', sans-serif;
    color: #0066cc;
    font-weight: 500;
}

/* ===================================
   Images Gallery - Big Left, 2x2 Grid Right
   =================================== */

.product-images-gallery {
    margin-bottom: 30px;
}

.images-layout-row {
    display: flex;
    gap: 12px;
    height: 500px; /* Fixed height for equal sizing */
}

/* Main Large Image - LEFT SIDE - 50% WIDTH */
.main-image-column {
    flex: 0 0 50%; /* Fixed 50% width */
    width: 50%;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.main-image-column a {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.main-gallery-image {
    width: 100%;
    height: inherit !important;
    object-fit: cover;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.main-image-column a:hover .main-gallery-image {
    opacity: 0.9;
}

/* Thumbnail Grid 2x2 - RIGHT SIDE - 50% WIDTH */
.thumbnail-grid-column {
    flex: 0 0 calc(50% - 12px); /* Fixed 50% width minus gap */
    width: calc(50% - 12px);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    height: 100%;
}

.thumbnail-grid-item {
    border: 2px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    height: 100%;
    width: 100%;
}

.thumbnail-grid-item a {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.thumbnail-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.thumbnail-grid-item a:hover img {
    opacity: 0.8;
}

/* ===================================
   Product Details Panel
   =================================== */

.detail-section-divider {
    background: var(--border-quaternary, #E5E7EB);
    width: 100%;
    height: 1px;
}

.detail-section-title {
    color: var(--text-body-primary, #222);

    /* H5 */
    font-family: var(--type-font-family-font-family-1, Poppins);
    font-size: var(--fontsize-heading-h5, 24px);
    font-style: normal;
    font-weight: 700;
    line-height: var(--line-height-heading-h5, 32px); /* 133.333% */
}
.detail-section-title-h6 {
    color: var(--text-body-primary, #222);

    /* H6 */
    font-family: var(--type-font-family-font-family-1, Poppins);
    font-size: var(--fontsize-heading-H6, 20px);
    font-style: normal;
    font-weight: 700;
    line-height: var(--line-height-heading-H6, 32px); /* 160% */
}
.detail-section-content {
    color: var(--text-body-primary, #222);
    /* Body L */
    font-family: var(--type-font-family-font-family-2, "Open Sans");
    font-size: var(--fontsize-body-body-l, 16px);
    font-style: normal;
    font-weight: 400;
    line-height: var(--line-height-body-l, 24px); /* 150% */
}

/* About Section */
.about-section .detail-section-content p {
    margin: 0;
}

/* Certification and Price Section */
.cert-price-section {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    align-self: stretch;
}

.certification-container,
.price-container {
    flex: 1;
}

/* Certification Badges */
.certification-badges {
    display: flex;
    align-items: flex-start;
    align-content: flex-start;
    gap: 20px;
    align-self: stretch;
    flex-wrap: wrap;
}

.cert-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f0f7ff;
    border: 1px solid #d0e5ff;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
}

.badge-icon {
    font-size: 1.2rem;
}

/* Indicative Price */
.price-value {
    color: var(--text-body-primary, #222);
    font-family: var(--type-font-family-font-family-1, Poppins);
    font-size: var(--fontsize-heading-h6, 20px);
    font-style: normal;
    font-weight: 400;
    line-height: var(--line-height-heading-h6, 32px); /* 160% */
}

/* Registration Items */
.registration-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
}

.reg-item {
    display: flex;
    align-items: center;
    gap: 28px;
    align-self: stretch;
}

.reg-label {
    color: var(--text-body-primary, #222);

    /* Body XL-bold */
    font-family: var(--type-font-family-font-family-2, "Open Sans");
    font-size: var(--fontsize-body-body-xl, 18px);
    font-style: normal;
    font-weight: 700;
    line-height: var(--line-height-body-xl, 28px); /* 155.556% */
    min-width: 270px;;
}

.reg-value {
    display: flex;
    align-items: center;
    gap: 28px;
    align-self: stretch;
}

/* USP List */
.usp-list {
    
}

.usp-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm, 16px);
    align-self: stretch;
}

.usp-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    aspect-ratio: 1/1;
    background: #D9D9D9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #666;
}

.usp-content {
    flex: 1;
}

.usp-title {
    font-family: 'Open Sans', sans-serif;
    font-size: var(--fontsize-body-body-xl, 18px);
    font-style: normal;
    font-weight: 700;
    line-height: var(--line-height-body-xl, 32px);
    color: #1E2939;
    margin: 0px;
    padding-bottom: 10px;
}

.usp-description {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    color: #1E2939;
    letter-spacing: -0.312px;
    margin: 0;
}

/* ===================================
   Company Info Sidebar Box - AT TOP OF RIGHT COLUMN
   =================================== */

.company-info-box {
    border-radius: var(--border-radius-md, 16px);
    background: #FFF;
    box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.10), 0 0 5px 0 rgba(0, 0, 0, 0.11);
    display: flex;
    padding: 32px;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.company-info-box-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-7, 28px);
    align-self: stretch;
}

.company-info-box-content-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    align-self: stretch;
}

/* Company Logo */
.company-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 16px;
}

.company-logo {
    max-width: 200px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Company Name Section */
.company-name-section {
    text-align: center;
    margin-bottom: 12px;
}

.company-info-box .company-name {
    color: #000;
    text-align: center;

    /* Body XL-bold */
    font-family: var(--type-font-family-font-family-2, "Open Sans");
    font-size: var(--fontsize-body-body-xl, 18px);
    font-style: normal;
    font-weight: 700;
    line-height: var(--line-height-body-xl, 28px); /* 155.556% */
}

/* Company Description/Tagline */
.company-description {
    text-align: center;
    margin-bottom: 20px;
}

.company-description p {
    color: var(--color-slate-600, #45556C);
    text-align: center;
    flex: 1;
    word-break: break-word;
    /* text-base/normal */
    font-family: var(--font-family-sans, "Open Sans"), sans-serif;
    font-size: var(--font-size-base, 16px);
    font-style: normal;
    font-weight: var(--font-weight-normal, 400);
    line-height: var(--font-leading-6, 24px); /* 150% */
    letter-spacing: var(--font-tracking-normal, 0);
}

.company-box-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-4, 16px);
    align-self: stretch;
}

.company-detail-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-2, 8px);
}

.detail-icon {
    font-size: 18px;
    flex-shrink: 0;
    color: #6B7280;
    margin-top: 2px;
}

.detail-icon-svg {
    display: flex;
    width: 24px;
    height: 24px;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1/1;
}

.detail-text {
    color: var(--text-body-primary, #222);

    /* Body L */
    font-family: var(--type-font-family-font-family-2, "Open Sans");
    font-size: var(--fontsize-body-body-l, 16px);
    font-style: normal;
    font-weight: 400;
    line-height: var(--line-height-body-l, 24px); /* 150% */
} 

.detail-link {
    color: #3B82F6;
    text-decoration: none;
    flex: 1;
    word-break: break-word;
}

.detail-link:hover {
    text-decoration: underline;
    color: #2563EB;
}

/* Company Action Buttons */
.company-box-actions {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: var(--spacing-x, 12px);
    align-self: stretch;
}

.btn-icon-action {
    display: flex;
    height: 56px;
    min-width: 100px;
    padding: 10px var(--sizing-component-lg, 20px) 10px var(--sizing-component-md, 16px);
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xs, 8px);
    flex: 1 0 0;
}

.btn-email {
    border-radius: var(--border-radius-round, 999px);
    background: var(--surface-primary-on-light, #BD0F16);

    /* btn */
    box-shadow: 0 2px 6px 0 rgba(45, 35, 61, 0.15);
    color: var(--text-on-dark, #FFF);
    text-align: center;

    /* Body L bold */
    font-family: var(--type-font-family-font-family-2, "Open Sans");
    font-size: var(--fontsize-body-body-l, 16px);
    font-style: normal;
    font-weight: 700;
    line-height: var(--line-height-body-l, 24px); /* 150% */
}

.btn-call {
    border-radius: var(--border-radius-round, 999px);
    border: var(--border-width-sm, 1px) solid var(--border-action, #BD0F16);
    color: var(--text-button-primary-on-light, #BD0F16);
    text-align: center;

    /* Body L bold */
    font-family: var(--type-font-family-font-family-2, "Open Sans");
    font-size: var(--fontsize-body-body-l, 16px);
    font-style: normal;
    font-weight: 700;
    line-height: var(--line-height-body-l, 24px); /* 150% */
}

.btn-icon-action .btn-icon {
    width: 24px;
    height: 24px;
}

.btn-icon-action:hover {
    background: #E5E7EB;
    border-color: #D1D5DB;
    transform: translateY(-2px);
}

.btn-icon-action .btn-icon {
    font-size: 20px;
}

.btn-company-whatsapp-full {
    display: flex;
    height: var(--spacing-12, 48px);
    min-width: var(--spacing-14, 56px);
    padding: var(--spacing-0, 0) var(--spacing-6, 24px);
    justify-content: center;
    align-items: center;
    gap: var(--spacing-2, 8px);
    flex: 1 0 0;
    border-radius: var(--radius-4xl, 32px);
    opacity: var(--opacity-100, 1);
    background: #20B038;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.10), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    color: #ffffff;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-company-whatsapp-full:hover:not(:disabled) {
    background: #20BA5A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-company-whatsapp-full:disabled {
    background: #D1D5DB;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-company-whatsapp-full .btn-icon {
    font-size: 18px;
}

.product-details-panel {
    display: flex;
    max-width: 1320px;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-1xl, 48px);
    flex: 1 0 0;
}

.company-info-box-mobile { display: none; }

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 991px) {
    .product-details-panel {
        padding-left: 0;
    }

    .product-images-gallery {
        position: relative;
        top: 0;
    }

    /* Reduce height on tablets */
    .images-layout-row {
        height: 400px;
    }

    .company-info-box {
        display: none;
    }

    .company-info-box-mobile {
        background: #FFF;
        box-shadow: 0 4px 20px 0 #FAFAFA;
        display: flex;
        padding: var(--spacing-x, 12px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--spacing-2xs, 6px);
        border-bottom: 1px solid var(--border-quaternary, #E5E7EB);
    }
    .company-info-box-mobile-top {
        display: flex;
        align-items: center;
        gap: 12px;
        align-self: stretch;
    }
    .company-info-box-mobile-top-left img {
        width: 48px;
        height: 48px;
        aspect-ratio: 1/1;
        background: linear-gradient(0deg, rgba(215, 215, 215, 0.20) 0%, rgba(215, 215, 215, 0.20) 100%), url(<path-to-image>) lightgray 50% / cover no-repeat;
    }
    .company-info-box-mobile-top-right label {
        color: var(--text-body-primary, #222);
        text-align: center;

        /* Body XL-bold */
        font-family: var(--type-font-family-font-family-2, "Open Sans");
        font-size: var(--fontsize-body-body-xl, 16px);
        font-style: normal;
        font-weight: 700;
        line-height: var(--line-height-body-xl, 24px); /* 150% */
    }

    .company-info-box-mobile-bottom {
        display: flex;
        padding: var(--spacing-2xs, 6px) 0;
        align-items: center;
        gap: var(--spacing-x, 12px);
        align-self: stretch;
        flex-direction: column;
        align-items: flex-start;
    }

    .mobile-action-buttons {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
    }

    .btn-icon-mobile {
        display: flex;
        width: 42px;
        height: 42px;
        justify-content: center;
        align-items: center;
        background: #FFF;
        padding: 0;
        cursor: pointer;
        border: none;
    }

    .btn-icon-mobile img {
        width: 38px;
        height: 38px;
    }

    .btn-email-mobile {
        border-radius: var(--border-radius-round, 999px);
        background: var(--surface-primary-on-light, #BD0F16);

        /* btn */
        box-shadow: 0 2px 6px 0 rgba(45, 35, 61, 0.15);
        display: flex;
        height: 42px;
        min-width: 100px;
        padding: 10px var(--sizing-component-lg, 20px) 10px var(--sizing-component-md, 16px);
        justify-content: center;
        align-items: center;
        gap: var(--spacing-xs, 8px);
        flex: 1 0 0;
        color: var(--text-on-dark, #FFF);
        text-align: center;
        max-width: 164px;
        font-family: var(--type-font-family-font-family-2, "Open Sans");
        font-size: var(--fontsize-body-body-l, 16px);
        font-style: normal;
        font-weight: 700;
        line-height: var(--line-height-body-l, 24px); /* 150% */
    }
    
    .mobile-company-details {
        width: 100%;
        padding-top: 12px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-detail-row {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        color: #4B5563;
    }

    .mobile-detail-row img {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }
    
    .mobile-detail-row a {
        color: #5850EC;
        text-decoration: none;
    }
    
    .mobile-detail-row .company-name {
        color: var(--text-button-tertiary, #4847EB);

        font-family: var(--type-font-family-font-family-2, "Open Sans");
        font-size: var(--fontsize-body-body-l, 16px);
        font-style: normal;
        font-weight: 400;
        line-height: var(--line-height-body-l, 24px); /* 150% */
    }

    .product-images-gallery { margin-bottom: 0px;}

    .detail-section-title { display: none;}
    .detail-section-content {margin-top: 4px;}

}

@media (max-width: 768px) {
    .cert-price-section {
        flex-direction: column;
    }
    
    .product-main-title {
        font-size: 1.5rem;
    }

    .detail-section-title {
        font-size: 1.1rem;
    }

    /* Stack images vertically on mobile */
    .images-layout-row {
        flex-direction: column;
        height: auto;
        gap: 15px;
    }

    .main-image-column {
        width: 100%;
        flex: 0 0 100%;
        height: 300px;
    }

    .thumbnail-grid-column {
        width: 100%;
        flex: 0 0 100%;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: auto;
        height: auto;
    }

    .thumbnail-grid-item {
        height: 80px;
    }

    .usp-item {
        gap: 10px;
    }

    .reg-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 576px) {
    .listing-detail-view {
        padding: 15px;
    }

    .certification-badges {
        flex-direction: column;
    }

    .cert-badge {
        width: 100%;
        justify-content: center;
    }

    .main-image-column {
        height: 250px;
    }

    .thumbnail-grid-column {
        grid-template-columns: repeat(2, 1fr);
    }

    .thumbnail-grid-item {
        height: 90px;
    }
}

.product-category-text {
    color: var(--text-information, #3A39AE);

    /* Body M Sm-bold */
    font-family: var(--type-font-family-font-family-2, "Open Sans");
    font-size: var(--fontsize-body-body-m, 14px);
    font-style: normal;
    font-weight: 600;
    line-height: var(--line-height-body-m, 22px); /* 157.143% */
    border-radius: var(--border-radius-sm, 10px);
    background: #E7F2FF;
    display: flex;
    padding: var(--spacing-4xs, 2px) var(--sizing-component-xs, 8px);
    align-items: center;
    gap: var(--sizing-component-3xs, 2px);
    width: fit-content;
}
.product-label-text {
    color: var(--text-body-primary-weak, #4B5563);

    /* Body L */
    font-family: var(--type-font-family-font-family-2, "Open Sans");
    font-size: var(--fontsize-body-body-l, 16px);
    font-style: normal;
    font-weight: 400;
    line-height: var(--line-height-body-body-l, 24px); /* 150% */
}
.certification-badges-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mysti-certified-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
}
.mysti-certified-text-title {
    color: #1E2939;
    
    /* Body XL-bold */
    font-family: var(--type-font-family-font-family-2, "Open Sans");
    font-size: var(--fontsize-body-body-xl, 18px);
    font-style: normal;
    font-weight: 700;
    line-height: var(--line-height-body-xl, 28px); /* 155.556% */
}
.mysti-certified-text-number {
    border-radius: 8px;
    background: var(--color-blue-bendera-MY-500-primary--4-saturation, #030264);
    display: flex;
    padding: 6px 8px;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.mysti-certified-text-number-value {
    color: var(--text-on-dark, #FFF);
    /* Bold L Sm-bold */
    font-family: var(--type-font-family-font-family-2, "Open Sans");
    font-size: var(--fontsize-body-body-l, 16px);
    font-style: normal;
    font-weight: 600;
    line-height: var(--line-height-body-l, 24px); /* 150% */
}

.usp-section, .usp-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    align-self: stretch;
}