/* ==========================================================================
   Subscription Grid Layout
   ========================================================================== */
.subscription-grid {
    display: grid;
    /* Create 5 columns, but allow them to wrap on smaller screens */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* 1280px / 5 = 240px */
    gap: 20px;
    align-items: stretch; 
}


/* ==========================================================================
   Pricing Card Component
   ========================================================================== */
.pricing-card {
    display: flex;
    flex-direction: column;
    height: 100%; 
    background-color: var(--color-bg-white);
    position: relative; /* For the banner positioning */
    border: 1px solid #D8D8D8; 
    border-radius: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* --- Card Header --- */
.pricing-card__header {
    padding: 20px;
    border-top-left-radius: 19px;
    border-top-right-radius: 19px;
    border-bottom: 1px solid #D8D8D8;
}
.pricing-card__title {
    color: var(--color-text-white);
    text-align: center;
    text-transform: uppercase;
}
.pricing-card__title i {
    color: var(--color-brand-yellow);
}

/* Header Color Modifiers */
.pricing-card__header--quickstart { background-color: #5D814B; }
.pricing-card__header--kickstarter,
.pricing-card__header--achiever,
.pricing-card__header--trailblazer { background-color: var(--color-bg-primary); }
.pricing-card__header--premium { background-color: #966913; }


/* --- Card Body --- */
.pricing-card__body {
    display: flex;
    flex-direction: column;
    text-align: center;
    background-color: var(--color-bg-white); 
    flex-grow: 1;
}

/* --- Price --- */
.pricing-card__price {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 199px;
    padding: 20px;
    gap: 10px;
    border-bottom: 1px solid #D8D8D8;
}
.pricing-card__price-meta {
    gap: 2px;
    font-weight: 500;
}
.pricing-card__savings {
    padding: 2px 10px;
    border-radius: 100px;
    background-color: #D5F8C2;
    margin: 0 auto;
}
.pricing-card__savings--premium {
    background-color: #966913;
    color: var(--color-text-white);
}

/* --- Features List --- */
.pricing-card__features {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 20px;
    padding: 20px;
    margin: 0;
    list-style: none;
    flex-grow: 1;
}
.pricing-card__features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.pricing-card__features li i {
    flex-shrink: 0;
    font-size: 12px;
    margin-top: 6px; 
}

/* --- Card Footer --- */
.pricing-card__footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 163px;
    padding: 20px;
    gap: 5px;
    border-bottom-left-radius: 19px;
    border-bottom-right-radius: 19px;
    background-color: #F2F2F2;
    border-top: 1px solid var(--color-border-default); /* Top separator */
}
.pricing-card__original-price {
    color: #ADADAD;
    text-decoration: line-through;
}
.pricing-card__discount {
    padding: 2px 10px;
    border-radius: 100px;
    margin: 0 auto;
    color: #4C4C4C;
    border: 1px solid #DCDCDC;
}

/* --- Premium Card Modifier --- */
.pricing-card--premium {
    border: 4px solid #966913;
    background-color: #966913; 
    z-index: 2; /* Sit on top */
}
.pricing-card--premium .pricing-card__header {
    border-top-left-radius: 16px; 
    border-top-right-radius: 16px;
}
.pricing-card--premium .pricing-card__footer {
    border-bottom-left-radius: 16px; 
    border-bottom-right-radius: 16px;
}

/* --- Intro Price Banner --- */
.pricing-card__banner {
    position: absolute;
    top: 102px; 
    right: -56px;
    background-color: #966913;
    color: var(--color-text-white);
    border-radius: 5px 5px 0 0;
    padding: 2px 5px;
    transform: rotate(90deg);
    transform-origin: center;
    white-space: nowrap;
    text-transform: uppercase;
}
.pricing-card__banner i {
    color: var(--color-brand-yellow);
}





/* --- 1. TABLE SETUP --- */
.subscription-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0; 
}

/* First column width */
.subscription-table .col-auto {
    width: 13%; 
}

/* Spacer column width */
.subscription-table .col-spacer {
    width: 20px;
}

/* --- 2. GENERAL CELL STYLING --- */
.subscription-table th,
.subscription-table td {
    padding: 20px;
    text-align: center;
    vertical-align: middle;
}

/* First column left-aligned */
.subscription-table th:first-child,
.subscription-table td:first-child {
    text-align: left;
    vertical-align: middle;
}

/* Spacer cells have no padding and transparent by default. */
.subscription-table .spacer-cell {
    padding: 0;
    background: transparent;
}

/* Ribbon styles */
.ribbon-wrapper { position: relative; }
.ribbon-img { 
    position: absolute; 
    top: -32px; 
    right: -50px; 
    width: 60px; 
    height: auto; 
    z-index: 2; 
}

/* --- 3. BORDERS & RADIUS --- */
/* THEAD BORDERS: Apply ONLY the top, left, and right borders. */
.subscription-table thead th:nth-child(n+2):not(.spacer-cell) {
    border-top: 1px solid var(--color-border-default);
    border-left: 1px solid var(--color-border-default);
    border-right: 1px solid var(--color-border-default);
}

/* TBODY BORDERS: Apply ONLY the left and right borders to create vertical lines. */
.subscription-table tbody td:nth-child(n+2):not(.spacer-cell) {
    border-left: 1px solid var(--color-border-default);
    border-right: 1px solid var(--color-border-default);
}

/* LAST ROW BORDER: Add the bottom border ONLY to the last row of the plans. */
.subscription-table tbody tr:last-child td:nth-child(n+2):not(.spacer-cell) {
    border-bottom: 1px solid var(--color-border-default);
}

/* BORDER RADIUS: Apply to the correct corners. This works due to 'border-collapse: separate'. */
/* Top corners on ALL plan headers */
.subscription-table thead th:nth-child(n+2):not(.spacer-cell) {
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}
/* Bottom corners on ALL plan cells in the LAST row */
.subscription-table tbody tr:last-child td:nth-child(n+2):not(.spacer-cell) {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

/* --- 4. VERTICAL SPACING & ROW COLORING --- */
/* Style the empty spacer rows */
.subscription-table tbody tr.spacer-row td {
    padding: 0;
    height: 10px;
    background: transparent;
    border: none;
}
  
/* Apply background color to the ENTIRE row (tr) */
.subscription-table tbody tr:nth-child(2) {
    background-color: #ededed;
}
.subscription-table tbody tr:nth-child(4) {
    background-color: #dff9ec;
}
.subscription-table tbody tr:nth-child(6) {
    background-color: #458a67;
    color: var(--color-text-white);
}

/* Ensure text color change is inherited by all children elements in the colored row */
.subscription-table tbody tr:nth-child(6) * {
    color: var(--color-text-white);
}

.subscription-early-bird-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subscription-early-bird-label .fa-circle-info {
    margin-left: 4px;
    flex-shrink: 0;
}

.subscription-discount-tag {
    display: inline-block;
    color: #ffd9ac;
    margin-bottom: 4px;
    padding: 5px;
    border-radius: 5px;
    background-color: var(--color-brand-secondary);
}

.subscription-discount-price {
    display: block;
}

.features-list {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 20px;
}

.features-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.features-list li i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 12px;
}

.subscribe-footer {
    border-top: 1px solid var(--color-border-default) !important;
}

.mobile-subscription-grid {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.mobile-subscription-card {
    background-color: var(--color-bg-white);
    border-radius: 20px;
    border: 1px solid var(--color-border-default);
}

.mobile-subscription-card-header {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-white);
    text-align: center;
    padding: 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.mobile-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.long-term-discount {
    background-color: #dff9ec;
}

.early-bird-discount {
    background-color: #458a67;
    color: var(--color-text-white);
}

.mobile-subscription-card-body {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 20px;
}

.mobile-subscription-btn {
    width: 100%;
}

/* Responsive Styles */
/* Mobile-only: 320px – 767px */
@media (max-width: 767px) {
    .mobile-subscription-grid {
        display: flex;
    }
}

/* Tablet-only: 768px – 1365px */
@media (min-width: 768px) and (max-width: 1365px) {
    .mobile-subscription-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .mobile-subscription-grid > *:nth-last-child(1):nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

/* Mobile and Tablet: 1365px below */
@media (max-width: 1365px) {
    .subscription-table {
        display: none;
    }
    
    .ribbon-img {
        top: -15px;
        right: -25px;
        width: 50px;
    }
}