/* Mobile Pricing Layout Fixes */
@media (max-width: 768px) {

    /* 
       1. Category Buttons: 3 on top, 2 below 
       We allow wrapping and set specific widths.
    */
    .pricing-period-selector {
        display: flex;
        flex-flow: row wrap;
        gap: 8px;
        /* adjustments for spacing */
        justify-content: center;
        background: transparent !important;
        /* ensure no weird background overrides */
        padding: 10px 0;
    }

    .period-btn {
        flex: 1 1 auto;
        width: 30% !important;
        /* Force roughly 3 per row */
        max-width: 32%;
        font-size: 0.85rem;
        padding: 8px 4px;
        white-space: normal;
        /* allow text to wrap inside button if needed */
        line-height: 1.2;
        height: auto;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    /* Force the last two buttons to take up 50% each (minus gap) to center them nicely below */
    .period-btn:nth-last-child(2),
    .period-btn:last-child {
        width: 48% !important;
        max-width: 48%;
    }

    /* 
       2. Pricing Cards: Fix missing cards and stacking
       On mobile, we just want a vertical stack, regardless of card count.
    */
    .pricing-grid,
    .pricing-grid[data-card-count] {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr !important;
        /* Override grid if it was using grid */
        gap: 20px;
        width: 100%;
        margin-top: 20px;
    }

    /* Reset any specific width constraints from desktop grid systems */
    .pricing-grid>div,
    .price-plan-1,
    .price-plan-2,
    .price-plan-3,
    .price-plan-4,
    .price-plan-5 {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* 
       Button Styling Updates 
       - Bolder text
       - Smaller text
       - Two lines: Objednat \n Službu
    */
    .pricing-grid .btn.primary {
        font-weight: 800 !important;
        /* Bolder */
        font-size: 0.9rem !important;
        /* Smaller */
        padding: 12px 20px !important;
        line-height: 1.3;
        height: auto;
        display: inline-block;
    }

    .mobile-break {
        display: block;
        width: 100%;
    }

    /* 
       3. Spacing and Overlap Fixes
    */
    /* Ensure section padding prevents overlap */
    section.pricing {
        padding-top: 60px;
        padding-bottom: 60px;
        overflow: visible;
        /* Prevent cutting off shadows */
    }

    /* Fix potential overlap of category buttons with content above */
    .pricing-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* Adjust card internal spacing */
    .pricing-grid>div {
        padding: 20px;
        margin-bottom: 0px !important;
        /* gap handles spacing */
    }
}