/* CA Product Manager - Frontend Styles */

.ca-pm-product-list {
    margin: 30px 0;
    width: 100%;
    font-family: "Poppins", Sans-serif;
}

.ca-pm-category-description {
    margin-bottom: 30px;
    font-size: 16px;
    color: #666;
}

.ca-pm-products-grid {
    display: grid;
    gap: 100px;
}

.ca-pm-product-item {
    background: #fff;
    padding: 0;
    width: 100%;
}

/* Product Title */
.ca-pm-product-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    padding: 0;
    color: #003087;
    text-transform: uppercase;
    word-wrap: break-word;
}

/* Title and Icons Row */
.ca-pm-product-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
    padding-bottom: 2px;
    border-bottom: 2px solid #003087;
    width: 100%;
}

.ca-pm-product-header-left {
    flex: 1;
    min-width: 0;
}

.ca-pm-product-header-right {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
}

/* Product Icons */
.ca-pm-product-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: none;
    justify-content: flex-end;
}

.ca-pm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 150px;
    height: 75px;
    user-select: none;
}

.ca-pm-icon img {
    display: block;
    max-width: 40px;
    height: auto;
    max-height: 75px;
}

.ca-pm-icon-link {
    text-decoration: none;
    display: inline-flex;
}

.ca-pm-icon-link:hover .ca-pm-icon {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

/* Main Content Layout: Gallery + Details Side by Side */
.ca-pm-product-content {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
}

.ca-pm-product-gallery-wrapper {
    flex: 0 0 570px;
    min-width: 570px;
    max-width: 570px;
}

.ca-pm-product-details-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
}

.ca-pm-product-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Product Image Gallery */
.ca-pm-product-gallery {
    width: 100%;
    max-width: 570px;
}

.ca-pm-gallery-stage {
    width: 95%;
    max-width: 570px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: #f5f5f5;
    border-radius: 8px;
    border: 2px solid #e0e0e0; */
}

.ca-pm-gallery-main-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.ca-pm-gallery-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-start;
}

.ca-pm-gallery-thumb {
    width: 80px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ca-pm-gallery-thumb:hover {
    border-color: #0d47a1;
    transform: scale(1.05);
}

.ca-pm-gallery-thumb.active {
    border-color: #0d47a1;
    box-shadow: 0 0 0 2px rgba(13, 71, 161, 0.3);
}

.ca-pm-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Annotations */
.ca-pm-product-annotations {
    margin-bottom: 20px;
    padding: 15px;
    /* background: #f9f9f9; */
    /* border-left: 4px solid #0d47a1; */
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    text-align: right;
}

/* Links in Row 1 (under HTML table) */
.ca-pm-links-wrapper {
    width: 100%;
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

/* Links List */
.ca-pm-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ca-pm-link-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 0;
    font-size: 16px;
    line-height: 1.4;
}

.ca-pm-link-item .ca-pm-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ca-pm-link-item .ca-pm-svg-icon {
    display: block;
}

/* Download icon (file) - 70px x 62px */
.ca-pm-link-item.ca-pm-link-download .ca-pm-svg-icon {
    width: 70px;
    height: 62px;
    fill: #003087;
}

/* Regular link icon (caret-square-right) - 32px x 32px */
.ca-pm-link-item.ca-pm-link-regular .ca-pm-svg-icon {
    width: 32px;
    height: 32px;
    fill: #FF2500;
}

.ca-pm-link-item a {
    text-decoration: none;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
}

.ca-pm-link-item a strong {
    font-weight: bold;
}

/* Regular links (non-download) have red color #FF2500 */
.ca-pm-link-item.ca-pm-link-regular a {
    color: #FF2500;
}

/* Download links have blue color #003087 */
.ca-pm-link-item.ca-pm-link-download a {
    color: #003087;
}

.ca-pm-link-item a:hover {
    text-decoration: underline;
}

/* Row 2: Bullet Points (full width) */
.ca-pm-bullet-points-row {
    width: 100%;
    margin-top: 30px;
}

/* Bullet Points List */
.ca-pm-bullet-points-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ca-pm-bullet-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6rem;
    padding: 4px 0;
    color: #333;
}

.ca-pm-bullet-item .ca-pm-bullet-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ca-pm-bullet-item .ca-pm-bullet-svg-icon {
    width: 22px;
    height: 22px;
    fill: #c8102e;
}

/* Legacy two-column layout (for backwards compatibility) */
.ca-pm-product-features-row {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
    margin-top: 30px;
}

.ca-pm-bullet-points-wrapper {
    flex: 1;
    min-width: 0;
}

/* Legacy features class - remove red border, keep for backwards compatibility */
.ca-pm-product-features {
    margin-bottom: 25px;
    padding: 0;
    border: none;
    background: transparent;
}

