/*
 * Styles for Plan Archives (Taxonomy Pages) and Plan Shortcodes
 * File: assets/css/archives/plan-archive.css
 * Version: 11.0 (Fixed Favorite Button Layout)
 */

/* ==========================================================================
   1. Modern Archive Hero
   ========================================================================== */
.archive-hero-modern {
    background-color: var(--py-card-bg);
    padding: 40px 0;
    border-bottom: 1px solid var(--py-border-color);
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.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: grid; 
    grid-template-columns: 110px 1fr auto; 
    grid-template-rows: auto auto;
    column-gap: 25px; 
    row-gap: 10px; 
    align-items: start; 
    position: relative; 
    z-index: 1;
}

.archive-brand-logo {
    grid-column: 1 / 2; 
    grid-row: 1 / 3; 
    width: 110px; 
    height: 110px;
    background: #fff; 
    border-radius: 20px; 
    padding: 15px;
    box-shadow: var(--py-shadow-soft); 
    border: 1px solid var(--py-border-color);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    align-self: start; 
    flex: none;
}

.archive-brand-logo img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}

.archive-hero-content { 
    display: contents; 
}

.archive-hero-content h1, 
.archive-main-title {
    grid-column: 2 / 3; 
    grid-row: 1 / 2; 
    font-size: 2.5rem; 
    margin: 0;
    color: var(--py-secondary-color); 
    line-height: 1.1; 
    align-self: center;
}

.archive-stats {
    grid-column: 3 / 4; 
    grid-row: 1 / 2; 
    display: flex; 
    gap: 10px;
    justify-content: flex-end; 
    align-self: center;
}

.stat-badge {
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    font-size: 0.85rem;
    font-weight: 600; 
    color: var(--py-text-color); 
    background: var(--py-bg-color);
    padding: 8px 16px; 
    border-radius: 50px; 
    border: 1px solid var(--py-border-color);
    white-space: nowrap;
}

.stat-badge i { 
    color: var(--py-primary-color); 
}

.archive-hero-desc, 
.archive-desc-wrapper {
    grid-column: 2 / 4; 
    grid-row: 2 / 3; 
    font-size: 1.05rem;
    color: var(--py-text-light); 
    margin: 0; 
    line-height: 1.6; 
    width: 100%;
}

/* ==========================================================================
   1.5. Quick Filters Bar
   ========================================================================== */
.quick-filters-bar {
    display: flex; 
    overflow-x: auto; 
    white-space: nowrap; 
    padding: 15px; 
    margin-bottom: 25px; 
    margin-top: 20px; 
    background-color: var(--py-card-bg);
    border: 1px solid var(--py-border-color); 
    border-radius: 16px;
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    align-items: center; 
    gap: 10px;
    box-shadow: var(--py-shadow-soft);
}

.quick-filters-bar::-webkit-scrollbar { 
    display: none; 
}

.quick-filter-btn {
    background: var(--py-bg-color); 
    border: 1px solid var(--py-border-color);
    color: var(--py-text-color); 
    padding: 8px 18px; 
    border-radius: 50px;
    font-size: 0.9rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    flex-shrink: 0;
}

.quick-filter-btn:hover {
    border-color: var(--py-primary-color); 
    color: var(--py-primary-color); 
    transform: translateY(-2px);
}

.quick-filter-btn.active {
    background-color: var(--py-primary-color); 
    color: #fff; 
    border-color: var(--py-primary-color);
    box-shadow: 0 4px 15px rgba(var(--py-primary-rgb), 0.3);
}

/* ==========================================================================
   2. Filter Controls (Mobile Button & Sidebar)
   ========================================================================== */
.mobile-filter-btn {
    display: inline-flex; 
    position: fixed; 
    bottom: 30px; 
    right: 20px; 
    z-index: 990;
    background-color: var(--py-primary-color); 
    color: #fff; 
    border: none;
    padding: 12px 24px; 
    border-radius: 50px; 
    font-weight: 600; 
    font-size: 0.95rem;
    cursor: pointer; 
    box-shadow: 0 10px 25px rgba(var(--py-primary-rgb), 0.4);
    align-items: center; 
    gap: 8px; 
    transition: all 0.3s ease;
}

.mobile-filter-btn:hover { 
    transform: translateY(-3px); 
    background-color: var(--py-primary-dark); 
}

.filter-popup-overlay {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(15, 23, 42, 0.8); 
    z-index: 10000; 
    opacity: 0; 
    transition: opacity 0.3s ease; 
    backdrop-filter: blur(4px);
}

.filter-popup-overlay.active { 
    display: block; 
    opacity: 1; 
}

.filter-container-wrapper {
    position: fixed; 
    top: 0; 
    right: -450px; 
    width: 320px; 
    height: 100%;
    background-color: var(--py-card-bg); 
    z-index: 10001; 
    box-shadow: -10px 0 40px rgba(0,0,0,0.2);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    flex-direction: column;
}

