/* Amazon Inspired High-Quality Theme */

:root {
    --bg-primary: #eaeded; /* Amazon background gray */
    --bg-secondary: #ffffff;
    --text-primary: #0F1111; /* Amazon dark text */
    --text-secondary: #565959; /* Amazon light text */
    --accent-color: #131921; /* Amazon top bar dark navy */
    --accent-hover: #232f3e; /* Amazon secondary navy */
    --accent-orange: #ffd814; /* Amazon yellow button */
    --accent-orange-hover: #f7ca00;
    --amazon-blue: #007185;
    --amazon-blue-hover: #c40000;
    --card-bg: #ffffff;
    --card-border: #d5d9d9;
    --card-border-hover: #a6a6a6;
    --input-bg: #ffffff;
    --success-green: #067d62;
    --warning-orange: #c45500;
    --danger-red: #B12704;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 0 10px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
    overscroll-behavior-x: none;
}

.container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem 1.5rem;
}

/* Header & Brand (Now full width dark like Amazon) */
.header-wrapper {
    background-color: var(--accent-color);
    width: 100%;
}

header {
    max-width: 1250px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
}

.header-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-note-link, .favorites-link {
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
}

.header-note-link {
    color: #ffd100;
}

.favorites-link {
    color: #ffffff;
}

.logo {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: #ffffff;
    display: flex;
    align-items: baseline;
    cursor: pointer;
    position: relative;
    padding-bottom: 5px;
}

.logo span {
    font-size: 1.05rem;
    font-weight: 400;
    color: #ffffff;
    margin-left: 2px;
}

/* Amazon Style Smile */
.logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 15%;
    width: 60%;
    height: 5px;
    border-bottom: 3px solid var(--accent-orange);
    border-radius: 50%;
}

.admin-link {
    background: transparent;
    border: 1px solid #ffffff;
    color: #ffffff;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Horizontal Filter Bar */
.filters-console {
    background-color: var(--accent-hover);
    width: 100%;
    padding: 0.8rem 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.filters-card {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 12px;
        padding: 0.8rem 1rem;
    }
    .header-links {
        gap: 8px;
    }
    .header-note-link, .favorites-link {
        font-size: 12px;
    }
    .filters-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    .filter-field {
        min-width: 0;
    }
    .filter-field:last-child {
        grid-column: span 2;
    }
    .filter-control {
        padding: 0.5rem 2rem 0.5rem 0.6rem;
        font-size: 0.8rem;
    }
}

.btn-apply-filters {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background-color: var(--accent-orange);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}
.btn-apply-filters:active {
    background-color: var(--accent-orange-hover);
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 180px;
}

.filter-field label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #aeb5bd;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 0.5rem;
    margin-bottom: 0.1rem;
}

.filter-control {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #ffffff url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F1111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 1.2rem center/14px;
    border: 2px solid transparent;
    border-radius: 30px;
    padding: 0.75rem 2.8rem 0.75rem 1.4rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.filter-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    background-color: #f8f9fa;
}

.filter-control:focus {
    border-color: var(--accent-orange);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(243, 168, 71, 0.25);
    transform: translateY(0);
}

/* Results Content Area */
.results-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.results-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--card-border);
}

.results-count {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Product Cards Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.2rem;
}

/* Product Card */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
    border-color: transparent;
    box-shadow: var(--shadow-hover);
}

/* Match Score Tag */
.score-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 10;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.score-high {
    color: var(--success-green);
    border-color: rgba(6, 125, 98, 0.3);
}

.score-mid {
    color: var(--warning-orange);
    border-color: rgba(196, 85, 0, 0.3);
}

.score-low {
    color: var(--danger-red);
    border-color: rgba(177, 39, 4, 0.3);
}

/* Product Image Wrapper */
.product-img-wrapper {
    width: 100%;
    height: 200px;
    padding: 1.5rem;
    background: #f8f8f8;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.product-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* Card Body */
.product-details {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.product-title {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4.2rem;
    transition: color 0.1s ease;
}

.product-card:hover .product-title {
    color: var(--amazon-blue-hover);
}

.product-meta-tags {
    display: none !important;
}
.product-tag {
    background: #f0f2f2;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    margin-bottom: 0.8rem;
}

.price-label {
    display: none; /* Hide for cleaner Amazon look */
}

.price-val {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--danger-red);
    display: flex;
    align-items: flex-start;
}
.price-val::after {
    content: 'TL';
    font-size: 0.85rem;
    margin-left: 2px;
    margin-top: 4px;
}

/* Action Button */
.buy-btn {
    width: 100%;
    background: var(--accent-orange);
    color: var(--text-primary);
    border: 1px solid #FCD200;
    border-radius: 100px;
    padding: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 5px 0 rgba(213,217,217,.5);
}

.buy-btn:hover {
    background: var(--accent-orange-hover);
    border-color: #F2C200;
}

/* Shimmer/Loading States */
.loading-indicator {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.05);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: var(--amazon-blue);
    margin: 0 auto 1.2rem;
    animation: spin 0.8s linear infinite;
}

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

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border: 1px dashed var(--card-border);
    border-radius: 8px;
    color: var(--text-secondary);
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    font-size: 1.2rem;
}


