/**
 * Product Cat Price Plugin Stylesheet
 * Layout Styles: List and Table
 */

/* ==========================================
   List Layout
   ========================================== */
.pcp-layout-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
}

.pcp-list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: #ffffff;
    border: 1px solid #ececec;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pcp-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
    border-color: #d3d3d3;
}

.pcp-list-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    margin-right: 20px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f9f9f9;
}

.pcp-list-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.pcp-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.pcp-list-item:hover .pcp-list-image img {
    transform: scale(1.05);
}

.pcp-list-content {
    flex-grow: 1;
}

.pcp-list-title {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
}

.pcp-list-title a {
    color: #333333;
    transition: color 0.15s ease;
    text-decoration: none;
}

.pcp-list-title a:hover {
    color: #d26e4b; /* Default Flatsome primary color fallback */
}

.pcp-list-price {
    font-size: 0.95rem;
    color: #111111;
    font-weight: bold;
}

.pcp-list-price .amount {
    color: #d26e4b;
}

.pcp-list-action {
    margin-left: 20px;
    flex-shrink: 0;
}

/* ==========================================
   Table Layout
   ========================================== */
.pcp-layout-table-wrapper {
    overflow-x: auto;
    margin-bottom: 24px;
    border: 1px solid #ececec;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.pcp-layout-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.pcp-layout-table th,
.pcp-layout-table td {
    padding: 14px 18px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #ececec;
}

.pcp-layout-table th {
    background-color: #f9f9f9;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: #555555;
    border-bottom: 2px solid #ececec;
}

.pcp-layout-table tbody tr:last-child td {
    border-bottom: none;
}

.pcp-layout-table tbody tr {
    transition: background-color 0.15s ease;
}

.pcp-layout-table tbody tr:hover {
    background-color: #fafafa;
}

.pcp-table-col-image {
    width: 70px;
}

.pcp-table-col-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    background-color: #f9f9f9;
}

.pcp-table-link {
    color: #333333;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.pcp-table-link:hover {
    color: #d26e4b;
}

.pcp-table-col-price {
    font-weight: bold;
}

.pcp-table-col-price .amount {
    color: #d26e4b;
}

.pcp-table-col-action {
    width: 150px;
    text-align: right !important;
}

/* ==========================================
   Responsive Rules
   ========================================== */
@media (max-width: 549px) {
    /* List Layout Mobile */
    .pcp-list-item {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .pcp-list-image {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100px;
        height: 100px;
    }
    
    .pcp-list-action {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
    }
    
    .pcp-list-action .button {
        display: block;
        width: 100%;
        margin: 0;
    }

    /* Table Layout Mobile */
    .pcp-layout-table th:nth-child(1),
    .pcp-layout-table td:nth-child(1) {
        width: 60px;
        padding: 10px;
    }

    .pcp-layout-table th:nth-child(4),
    .pcp-layout-table td:nth-child(4) {
        display: none; /* Hide actions column to fit content */
    }
}
