/**
 * SuiteCRM Products Frontend Styles
 */

/* Product Card */
.scrm-product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.scrm-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Product Name */
.scrm-product-name {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

/* Product Price */
.scrm-product-price {
    font-size: 32px;
    font-weight: 700;
    color: #2c5aa0;
    margin-bottom: 16px;
}

/* Product Description */
.scrm-product-description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Product Features */
.scrm-product-features {
    margin-top: 20px;
}

.scrm-product-features h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.scrm-product-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scrm-product-features ul li {
    padding: 8px 0 8px 28px;
    position: relative;
    color: #555;
    font-size: 15px;
    line-height: 1.5;
}

.scrm-product-features ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: 700;
    font-size: 18px;
}

/* Features List Styles */
.scrm-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scrm-features li {
    padding: 10px 0 10px 32px;
    position: relative;
    color: #555;
    font-size: 16px;
    line-height: 1.5;
    border-bottom: 1px solid #f0f0f0;
}

.scrm-features li:last-child {
    border-bottom: none;
}

/* Checkmark style */
.scrm-features-checkmarks li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: 700;
    font-size: 20px;
}

/* Bullets style */
.scrm-features-bullets li {
    list-style: disc;
    list-style-position: inside;
    padding-left: 0;
}

/* Products Grid */
.scrm-products-grid {
    display: grid;
    gap: 24px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .scrm-products-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .scrm-products-grid[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Pricing Card Specific Styles */
.scrm-pricing-card {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 40px 30px;
    max-width: 400px;
    margin: 0 auto;
}

.scrm-pricing-card .scrm-product-name {
    color: white;
    font-size: 28px;
}

.scrm-pricing-card .scrm-product-price {
    color: white;
    font-size: 48px;
    margin: 20px 0;
}

.scrm-pricing-card .scrm-product-features ul li {
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.scrm-pricing-card .scrm-product-features ul li:before {
    color: #fff;
}

/* Button Styles */
.scrm-cta-button {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 14px 32px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.3s ease;
    margin-top: 20px;
}

.scrm-cta-button:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

/* Loading State */
.scrm-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.scrm-loading:before {
    content: "";
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: scrm-spin 1s linear infinite;
}

@keyframes scrm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.scrm-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 20px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

/* Pricing Grid Layout */
.scrm-pricing-grid,
.content.container .scrm-pricing-grid,
.container .scrm-pricing-grid,
div.scrm-pricing-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: auto !important;
    gap: 40px !important;
    max-width: 100% !important;
    margin: 40px auto !important;
    padding: 30px 0 0 0 !important; /* Top padding to account for badge */
    align-items: start !important; /* Align all to top */
    width: 100% !important;
    grid-auto-flow: row !important;
}

/* Force direct children to be grid items */
.scrm-pricing-grid > *,
.content.container .scrm-pricing-grid > *,
.container .scrm-pricing-grid > * {
    grid-column: span 1 !important;
}

/* Hide empty p tags that WordPress adds around HTML comments */
.scrm-pricing-grid > p:empty,
.content.container .scrm-pricing-grid > p:empty,
.container .scrm-pricing-grid > p:empty,
.scrm-pricing-grid > p:not(.description) {
    display: none !important;
}

/* Individual Pricing Card - ALL DEVICES */
.scrm-pricing-grid .scrm-pricing-item,
.content.container .scrm-pricing-grid .scrm-pricing-item,
.container .scrm-pricing-grid .scrm-pricing-item {
    background: #fff !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 12px !important;
    padding: 40px 30px !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    position: relative !important;
    box-sizing: border-box !important;
}

/* Card styling for all devices */
.scrm-pricing-grid .scrm-pricing-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.scrm-pricing-grid .scrm-pricing-item.featured {
    border-color: #2c5aa0;
    border-width: 3px;
}

/* Desktop: Force grid display */
@media (min-width: 769px) {
    .scrm-pricing-grid {
        display: grid !important;
    }
}

@media (max-width: 992px) and (min-width: 769px) {
    .scrm-pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* FORCE HIDE desktop grid AND its items on mobile with maximum specificity */
    .scrm-pricing-grid,
    .scrm-pricing-grid .scrm-pricing-item,
    .content.container .scrm-pricing-grid,
    .content.container .scrm-pricing-grid .scrm-pricing-item,
    .container .scrm-pricing-grid,
    .container .scrm-pricing-grid .scrm-pricing-item,
    .scrm-pricing-grid.d-none.d-md-block,
    .scrm-pricing-grid.d-none.d-md-block .scrm-pricing-item {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    /* Ensure mobile tab content takes full width */
    .tab-content {
        width: 100%;
        max-width: 100%;
    }
    
    .tab-content .tab-pane {
        width: 100%;
        max-width: 100%;
    }
    
    .tab-content .tab-pane > div {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

.scrm-pricing-grid .scrm-pricing-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: #2c5aa0;
}

/* Ensure featured card doesn't have extra top space */
.scrm-pricing-grid .scrm-pricing-item.featured,
.content.container .scrm-pricing-grid .scrm-pricing-item.featured,
.container .scrm-pricing-grid .scrm-pricing-item.featured {
    border-color: #2c5aa0 !important;
    border-width: 3px !important;
    position: relative !important;
    margin: 0 !important;
}

.scrm-pricing-grid .scrm-pricing-item h2,
.content.container .scrm-pricing-grid .scrm-pricing-item h2,
.container .scrm-pricing-grid .scrm-pricing-item h2 {
    font-size: 28px !important;
    font-weight: 800 !important;
    color: var(--h2-fg, #034e94) !important;
    margin: 0 0 20px 0 !important;
    background: var(--h2-bg, #ffd866) !important;
    display: block !important;
    padding: 0.15em 0.45em !important;
    box-shadow: 0 2px 0 rgba(0,0,0,0.06) !important;
    border-radius: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.scrm-pricing-grid .scrm-pricing-item .price {
    font-size: 48px;
    font-weight: bold;
    color: #2c5aa0;
    margin: 20px 0;
}

.scrm-pricing-grid .scrm-pricing-item .description {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.scrm-pricing-grid .scrm-pricing-item .features-box {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    text-align: left;
    margin: 20px 0;
    flex-grow: 1;
}

.scrm-pricing-grid .scrm-pricing-item .features-box h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--heading-h3, #1e2ba3) !important;
    margin: 0 0 15px 0;
    background: transparent !important;
    display: block !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.scrm-pricing-grid .scrm-pricing-item .cta-button {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 600;
    transition: background 0.3s ease;
    margin-top: 20px;
}

.scrm-pricing-grid .scrm-pricing-item .cta-button:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

/* Featured badge */
.scrm-pricing-grid .scrm-pricing-item.featured::before,
.content.container .scrm-pricing-grid .scrm-pricing-item.featured::before {
    content: "Most Popular" !important;
    position: absolute !important;
    top: -20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #2c5aa0 !important;
    color: white !important;
    padding: 5px 20px !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    z-index: 10 !important;
}
