/*
 * Styles for Plan Archives (Taxonomy Pages) and Plan Shortcodes
 * VERSION 4.3: Reduced button sizes on plan cards as requested.
 */

/* ==========================================================================
   1. Modern Archive Hero (Replaces old Hero Section)
   ========================================================================== */
.archive-hero-modern {
    background-color: var(--py-card-bg);
    padding: 40px 0;
    border-bottom: 1px solid var(--py-border-color);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

/* Optional: Add a subtle background accent */
.archive-hero-modern::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(135deg, rgba(var(--py-primary-rgb), 0.03) 0%, rgba(var(--py-primary-rgb), 0.08) 100%);
    clip-path: polygon(20% 0%, 100% 0, 100% 100%, 0% 100%);
    z-index: 0;
}

.archive-hero-inner {
    display: flex;
    align-items: center;
    gap: 40px;
    position: relative;
    z-index: 1;
}

/* Brand Logo Styling */
.archive-brand-logo {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    background: #fff;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border: 1px solid var(--py-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.archive-brand-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Content Styling */
.archive-hero-content {
    flex: 1;
}

.archive-subtitle {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--py-primary-color);
    margin-bottom: 10px;
    background: rgba(var(--py-primary-rgb), 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.archive-hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--py-secondary-color);
    line-height: 1.2;
}

.archive-hero-desc {
    font-size: 1.05rem;
    color: var(--py-text-light);
    max-width: 800px;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Stats Badges */
.archive-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--py-text-color);
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--py-border-color);
}

.stat-badge i {
    color: var(--py-primary-color);
}

/* ==========================================================================
   2. Filter Controls (Unified Sidebar Style)
   ========================================================================== */

/* 
 * Filter Toggle Button (Floating Action Button)
 */
.mobile-filter-btn {
    display: inline-flex;
    position: fixed;
    bottom: 90px; 
    right: 30px;
    z-index: 990;
    background-color: var(--py-primary-color);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(var(--py-primary-rgb), 0.4); 
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.mobile-filter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(var(--py-primary-rgb), 0.6);
    background-color: var(--py-primary-dark);
}

/* Filter Overlay (Background Dimmer) */
.filter-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.filter-popup-overlay.active {
    display: block;
    opacity: 1;
}

/* 
 * Filter Container Wrapper (Sidebar Style) 
 */
.filter-container-wrapper {
    position: fixed;
    top: 0;
    right: -450px;
    width: 380px;
    height: 100%;
    background-color: #fff;
    z-index: 10001;
    box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.filter-container-wrapper.active {
    right: 0;
}

/* Header inside Sidebar - COMPACT */
.filter-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--py-border-color);
    background: #fff;
    flex-shrink: 0;
}

.filter-header-mobile h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--py-secondary-color);
    font-weight: 700;
}

.close-filter-btn {
    background: #f1f3f5;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.close-filter-btn:hover {
    background-color: #e9ecef;
    color: #000;
    transform: rotate(90deg);
}

/* Main Scrollable Area - COMPACT */
.filter-container {
    display: flex;
    flex-direction: column;
    padding: 15px;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

/* Input Styling - COMPACT */
.filter-container select,
.filter-container button {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background-color: #f8f9fa;
    cursor: pointer;
    color: var(--py-text-color);
    transition: border-color 0.2s, background-color 0.2s;
    margin-bottom: 10px; 
}

.filter-container select:hover,
.filter-container select:focus {
    border-color: var(--py-accent-color);
    background-color: #fff;
    outline: none;
}

/* Reset Button Specifics */
#reset-filters {
    background: #fff;
    color: #6c757d;
    border: 1px dashed #6c757d;
    margin-top: 5px;
    margin-bottom: 0;
    padding: 6px 12px;
}

#reset-filters:hover {
    background: #f8f9fa;
    color: #343a40;
    border-color: #343a40;
}

/* Feature Selector Styling - COMPACT */
.feature-selector { 
    width: 100%; 
    padding: 0 15px 15px;
}

/* Desktop Feature Checkboxes - GRID LAYOUT (2 Columns) */
.feature-checkboxes { 
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px; 
}

.feature-checkbox { 
    display: flex; 
    align-items: center; 
    padding: 6px 10px;
    background: #fff; 
    border: 1px solid #e2e8f0; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    color: var(--py-text-color); 
    font-size: 12px;
    width: 100%; 
    justify-content: space-between;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.feature-checkbox input[type="checkbox"] { 
    margin-left: 6px; 
    accent-color: var(--py-accent-color); 
    transform: scale(1.1);
}

.feature-checkbox:hover { 
    background: #f8f9fa; 
    border-color: var(--py-accent-color);
}

.feature-checkbox input[type="checkbox"]:checked + span { 
    font-weight: 600; 
    color: var(--py-secondary-color); 
}

/* Hide the mobile dropdown by default */
#filter-feature-mobile { 
    display: none; 
}

/* Footer inside Sidebar - COMPACT */
.filter-footer-mobile {
    display: block;
    padding: 15px;
    border-top: 1px solid var(--py-border-color);
    background: #fff;
    flex-shrink: 0;
}

.apply-filters-btn {
    width: 100%;
    background-color: var(--py-primary-color);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 5px rgba(var(--py-primary-rgb), 0.3);
}

.apply-filters-btn:hover {
    background-color: var(--py-primary-dark);
    transform: translateY(-1px);
}

/* ==========================================================================
   3. Plans Grid & Card Styling
   ========================================================================== */

.plans-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 25px 0;
}