.filter-container-wrapper.active { 
    right: 0; 
}

.filter-header-mobile {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 20px; 
    border-bottom: 1px solid var(--py-border-color); 
    flex-shrink: 0;
}

.filter-header-mobile h3 { 
    margin: 0; 
    font-size: 1.2rem; 
    font-weight: 700; 
}

.close-filter-btn {
    background: var(--py-bg-color); 
    border: none; 
    width: 36px; 
    height: 36px;
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 16px; 
    color: var(--py-text-color); 
    cursor: pointer; 
    transition: all 0.2s;
}

.close-filter-btn:hover { 
    background: rgba(var(--py-primary-rgb), 0.1); 
    color: var(--py-primary-color); 
    transform: rotate(90deg); 
}

.filter-container { 
    padding: 20px; 
    overflow-y: auto; 
    flex-grow: 1; 
}

.filter-container select, 
.filter-container button {
    width: 100%; 
    padding: 12px 15px; 
    font-size: 0.95rem; 
    border-radius: 12px;
    border: 1px solid var(--py-border-color); 
    background-color: var(--py-bg-color); 
    margin-bottom: 15px;
}

#reset-filters { 
    background: transparent; 
    color: var(--py-text-light); 
    border: 1px dashed var(--py-border-color); 
    font-weight: 600; 
}

#reset-filters:hover { 
    border-color: var(--py-primary-color); 
    color: var(--py-primary-color); 
}

.feature-selector { 
    padding: 0 20px 20px; 
}

.feature-checkboxes { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
}

.feature-checkbox {
    display: flex; 
    align-items: center; 
    padding: 10px 12px;
    background: var(--py-bg-color); 
    border: 1px solid var(--py-border-color); 
    border-radius: 8px;
    font-size: 0.85rem; 
    justify-content: space-between; 
    cursor: pointer;
}

.filter-footer-mobile { 
    padding: 20px; 
    border-top: 1px solid var(--py-border-color); 
}

.apply-filters-btn {
    width: 100%; 
    background-color: var(--py-primary-color); 
    color: #fff;
    border: none; 
    padding: 14px; 
    border-radius: 12px; 
    font-weight: 600; 
    font-size: 1rem;
}

/* ==========================================================================
   3. Plans Grid & Card Styling (Premium UI)
   ========================================================================== */
.plans-container {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 25px; 
    padding: 15px 0;
}

.plan-card-wrapper {
    background: var(--py-card-bg); 
    border-radius: var(--py-border-radius-lg);
    box-shadow: var(--py-shadow-soft); 
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    position: relative;
}

.plan-card-wrapper:hover { 
    transform: translateY(-8px); 
    box-shadow: var(--py-shadow-float); 
    border-color: var(--py-primary-color); 
}

.plan-card { 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
}

.plan-card-link-area { 
    padding: 25px; 
    color: inherit; 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
}

.plan-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 20px; 
}

.plan-title { 
    font-size: 1.15rem; 
    font-weight: 700; 
    color: var(--py-secondary-color); 
    margin: 0; 
    line-height: 1.3; 
}

.operator-logo { 
    height: 35px; 
    object-fit: contain; 
}

.plan-validity-price { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
}

.plan-validity { 
    font-size: 0.9rem; 
    color: var(--py-text-light); 
    font-weight: 500; 
}

/* Glow Badge for Price */
.glow-badge {
    background: rgba(var(--py-primary-rgb), 0.1); 
    color: var(--py-primary-color);
    padding: 6px 12px; 
    border-radius: 8px; 
    font-weight: 800; 
    font-size: 1.1rem;
    box-shadow: 0 0 15px rgba(var(--py-primary-rgb), 0.2); 
    border: 1px solid rgba(var(--py-primary-rgb), 0.2);
}

.plan-details { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
    margin-top: auto; 
}

.plan-item { 
    padding: 12px; 
    border-radius: 12px; 
    background: var(--py-bg-color); 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    border: 1px solid var(--py-border-color); 
}

.plan-item i { 
    color: var(--py-accent-color); 
    font-size: 1.1rem; 
}

.plan-value-label strong { 
    font-weight: 700; 
    font-size: 0.95rem; 
    display: block; 
    color: var(--py-secondary-color); 
}

.plan-value-label span { 
    font-size: 0.75rem; 
    color: var(--py-text-light); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}

/* ==========================================================================
   4. Seamless Actions (Buttons inside Card) - FIXED LAYOUT
   ========================================================================== */
.seamless-actions {
    display: grid; 
    grid-template-columns: 1fr 42px 42px; /* Fixed width for icons */
    gap: 10px;
    padding: 15px 25px; 
    background: var(--py-bg-color); 
    border-top: 1px solid var(--py-border-color);
}

