/* Container for the 3-column layout */
.cp-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Card Premium Styling */
.cp-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    text-align: left;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.cp-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* Card Image Wrapper */
.cp-image-wrapper {
    background-color: #fcfcfc;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #f5f5f5;
    padding: 15px;
}

.cp-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.5s ease;
}

.cp-card:hover .cp-image-wrapper img {
    transform: scale(1.03);
}

/* Content spacing */
.cp-content-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 20px 22px;
}

/* Typography */
.cp-title {
    font-size: 18px;
    line-height: 1.4;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    font-weight: 600;
}

.cp-price {
    font-size: 17px;
    color: #12723a;
    font-weight: 700;
    margin-bottom: 20px;
}

/* --- SIDE BY SIDE BUTTONS --- */
.cp-card-buttons {
    display: flex;
    flex-direction: row !important;
    gap: 10px !important;
    width: 100%;
    margin-top: auto;
}

.cp-button {
    flex: 1 !important;
    display: inline-block;
    text-align: center;
    padding: 11px 5px !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    box-sizing: border-box;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
}

.cp-view-btn {
    background-color: #ffffff !important;
    color: #12723a !important;
    border: 1.5px solid #12723a !important;
}

.cp-view-btn:hover {
    background-color: rgba(18, 114, 58, 0.05) !important;
}

.cp-shop-direct-btn {
    background-color: #12723a !important;
    color: #ffffff !important;
    border: 1.5px solid #12723a !important;
}

.cp-shop-direct-btn:hover {
    background-color: #0c5229 !important;
    border-color: #0c5229 !important;
}

/* --- SPLIT-VIEW POPUP MODAL --- */
.cp-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999 !important;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    padding: 20px;
    box-sizing: border-box;
}

.cp-modal-box {
    background: #ffffff;
    border-radius: 20px;
    max-width: 850px;
    width: 100%;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    max-height: 85vh;
    overflow-y: auto;
}

.cp-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: 300;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    z-index: 10;
}

.cp-close-btn:hover {
    color: #000;
}

.cp-modal-body {
    display: flex;
    flex-direction: row;
}

/* Left Column: Fixed Main Image Size */
.cp-modal-image-container {
    flex: 1;
    background: #fdfdfd;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border-right: 1px solid #f1f1f1;
    max-height: 450px;
}

.cp-modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Right Column: Details Content Area */
.cp-modal-details {
    flex: 1.2;
    padding: 40px;
    display: flex;
    flex-direction: column;
    text-align: center; /* Centered layout for titles & button */
}

.cp-modal-main-title {
    font-size: 26px;
    color: #1a1a1a;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.cp-modal-main-price {
    font-size: 20px;
    color: #12723a;
    font-weight: 700;
    margin-bottom: 15px;
}

.cp-modal-divider {
    height: 1px;
    background-color: #eeeeee;
    width: 100%;
    margin-bottom: 20px;
}

/* --- FIX FOR IN-DESCRIPTION IMAGES (GALLERY GRID) --- */
.cp-description {
    font-size: 15px;
    color: #4a4a4a;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: center; /* Center aligned text content */
}

/* Description ke andar mojood images ko inline row me convert karne ka code */
.cp-description img, 
.cp-description figure,
.cp-description .wp-block-image {
    display: inline-block !important;
    width: 75px !important;
    height: 75px !important;
    max-width: 75px !important;
    max-height: 75px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    margin: 6px 4px !important;
    border: 1px solid #e2e2e2 !important;
    vertical-align: middle !important;
}

/* Gutenberg text adjustments inside centered content */
.cp-description p {
    margin-bottom: 15px;
    text-align: center;
}

/* Modal Shop Now Button */
.cp-shop-now-btn {
    flex: none !important;
    width: 100%;
    padding: 13px 20px !important;
    background-color: #12723a !important;
    color: #fff !important;
    font-size: 15px;
    border: none !important;
    box-shadow: 0 4px 12px rgba(18, 114, 58, 0.2);
}

.cp-shop-now-btn:hover {
    background-color: #0c5229 !important;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 992px) {
    .cp-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .cp-grid-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .cp-modal-body {
        flex-direction: column;
    }
    
    .cp-modal-image-container {
        border-right: none;
        border-bottom: 1px solid #f1f1f1;
        padding: 20px;
        max-height: 220px;
    }
    
    .cp-modal-details {
        padding: 25px 20px;
    }
}