/* ==========================================
   Elementor Component Table Widget Styles
   ========================================== */

/* Main Table Container */
.cm-ingredients-table-wrapper {
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
}

/* Table Header/Title Panel */
.cm-ingredients-table-title {
    padding: 20px;
    background-color: #f4f6f8;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #c59b4c;
    color: #333333;
}

/* Responsive Table Wrapper with Touch Scroll */
.cm-ingredients-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Webkit Scrollbar Customization for Premium Look */
.cm-ingredients-table-responsive::-webkit-scrollbar {
    height: 6px;
}
.cm-ingredients-table-responsive::-webkit-scrollbar-track {
    background: #f4f4f4;
}
.cm-ingredients-table-responsive::-webkit-scrollbar-thumb {
    background: #c59b4c;
    border-radius: 3px;
}
.cm-ingredients-table-responsive::-webkit-scrollbar-thumb:hover {
    background: #b08940;
}

/* Base Table Elements */
.cm-ingredients-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    text-align: left;
    font-family: inherit;
    margin: 0 !important; /* Prevent default theme table margins from creating a bottom gap */
}

/* Table Head Headers */
.cm-ingredients-table th {
    padding: 15px 20px;
    border-bottom: 1px solid #eaeaea;
    background-color: #c59b4c; /* Premium Gold theme default background */
    font-weight: 600;
    color: #ffffff; /* White text for premium contrast */
    font-size: 0.95rem;
    text-align: center; /* Center align headings horizontally */
    vertical-align: middle; /* Center align headings vertically */
}

/* Column Specific Headers */
.cm-ingredients-table th.col-header-name {
    width: 35%;
}
.cm-ingredients-table th.col-header-amount {
    width: 15%;
}
.cm-ingredients-table th.col-header-mechanism {
    width: 50%;
}

/* Table Data Cells */
.cm-ingredients-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #eaeaea;
    color: #555555;
    font-size: 0.95rem;
    line-height: 1.6;
    vertical-align: middle;
}

/* Remove border-bottom from the last row cells to avoid duplicate lines in rounded container */
.cm-ingredients-table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Column classes */
.cm-ingredients-table td.col-name {
    font-weight: 500;
    color: #333333;
}
.cm-ingredients-table td.col-amount {
    text-align: center;
}
.cm-ingredients-table td.col-mechanism {
    color: #555555;
}

/* Smooth Table Row Transitions */
.cm-ingredients-table tbody tr {
    transition: background-color 0.25s ease, border-left-color 0.25s ease;
}

/* Row Hover Effect */
.cm-ingredients-table tbody tr:hover td {
    background-color: rgba(197, 155, 76, 0.03) !important;
}

/* Zebra Striping (Even Rows) */
.cm-ingredients-table tbody tr.row-even td {
    background-color: #fbfbfb;
}

/* Highlighted Row Effect (e.g. Spermidine, NMN) */
.cm-ingredients-table tbody tr.row-highlighted td {
    background-color: rgba(212, 175, 55, 0.04) !important;
}

.cm-ingredients-table tbody tr.row-highlighted td.col-name {
    border-left: 4px solid #c59b4c !important;
    padding-left: 16px !important;
}

/* Longevity Footnote Panel */
.cm-ingredients-footnote {
    width: 100%;
    margin-top: 40px;
    padding: 20px;
    border-left: 4px solid #c59b4c;
    background-color: rgba(212, 175, 55, 0.05);
    border-radius: 0 8px 8px 0;
    box-sizing: border-box;
}

.cm-ingredients-footnote p {
    font-size: 1rem;
    color: #555555;
    margin: 0;
    line-height: 1.7;
    font-style: italic;
}

.cm-ingredients-footnote strong {
    color: #333333;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .cm-ingredients-table-title {
        font-size: 1rem;
        padding: 15px;
    }
    
    .cm-ingredients-table th, 
    .cm-ingredients-table td {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .cm-ingredients-table tbody tr.row-highlighted td.col-name {
        border-left: 3px solid #c59b4c !important;
        padding-left: 12px !important;
    }
    
    .cm-ingredients-footnote {
        margin-top: 30px;
        padding: 15px;
    }
    
    .cm-ingredients-footnote p {
        font-size: 0.9rem;
    }
}