.plan-card-wrapper {
    display: flex;
    flex-direction: column;
    background-color: var(--py-card-bg);
    border-radius: var(--py-border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.plan-card-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.plan-card {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.plan-card-link-area {
    padding: 15px;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--py-border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.plan-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--py-secondary-color);
    margin: 0;
}
.operator-logo {
    height: 40px;
    margin-left: 12px;
    flex-shrink: 0;
}

.plan-validity-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.plan-validity, .plan-price {
    font-size: 14px;
    color: var(--py-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ACCESSIBILITY FIX: Changed price color and background for better contrast. */
.plan-price {
    font-weight: 700;
    color: #C05600; /* Was #ff5e00 */
    background: #FFF8F0; /* Was rgba(255, 140, 0, 0.1) */
    padding: 4px 8px;
    border-radius: 5px;
}

.plan-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: auto;
    margin-bottom: 12px;
    flex-grow: 1;
}
.plan-item {
    padding: 10px;
    border-radius: 6px;
    background-color: #f8f8f8;
    display: flex;
    align-items: center;
    gap: 8px;
}
.plan-item i {
    color: var(--py-accent-color);
    font-size: 16px;
}
.plan-value-label { line-height: 1.2; }
.plan-value-label strong { font-weight: 600; font-size: 14px; color: var(--py-secondary-color); display: block; }
.plan-value-label span { font-size: 10px; color: var(--py-text-light); font-weight: 400; }

.plan-card-actions {
    margin-top: auto;
    padding: 10px 15px 15px 15px;
    border-top: 1px solid #f0f0f0;
    display: grid;
    grid-template-columns: 1fr auto; /* Give more space to compare, less to favorite */
    gap: 10px;
    align-items: center;
}
/* UPDATED: Reduced padding for the favorite button */
.plan-card-actions .favorite-button {
    padding: 6px; /* Was 8px */
}
.plan-card-actions .favorite-button .favorite-text {
    display: none; /* Hide text on cards */
}

/* ==========================================================================
   4. Other Elements
   ========================================================================== */

.load-more-container { text-align: center; margin: 20px 0; }
/* UPDATED: Reduced padding and font-size for the activate/load-more button */
.activate-btn, .load-more-container button {
    display: inline-block;
    background: linear-gradient(45deg, var(--py-accent-color), #ff3c00);
    color: white !important;
    text-align: center;
    padding: 8px 20px; /* Was 10px 25px */
    border-radius: 6px;
    font-size: 14px; /* Was 15px */
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(255, 60, 0, 0.3);
}
.activate-btn:hover, .load-more-container button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 60, 0, 0.4);
}

#no-plans-message {
    text-align: center;
    margin-top: 25px;
    font-size: 18px;
    color: var(--py-accent-color);
    font-weight: 600;
    grid-column: 1 / -1;
}

/* 
 * UPDATED: Taxonomy Description (Simple Text Style)
 */
.taxonomy-description {
    margin-top: 40px;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    line-height: 1.8;
    color: var(--py-text-color);
    font-size: 1rem;
}

.taxonomy-description h2, 
.taxonomy-description h3 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.taxonomy-description p {
    margin-bottom: 1.5em;
}

/* ==========================================================================
   5. Sticky Wrapper Styles
   ========================================================================== */

#sticky-bars-wrapper {
    position: relative;
    z-index: 998;
}

#sticky-bars-wrapper.is-sticky-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}


/* ==========================================================================
   6. Responsive Styles (Mobile Specific Adjustments)
   ========================================================================== */

@media (max-width: 768px) {
    /* 
     * MODERN HERO MOBILE LAYOUT
     * Logo Left | Content Right (Side-by-Side)
     */
    .archive-hero-modern {
        padding: 20px 0; /* Reduced padding */
    }

    .archive-hero-inner {
        flex-direction: row; /* Force Row Direction */
        align-items: center; /* Vertically Center */
        text-align: left; /* Left Align Text */
        gap: 15px; /* Small Gap */
    }
    
    /* Fixed Small Logo on Left */
    .archive-brand-logo {
        flex: 0 0 80px; /* Fixed Width */
        width: 80px;
        height: 80px;
        padding: 10px;
        margin: 0; /* Remove auto margins */
        border-radius: 12px;
    }
    
    /* Content Area on Right */
    .archive-hero-content {
        flex: 1; /* Take remaining space */
        min-width: 0; /* Prevent overflow */
    }

    .archive-subtitle {
        font-size: 0.7rem;
        padding: 2px 8px;
        margin-bottom: 5px;
    }
    
    .archive-hero-content h1 {
        font-size: 1.4rem; /* Smaller Heading */
        margin-bottom: 5px;
        line-height: 1.2;
    }

    /* Description - Small & Compact */
    .archive-hero-desc {
        font-size: 0.85rem;
        margin-bottom: 8px;
        line-height: 1.4;
        display: block; /* Ensure it's visible */
        /* Optional: Truncate to 2 lines if too long */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Stats - Left Aligned & Compact */
    .archive-stats {
        justify-content: flex-start;
        gap: 8px;
    }

    .stat-badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Adjust Sidebar Width for Mobile */
    .filter-container-wrapper {
        width: 85%;
        max-width: 320px;
    }

    /* Adjust Floating Button for Mobile */
    .mobile-filter-btn {
        bottom: 90px;
        right: 20px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Mobile Feature Selector Logic */
    .feature-checkboxes { 
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    #filter-feature-mobile { 
        display: none;
    }

    .plans-container { grid-template-columns: 1fr; }
}