/* Phones Page Specific Styles */

.phones-listing {
    padding: 2rem 0 6rem;
    background: #fdfdfd;
}

/* Category Sub-nav */
.category-subnav {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
}

.category-subnav-scroll {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    -ms-overflow-style: none;
    /* Hide scrollbar IE/Edge */
}

.category-subnav-scroll::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

@media (min-width: 1024px) {
    .category-subnav-scroll {
        justify-content: center;
    }
}

.cat-sub-card {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: #1a1c1d;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cat-sub-card:hover {
    border-color: #1a1c1d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.cat-sub-card.active {
    border-color: #1a1c1d;
    background: #f9f9f9;
}

.cat-sub-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.cat-sub-label {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Mobile Filter Bar Styles */
.mobile-filter-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    /* Explicitly restore container padding */
    margin: 0 auto 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
}

.mob-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f3f4f6;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1c1d;
    cursor: pointer;
    transition: background 0.3s ease;
}

.mob-filter-btn:active {
    background: #e5e7eb;
}

.mob-filter-btn .material-symbols-outlined {
    font-size: 20px;
}

.mob-view-options {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.view-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.view-btn.active {
    color: #1a1c1d;
}

.view-btn .material-symbols-outlined {
    font-size: 24px;
}

/* Sidebar Styling */
.phones-sidebar {
    width: 240px;
    /* Narrower sidebar for more grid space */
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 1.5rem;
}

/* Layout for Sidebar + Grid */
.phones-layout {
    display: flex;
    gap: 2rem;
    /* Reduced gap between sidebar and main content */
    align-items: start;
}

@media (max-width: 1024px) {
    .mobile-filter-bar {
        display: flex;
    }

    .phones-layout {
        flex-direction: column;
        gap: 0;
        /* Remove gap on mobile to prevent horizontal shifts */
    }

    .phones-main {
        width: 100%;
    }

    .phones-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: none;
        height: auto;
        max-height: 85vh;
        background: #fff;
        z-index: 2000;
        padding: 1.5rem 2rem 3rem;
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }

    .phones-sidebar.is-open {
        transform: translateY(0);
    }

    .phones-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1999;
        display: none;
    }

    .phones-sidebar-overlay.is-open {
        display: block;
    }

    .sidebar-drag-handle {
        width: 40px;
        height: 5px;
        background: #e5e7eb;
        border-radius: 10px;
        margin: -0.5rem auto 1.5rem;
    }

    .sidebar-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid #f3f4f6;
    }

    .sidebar-mob-title {
        font-size: 1.5rem;
        font-weight: 800;
        color: #1a1c1d;
    }

    .sidebar-close-btn {
        background: #f3f4f6;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #1a1c1d;
    }
}


/* Custom Scrollbar for Sidebar */
.phones-sidebar::-webkit-scrollbar {
    width: 4px;
}

.phones-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.phones-sidebar::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 10px;
}

.sidebar-mobile-header {
    display: none;
}

.phones-main {
    flex-grow: 1;
}

.results-count {
    font-size: 0.95rem;
    color: #6b7280;
    margin-bottom: 2rem;
    font-family: 'Figtree', sans-serif;
}

/* Filter Sections */
.filter-section {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 1.25rem;
    user-select: none;
}

.filter-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1c1d;
}

.filter-toggle {
    font-size: 1.2rem;
    color: #1a1c1d;
    transition: transform 0.3s ease;
}

.filter-section.collapsed .filter-toggle {
    transform: rotate(-180deg);
}

.filter-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.filter-section.collapsed .filter-content {
    max-height: 0;
    opacity: 0;
}

/* Checkbox Style */
.filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #4b5563;
}