/* Favorite Button Styles */
.favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10;
    transition: all 0.2s ease;
}
.favorite-btn:hover {
    transform: scale(1.1);
}
.favorite-btn.active {
    color: #e74c3c;
}

/* --- FOOTER STYLES --- */
.site-footer {
    background-color: #232f3e; /* Amazon dark footer blue */
    color: #ffffff;
    padding: 60px 0 30px;
    margin-top: 60px;
    font-family: 'Outfit', sans-serif;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.footer-logo span {
    color: var(--accent-orange);
}

.footer-about {
    color: #ddd;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.footer-contact {
    color: #fff;
    font-size: 0.95rem;
}

.footer-contact a {
    color: var(--accent-orange);
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--accent-orange);
    text-decoration: underline;
}

.footer-disclaimer {
    border-top: 1px solid #3a4b5c;
    padding-top: 30px;
    margin-bottom: 30px;
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.6;
    text-align: center;
}

.footer-bottom {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

/* --- MOBILE TWEAKS (Trendyol Style 2-Column Grid) --- */
@media (max-width: 576px) {
    html.android-device .filters-grid {
        grid-template-columns: 1fr !important;
    }
    html.android-device .filter-field:last-child {
        grid-column: span 1 !important;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }
    .product-card {
        border-radius: 6px;
    }
    .product-img-wrapper {
        height: 140px;
    }
    .product-img-wrapper img {
        height: 100%;
        object-fit: contain;
        padding: 0.5rem;
    }
    .product-details {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    .product-title {
        font-size: 0.85rem;
        -webkit-line-clamp: 3;
        height: 3.57rem; /* 0.85 * 1.4 * 3 */
        margin-bottom: 0.4rem;
    }
    .product-tag {
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
    }
    .price-label {
        font-size: 0.65rem;
    }
    .price-val {
        font-size: 0.95rem;
    }
    .buy-btn {
        font-size: 0.75rem;
        padding: 0.4rem;
        margin-top: 0.2rem;
    }
    .score-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.3rem;
        top: 0.4rem;
        right: 0.4rem;
    }
    .favorite-btn {
        top: 0.3rem;
        left: 0.3rem;
        font-size: 1.1rem;
        width: 25px;
        height: 25px;
    }
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: #1f2b37;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    border-top: 2px solid var(--accent-orange);
}

.pwa-install-banner.show {
    bottom: 0;
}

.pwa-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pwa-info img {
    width: 45px;
    height: 45px;
    border-radius: 10px;
}

.pwa-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.pwa-text p {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: #cbd5e1;
}

.pwa-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-pwa-install {
    background: var(--accent-orange);
    color: #111;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.btn-pwa-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
}

/* Mobile Filter Bottom Sheet Styles */
.filter-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.filter-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-filter-trigger {
    display: none;
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 997;
}

.mobile-filter-trigger button {
    border-radius: 30px;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

.filters-header-mobile {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-close-filter {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 5px;
}

/* Universal Mobile Styles for Bottom Sheet (max-width: 768px) */
@media (max-width: 768px) {
    .mobile-filter-trigger {
        display: block;
    }
    
    .filters-header-mobile {
        display: flex;
    }
    
    .filters-console {
        position: fixed;
        bottom: -100%;
        left: 0;
        width: 100%;
        z-index: 999;
        margin: 0;
        padding: 0;
        transition: bottom 0.4s cubic-bezier(0.25, 1, 0.5, 1);
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .filters-console.active {
        bottom: 0;
    }
    
    .filters-card {
        border-radius: 24px 24px 0 0;
        margin: 0;
        padding: 25px 20px 40px 20px;
        min-height: 50vh;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    }
    
    .filters-card > h1 {
        display: none; /* Hide default h1 on mobile, use mobile header */
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filter-field:last-child {
        grid-column: span 1;
    }
    
    .results-area {
        padding-bottom: 80px; /* Space for the floating button */
    }
}
