/* About Page Styles */
.about-hero {
    padding: 120px 0 60px;
}

.about-features {
    padding: 80px 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.about-heading {
    font-size: 2.25rem;
    margin-bottom: 2rem;
    color: var(--dark);
}

.about-text {
    font-size: 1.1rem;
    color: var(--grey);
    margin-bottom: 2rem;
}

.about-text-last {
    margin-bottom: 3rem;
}

.about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 4rem;
}

.about-card {
    background: var(--white);
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-sm);
}

.about-icon {
    font-size: 2.5rem;
}

.about-card h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.about-card p {
    font-size: 0.95rem;
}

.cta-section {
    margin-top: 6rem;
    text-align: center;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    padding: 4rem;
    border-radius: var(--radius);
    color: white;
}

.cta-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.cta-text {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.cta-btn {
    background: white;
    color: var(--primary);
    border: none;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

/* Saved Gifts Page Styles */
.saved-features-container {
    max-width: 1000px;
    margin: 0 auto;
}

.saved-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.saved-card-desc {
    font-size: 0.9rem;
}

.saved-card-meta {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saved-card-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.saved-card-site {
    font-size: 0.8rem;
    color: var(--grey);
}

.saved-card-action {
    margin-top: 1.5rem;
}

.saved-view-btn {
    width: 100%;
    text-align: center;
    display: block;
}

.saved-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.saved-empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.saved-empty-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.saved-empty-text {
    font-size: 1.1rem;
    color: var(--grey);
    margin-bottom: 2rem;
}

/* Results Page Styles */
.results-hero {
    padding: 4rem 1rem 2rem;
}

.results-features {
    padding-top: 0;
}

.results-action-bar {
    background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.results-container {
    max-width: 1200px;
}

.results-main {
    width: 100%;
}

.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    background: white;
    color: var(--dark);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-toggle-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.filter-toggle-icon {
    color: var(--primary);
}

.filter-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.results-new-search {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    background: white;
    border-color: #e2e8f0;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.results-new-search:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.active-filter-chip {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    background: #eef2ff;
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 600;
}

.results-empty-filter-btn {
    margin-top: 1.5rem;
}

/* Filter panel overlay */
.filter-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.filter-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.filter-panel {
    width: 100%;
    max-height: 88vh;
    background: white;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.filter-overlay.is-open .filter-panel {
    transform: translateY(0);
}

.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.filter-panel-title {
    font-size: 1.1rem;
    color: var(--dark);
    margin: 0;
}

.filter-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--grey);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.filter-panel-close:hover {
    background: #e2e8f0;
    color: var(--dark);
}

.filter-panel-body {
    overflow-y: auto;
    padding: 1.25rem;
    flex: 1;
}

.filter-panel-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #f1f5f9;
    background: white;
    flex-shrink: 0;
}

.filter-cancel-btn {
    padding: 0.5rem;
    border: none;
    background: none;
    color: var(--grey);
    font-family: var(--font-main);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.filter-cancel-btn:hover {
    color: var(--dark);
}

body.filter-open {
    overflow: hidden;
}

@media (min-width: 640px) {
    .filter-overlay {
        align-items: center;
        padding: 1.5rem;
    }

    .filter-panel {
        max-width: 400px;
        max-height: min(85vh, 560px);
        border-radius: var(--radius);
        transform: translateY(16px) scale(0.98);
    }

    .filter-overlay.is-open .filter-panel {
        transform: translateY(0) scale(1);
    }
}

.results-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 0;
}

.results-grid .feature-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem; /* Reduced from 2.5rem for better space efficiency */
}

/* Standardized Product Card Styles */
.product-card {
    height: 520px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem !important;
}

.product-card h3 {
    margin-bottom: 0.25rem !important;
    font-size: 1.15rem !important;
    line-height: 1.4 !important;
    height: 2.8em; /* Exactly 2 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.product-card .rating-container {
    height: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

.product-card .rating-container-placeholder {
    height: 20px;
    margin-top: 0.25rem;
}

.product-card .product-description {
    font-size: 0.9rem;
    color: var(--grey);
    line-height: 1.5;
    height: 4.5em; /* Exactly 3 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.product-card .product-price-site {
    margin-top: auto; /* Pushes price and action button to the bottom */
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card .product-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.product-card .product-site {
    font-size: 0.8rem;
    color: var(--grey);
}

.product-card .product-card-action {
    margin-top: 1rem;
}

.product-card .view-btn {
    width: 100%;
    text-align: center;
    display: block;
}

.product-image-container {
    width: 100%;
    height: 240px; /* Increased slightly for better visibility */
    background: #f8fafc;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid #f1f5f9;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures the whole image is visible without stretching */
    padding: 1rem; /* Adds some breathing room inside the container */
    transition: transform 0.3s ease;
}

.feature-card:hover .product-image {
    transform: scale(1.05);
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.rating-stars {
    color: #fbbf24;
    letter-spacing: 1px;
}

.rating-value {
    font-weight: 600;
    color: var(--dark);
}

.rating-count {
    color: var(--grey);
}

.results-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius);
}

.results-empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.results-empty-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.results-empty-text {
    font-size: 1rem;
    color: var(--grey);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group-last {
    margin-bottom: 0;
}

.filter-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.filter-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--dark);
    margin-bottom: 0.75rem;
}

.slider-container {
    position: relative;
    height: 30px;
    margin-top: 0.5rem;
}

.slider-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.slider-range {
    position: absolute;
    height: 4px;
    background: var(--primary);
    border-radius: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.slider-input {
    position: absolute;
    width: 100%;
    appearance: none;
    background: transparent;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
    outline: none;
}

.slider-input-min {
    z-index: 1;
}

.slider-input-max {
    z-index: 2;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-input {
    accent-color: var(--primary);
}

.filter-apply-btn {
    width: 100%;
    padding: 0.65rem;
}

@media (max-width: 639px) {
    .results-grid {
        grid-template-columns: 1fr;
    }

    .results-hero {
        padding: 3rem 1rem 1.5rem;
    }

    .container {
        padding: 0 1rem;
    }
}

/* Range Slider Knobs (Webkit) */
input[type=range]::-webkit-slider-thumb {
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--primary);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Range Slider Knobs (Mozilla) */
input[type=range]::-moz-range-thumb {
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--primary);
    cursor: pointer;
    pointer-events: all;
}

/* Survey Page Styles */
.survey-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.survey-section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.survey-section-title-mt {
    margin-top: 2rem;
}

.survey-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.survey-label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.survey-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    font-family: var(--font-main);
}

.survey-grid-span-2 {
    grid-column: span 2;
}

.age-slider {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 5px;
    appearance: none;
    cursor: pointer;
    outline: none;
}

.survey-filter-group {
    margin-bottom: 2rem;
}

.survey-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.survey-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.price-num-input {
    width: 80px;
    padding: 0.4rem 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.price-num-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.price-separator {
    color: var(--grey);
    font-weight: 600;
}

.price-currency {
    color: var(--dark);
    font-weight: 700;
    font-size: 1rem;
    margin-right: -0.25rem;
}

.survey-price-slider-container {
    position: relative;
    height: 40px;
    margin-top: 1rem;
}

/* Slider Overrides for Survey (Using Shared Classes where possible) */
.slider-range-survey {
    /* Extending .slider-range */
    left: 0%;
    right: 50%;
}

/* Index Page Styles */
.feature-link {
    text-decoration: none;
    color: inherit;
}

.survey-toggle {
    font-size: 0.85rem;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}

.survey-toggle:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Category Button Selector */
.category-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.category-button-label {
    position: relative;
    cursor: pointer;
}

.category-button-input,
.gift-type-button-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.category-button-text {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: var(--white);
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--grey);
    transition: all 0.2s ease;
    user-select: none;
}

.category-button-label:hover .category-button-text {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    /* Very light primary */
}

.category-button-input:checked+.category-button-text,
.gift-type-button-input:checked+.category-button-text {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

/* Selected Categories Section */
.selected-categories-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px dashed #e2e8f0;
}

.selected-categories-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2rem;
    align-items: center;
}