.filter-checkbox {
    width: 20px;
    height: 20px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-option:hover .filter-checkbox {
    border-color: #1a1c1d;
}

.filter-checkbox i {
    font-size: 0.8rem;
    color: #fff;
    display: none;
}

input[type="checkbox"]:checked+.filter-checkbox {
    background: #1a1c1d;
    border-color: #1a1c1d;
}

input[type="checkbox"]:checked+.filter-checkbox i {
    display: block;
}

.option-count {
    color: #9ca3af;
    margin-left: auto;
}

/* Price Slider */
.price-range-slider {
    padding: 1rem 14px;
}

.range-track {
    height: 3px;
    background: #1a1c1d;
    position: relative;
    border-radius: 2px;
}

.range-handle {
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid #1a1c1d;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

.handle-min {
    left: 0;
}

.handle-max {
    left: 100%;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.price-input-box {
    flex: 1;
    background: #f9f9fb;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-input-box span {
    color: #6b7280;
    font-size: 0.9rem;
}

.price-input-box input {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1c1d;
    text-align: right;
}

.price-to {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Color Filter */
.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.color-dot:hover {
    transform: scale(1.1);
}

.color-dot.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a1c1d;
}

/* Breadcrumb Styles */
.breadcrumb-wrap {
    padding-bottom: 2rem;
}

.breadcrumb ol {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #1a1c1d;
}

.breadcrumb-separator {
    font-size: 1.1rem;
    color: #ccc;
}

.breadcrumb-current {
    color: #1a1c1d;
    font-weight: 700;
}

/* ========================
   TRUE MOBILE-FIRST GRID
   ======================== */

.phones-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* Base Card Style (Mobile) */
.bs-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
    height: 100%;
    width: 100%;
    /* Force card to fill grid cell width */
}

.bs-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f9f9fb;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bs-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.bs-card-body {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.bs-card-meta {
    margin-bottom: 0.5rem;
}

.bs-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1c1d;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
    /* Force 2 lines height for alignment */
}

.bs-card-price {
    font-size: 1rem;
    font-weight: 800;
    color: #1a1c1d;
    margin-top: auto;
}

.bs-swatches {
    display: flex;
    gap: 6px;
    margin-top: 0.75rem;
}

.bs-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.bs-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #1a1c1d;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Tablet Scaling (UP) */
@media (min-width: 768px) {
    .phones-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        grid-auto-flow: dense; /* Fill gaps created by repositioned promos */
    }

    .bs-card {
        border-radius: 20px;
    }

    .bs-card-img-wrap {
        padding: 2rem;
    }

    .bs-card-name {
        font-size: 1rem;
        min-height: 2.8em;
    }

    .bs-card-price {
        font-size: 1.15rem;
    }

    .bs-swatch {
        width: 16px;
        height: 16px;
    }

    .bs-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
        top: 12px;
        left: 12px;
    }
}

/* Desktop Scaling (UP) */
@media (min-width: 1200px) {
    .phones-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        width: 100%;
    }

    .phones-main {
        flex: 1;
        /* Allow main area to fill the remaining space next to sidebar */
    }

    .bs-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    }
}

/* Card Animation Entrance */
.bs-card {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.bs-card:nth-child(1) {
    animation-delay: 0.05s;
}

.bs-card:nth-child(2) {
    animation-delay: 0.1s;
}

.bs-card:nth-child(3) {
    animation-delay: 0.15s;
}

.bs-card:nth-child(4) {
    animation-delay: 0.2s;
}

.bs-card:nth-child(5) {
    animation-delay: 0.25s;
}

.bs-card:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Promo Card within Grid (Optimized to match product card size) */
.promo-card {
    grid-column: auto;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    height: 100%;
    width: 100%;
    min-height: auto;
    aspect-ratio: 1 / 1.35;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    color: #fff;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
}

.promo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.promo-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
    z-index: 1;
    transition: opacity 0.4s ease;
}

.promo-card:hover::before {
    opacity: 0.9;
}

.promo-card-content {
    position: relative;
    z-index: 2;
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.promo-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
}

.promo-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-family: 'Figtree', sans-serif;
}

.promo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #1a1c1d;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.promo-btn:hover {
    background: #1a1c1d;
    color: #fff;
    transform: scale(1.05);
}

/* Mobile: Promo spans full width (2 columns) */
@media (max-width: 767px) {
    .promo-card {
        grid-column: span 2;
        padding: 1.5rem;
        aspect-ratio: 1 / 0.8;
    }
}

/* Desktop/Tablet Zigzag: Alternate Promo placement without changing HTML order */
@media (min-width: 768px) {
    .promo-card:nth-of-type(odd) {
        grid-column: 4; /* Promo at the end of its row */
    }
    .promo-card:nth-of-type(even) {
        grid-column: 1; /* Promo at the start of its row */
    }
}

    .promo-title {
        font-size: 1.5rem;
    }

    .promo-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }

    .promo-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
}

/* Benefits Bar - Exact Match from Index */
.benefits-section {
    padding: 3rem 0;
    background-color: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.newsletter-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

@media (min-width: 768px) {
    .newsletter-wrapper {
        padding: 0 2rem;
    }
}

.benefits-section {
    padding: 4rem 0 6rem;
    background: #fff;
}

.newsletter-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.newsletter-benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    padding-top: 3rem;
}

@media (min-width: 768px) {
    .newsletter-benefits {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
        padding-top: 3.5rem;
    }
}

.benefit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.85rem;
}

@media (min-width: 768px) {
    .benefit-item {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 1.25rem;
    }
}

.benefit-icon {
    width: 52px;
    height: 52px;
    background-color: #f0f7f0;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .benefit-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }
}

.benefit-icon .material-symbols-outlined {
    font-size: 26px;
    color: #6aa84f;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.benefit-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #13131D;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.benefit-desc {
    display: block;
    font-size: 0.8rem;
    color: rgba(19, 19, 29, 0.55);
    line-height: 1.4;
}