.subscribe-btn {
    background: var(--py-primary-color); 
    color: white !important; 
    padding: 10px;
    border-radius: 10px; 
    font-weight: 600; 
    text-align: center; 
    transition: all 0.2s; 
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subscribe-btn:hover { 
    background: var(--py-primary-dark); 
    transform: scale(1.02); 
}

/* Compare & Favorite Icon Buttons - Forced Square */
.seamless-actions .py-icon-btn, 
.seamless-actions .favorite-button {
    width: 42px !important; 
    height: 42px !important; 
    padding: 0 !important; /* Override default button padding */
    border-radius: 10px; 
    background: var(--py-card-bg);
    border: 1px solid var(--py-border-color); 
    color: var(--py-text-light);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s; 
    cursor: pointer; 
}

.seamless-actions .py-icon-btn:hover, 
.seamless-actions .favorite-button:hover {
    background: rgba(var(--py-primary-rgb), 0.1); 
    color: var(--py-primary-color); 
    border-color: var(--py-primary-color);
}

/* HIDE TEXT IN FAVORITE/COMPARE BUTTONS */
.seamless-actions .favorite-button .favorite-text,
.seamless-actions .plan-compare-button span {
    display: none !important;
}

.seamless-actions .favorite-button i,
.seamless-actions .plan-compare-button i {
    margin: 0 !important;
    font-size: 1.1rem;
}

/* Compare Button Active State */
.seamless-actions .plan-compare-button.added { 
    background-color: #10b981; 
    color: white !important; 
    border-color: #10b981; 
}

/* Favorite Button Active State */
.seamless-actions .favorite-button.is-favorite {
    background-color: #f59e0b; 
    color: white !important; 
    border-color: #f59e0b;
}

.seamless-actions .favorite-button.is-favorite:hover {
    background-color: #d97706; 
    border-color: #d97706;
}

.seamless-actions .favorite-button.is-favorite .favorite-icon {
    color: white;
    font-weight: 900;
}

/* ==========================================================================
   5. Skeleton Loader
   ========================================================================== */
.plans-skeleton-loader { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 25px; 
    width: 100%; 
}

.plan-card-skeleton {
    background-color: var(--py-card-bg); 
    border-radius: var(--py-border-radius-lg); 
    border: 1px solid var(--py-border-color);
    padding: 25px; 
    box-shadow: var(--py-shadow-soft); 
    display: flex; 
    flex-direction: column; 
    height: 300px;
    background: #f8fafc; 
    background-image: linear-gradient(to right, #f8fafc 0%, #e2e8f0 20%, #f8fafc 40%);
    background-repeat: no-repeat; 
    background-size: 800px 104px; 
    animation: loading-shimmer 1.5s infinite linear;
}

@keyframes loading-shimmer { 
    0% { background-position: -468px 0; } 
    100% { background-position: 468px 0; } 
}

.skeleton-line, 
.skeleton-box { 
    background: #cbd5e0; 
    border-radius: 8px; 
    margin-bottom: 15px; 
}

.skeleton-header { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 20px; 
}

.skeleton-line.short { 
    width: 60%; 
    height: 20px; 
}

.skeleton-box.logo { 
    width: 40px; 
    height: 40px; 
    border-radius: 12px; 
}

.skeleton-meta { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 20px; 
}

.skeleton-line.tiny { 
    width: 30%; 
    height: 14px; 
}

.skeleton-line.price { 
    width: 25%; 
    height: 24px; 
    border-radius: 8px; 
}

.skeleton-details { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
    flex-grow: 1; 
}

.skeleton-box.detail { 
    height: 50px; 
    border-radius: 12px; 
}

/* ==========================================================================
   6. Responsive Styles
   ========================================================================== */
@media (max-width: 768px) {
    .archive-hero-modern { 
        padding: 30px 0; 
    }
    
    .archive-hero-inner { 
        grid-template-columns: 80px 1fr; 
        grid-template-rows: auto auto auto; 
        column-gap: 15px; 
    }
    
    .archive-brand-logo { 
        width: 80px; 
        height: 80px; 
        padding: 10px; 
        border-radius: 16px; 
    }
    
    .archive-hero-content h1 { 
        font-size: 1.6rem; 
    }
    
    .archive-hero-desc { 
        font-size: 0.95rem; 
    }
    
    .archive-stats { 
        grid-column: 1 / -1; 
        grid-row: 3 / 4; 
        justify-content: flex-start; 
    }
    
    .quick-filters-bar { 
        padding: 12px; 
    }
    
    .filter-container-wrapper { 
        width: 85%; 
        max-width: 320px; 
    }
    
    .plans-container, 
    .plans-skeleton-loader { 
        grid-template-columns: 1fr; 
    }
    
    .plan-card-link-area { 
        padding: 20px; 
    }
    
    .seamless-actions { 
        padding: 12px 20px; 
    }
    
    .subscribe-btn { 
        font-size: 0.9rem; 
        padding: 10px; 
    }
}