.none-text {
    color: var(--grey);
    font-size: 0.9rem;
    font-style: italic;
}

.category-chip {
    padding: 0.4rem 0.8rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--dark);
    box-shadow: var(--shadow-sm);
    animation: fadeInScale 0.2s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Interactive Chips */
.category-chip {
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.category-chip:hover {
    border-color: #ef4444;
    /* Red for removal */
    color: #ef4444;
    background: #fef2f2;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.chip-remove {
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 700;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.category-chip:hover .chip-remove {
    opacity: 1;
}

/* Sub-categories Section */
.subcategories-section {
    padding: 1.5rem;
    background: #f1f5f9;
    border-radius: var(--radius);
    /* border-left: 4px solid var(--primary); */
    animation: slideDownFade 0.3s ease-out;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.subcategories-section .survey-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grey);
    margin-bottom: 1rem;
}

/* Ensure subcategory buttons look consistent */
.subcategories-section .category-button-text {
    background: white;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

/* Grouped Sub-categories */
.subcategory-group {
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.subcategory-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.group-remove-x {
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    font-weight: 700;
    color: var(--grey);
    opacity: 0.6;
    transition: all 0.2s ease;
    padding: 0 0.25rem;
    user-select: none;
}

.group-remove-x:hover {
    color: #ef4444;
    opacity: 1;
    transform: scale(1.15);
}

.subcategory-group-content {
    padding-left: 0.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.7); /* dark backdrop */
    backdrop-filter: blur(8px); /* glassmorphism */
    animation: fadeIn 0.3s ease-out;
}

.loading-content {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 350px;
    width: 90%;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Button Spinner */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Custom toast notification */
.category-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.category-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-message {
    font-family: var(--font-main);
    text-align: center;
    flex: 1;
}

.toast-close {
    cursor: pointer;
    font-size: 1.25rem;
    opacity: 0.7;
    margin-left: 0.25rem;
    transition: opacity 0.2s;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

@media (max-width: 480px) {
    .category-toast {
        width: 90%;
        max-width: 90%;
        border-radius: 16px;
        padding: 0.85rem 1.25rem;
    }
}