.ca-pm-features-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ca-pm-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.ca-pm-feature-item i {
    flex-shrink: 0;
    color: #e74c3c;
    font-size: 16px;
}

.ca-pm-feature-item.ca-pm-feature-link a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ca-pm-feature-item.ca-pm-feature-link a:hover {
    color: #004499;
    text-decoration: underline;
}

/* HTML Content */
.ca-pm-product-html {
    margin-top: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: end;
}

/* High specificity to override any existing table styles */
/* Based on old ds-product-tb design */
.ca-pm-product-html table.ca-pm-table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: auto !important;
    max-width: 670px !important;
    width: 420px !important;
    line-height: 1.2em !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
    float: right !important;
}

.ca-pm-product-html table.ca-pm-table th,
.ca-pm-product-html table.ca-pm-table td {
    border: 4px solid #fff !important;
    font-size: 12px !important;
    overflow: hidden !important;
    padding: 5px !important;
    word-break: normal !important;
    text-align: center !important;
    vertical-align: center !important;
    font-weight: 500 !important;
    color: #000 !important;
    justify-items: center !important;
}

.ca-pm-product-html table.ca-pm-table thead th {
    background-color: #086fba !important;
    color: #ffffff !important;
    text-align: center !important;
    vertical-align: center !important;
    border: 4px solid #fff !important;
}

/* Zebra stripes: Even rows (light blue) */
.ca-pm-product-html table.ca-pm-table tbody tr:nth-child(even) {
    background-color: #bdd7ed ;
}

.ca-pm-product-html table.ca-pm-table tbody tr:nth-child(even) th,
.ca-pm-product-html table.ca-pm-table tbody tr:nth-child(even) td {
    background-color: #bdd7ed ;
}

/* Zebra stripes: Odd rows (lighter blue) */
.ca-pm-product-html table.ca-pm-table tbody tr:nth-child(odd) {
    background-color: #e3eef5;
}

.ca-pm-product-html table.ca-pm-table tbody tr:nth-child(odd) th,
.ca-pm-product-html table.ca-pm-table tbody tr:nth-child(odd) td {
    background-color: #e3eef5;
}

/* Last Row Thead */
.ca-pm-table thead tr th:last-child {
    background: transparent !important;
    color: #086fba !important;
}

.ca-pm-product-html table.ca-pm-table tbody th:last-child {
    background-color: #fff !important;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    /* Mobile: Stack vertically with column direction */
    .ca-pm-product-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .ca-pm-product-gallery-wrapper,
    .ca-pm-product-details-wrapper {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    
    /* Mobile: Left-align details */
    .ca-pm-product-details-wrapper {
        justify-content: flex-start;
    }
    
    .ca-pm-product-details {
        align-items: flex-start;
    }
    
    /* Mobile: Bullet points row already full width */
    .ca-pm-bullet-points-row {
        margin-top: 20px;
    }
    
    /* Mobile: Links wrapper full width */
    .ca-pm-links-wrapper {
        width: 100%;
        margin-top: 15px;
    }
    
    /* Legacy: Stack bullet points and links vertically if using old layout */
    .ca-pm-product-features-row {
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
    }
    
    .ca-pm-bullet-points-wrapper {
        flex: 1 1 100%;
        width: 100%;
    }
    
    /* Mobile: Stack title and icons vertically with column direction */
    .ca-pm-product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ca-pm-product-header-left,
    .ca-pm-product-header-right {
        flex: 1 1 100%;
        width: 100%;
    }
    
    /* Keep icons right-aligned even on mobile */
    .ca-pm-product-header-right {
        justify-content: flex-end;
    }
    
    .ca-pm-product-icons {
        justify-content: flex-end;
    }
    
    .ca-pm-product-title {
        font-size: 1.5rem;
    }
    
    /* Mobile: Reset gallery width */
    .ca-pm-product-gallery {
        max-width: 100%;
    }
    
    /* On mobile: Remove float, use full width */
    .ca-pm-product-html table.ca-pm-table {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        font-size: 11px !important;
    }
    
    .ca-pm-product-html table.ca-pm-table th,
    .ca-pm-product-html table.ca-pm-table td {
        padding: 6px 4px !important;
        font-size: 11px !important;
    }
    
    .ca-pm-product-icons {
        gap: 8px;
    }
    
    .ca-pm-icon img {
        max-width: 32px;
    }
}

@media screen and (max-width: 480px) {
    /* On smallest mobile: Remove float, use full width */
    .ca-pm-product-html table.ca-pm-table {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        font-size: 10px !important;
    }
    
    .ca-pm-product-html table.ca-pm-table th,
    .ca-pm-product-html table.ca-pm-table td {
        padding: 4px 2px !important;
        font-size: 10px !important;
    }
    
    .ca-pm-product-annotations {
        font-size: 13px;
        padding: 12px;
    }

    .ca-pm-icon img {
        max-width: 28px;
    }
}