/* ========================================
   EkoSepeti - Market Fiyat Listesi
   CSS Stylesheet
   ======================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    background-color: #f0f4f8;
    min-height: 100vh;
}


section,div{
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
/* App Container */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding-bottom: 40px;
    background-color: #f0f4f8;
    border: 2px #1e3a5f solid;
}

/* ========================================
   Header Styles
   ======================================== */
.header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    padding: 8px 8px 10px;
    border-radius: 0 0 24px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-button,
.home-button {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.back-button:hover,
.home-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.back-button.hidden,
.home-button.hidden {
    display: none;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.logo-icon {
    width: 48px;
}

.title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Breadcrumb */
.breadcrumb {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.breadcrumb.hidden {
    display: none;
}

#breadcrumbText {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

::-webkit-scrollbar {
    width: 0px;  /* Dikey scrollbar genişliği */
    height: 0px; /* Yatay scrollbar yüksekliği */
}

/* Scrollbar arka planı */
::-webkit-scrollbar-track {
    background: #ddd;
}

/* Scrollbar kendisi */
::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ddd;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    width: 100%;
    height: 100%;
    padding: 20px 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    color: #1e3a5f;
    margin-bottom: 16px;
    padding-left: 4px;
}

/* ========================================
   Category Grid (Icon Seçimi)
   ======================================== */
.category-grid {
    animation: fadeIn 0.3s ease;
}

.category-grid.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* Category Card (Icon) */
.category-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.category-card:active {
    transform: scale(0.97);
}

.category-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    transition: transform 0.2s ease;
}

.category-card:hover .category-icon-wrapper {
    transform: scale(1.1);
}

.category-name {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    text-align: center;
    line-height: 1.3;
}

/* Sub Category Card */
.sub-category-card {
    background: #fff;
    border-radius: 18px;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.sub-category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.sub-category-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.sub-category-name {
    font-size: 12px;
    font-weight: 700;
    color: #444;
    text-align: center;
    line-height: 1.3;
}

/* ========================================
   Product Section
   ======================================== */
.product-section {
    animation: fadeIn 0.3s ease;
}

.product-section.hidden {
    display: none;
}

/* Search Section */
.search-section {
    margin-bottom: 16px;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    overflow: hidden;
    height: 40px;
}

.search-container:focus-within {
    border-color: #2d5a87;
}

.search-icon {
    font-size: 18px;
    margin-right: 12px;
    opacity: 0.45;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 4px 4px;
    background-color: transparent;
    font-family: inherit;
    font-weight: 600;
    color: #333;
}

.search-input::placeholder {
    color: #aaa;
    font-weight: 500;
}


.search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    align-self: stretch;
    border: none;
    background-color: #274c7666;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.search-button:hover {
    background-color: #264b74;
}

.search-button:active {
    transform: scale(0.95);
}

.barcode-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    align-self: stretch;
    border: none;
    background-color: #274c7666;
    border-radius: 14px 0 0 14px;
    font-size: 24px;
    line-height: 24px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.barcode-button:hover {
    background-color: #274c76aa;
}

.barcode-button:active {
    transform: scale(0.95);
}

.clear-button {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    background: #eee;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.clear-button:hover {
    background: #ddd;
}

.clear-button.hidden {
    display: none;
}

/* Sort Section */
.sort-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.result-count {
    font-size: 13px;
    color: #666;
    font-weight: 700;
}

.sort-select {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    font-size: 12px;
    font-family: inherit;
    font-weight: 700;
    color: #333;
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: #2d5a87;
}

/* Products List */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.empty-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 14px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
    font-weight: 600;
}

.empty-state .empty-hint {
    font-size: 13px;
    color: #bbb;
    margin-top: 6px;
}

/* ========================================
   Product Card
   ======================================== */
.product-card {
    background-color: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.25s ease;
}

.product-card:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
/* Product Card - Yeni Düzen */
.product-main {
    display: flex;
    padding: 8px;
    gap: 8px;
}

.product-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.product-image-container {
    width: 66px;
    height: 100px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf0 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-image-container img{
    width: 100%;
    height: auto;
}
.product-image {
    font-size: 28px;
}

.detail-button {
    background: #1e3a5f;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.detail-button:hover {
    background: #2d5a87;
}

.product-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-name {
    font-size: 15px;
    font-weight: 800;
    color: #1e3a5f;
    line-height: 1.3;
}

.meta-item {
    width: 49.9%;
    font-size: 12px;
    color: #888;
    font-weight: 600;
    float: left;
}

.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.market-badge {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
}

.price-value {
    font-size: 20px;
    font-weight: 800;
    color: #27ae60;
}


/* Product Footer - Tarih bilgisi */
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #f0f0f0;
}

.price-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #888;
    font-weight: 600;
}

.date-icon {
    font-size: 12px;
}

.expand-hint {
    font-size: 11px;
    color: #aaa;
    font-weight: 700;
}

.product-card:hover .expand-hint {
    color: #2d5a87;
}

/* ========================================
   Modal Styles
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(1px);
}

.modal-content,.barcode-content {
    position: relative;
    background-color: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    min-height: 84vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}
.barcode-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 380px;
    z-index: 9998;
    align-items: center;
    width: 100%;
    max-width: 100%;
    max-height: none;
    min-height: 10vh;
    height: 410px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: #fff;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 800;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.modal-body {
    padding: 10px;
    overflow-y: auto;
    max-height: calc(85vh - 70px);
    min-height: calc(85vh - 66px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overscroll-behavior-y: contain;
}

/* Modal Product Info */
.modal-product-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}

.modal-product-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf0 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.modal-product-details h4 {
    font-size: 16px;
    font-weight: 800;
    color: #1e3a5f;
    margin-bottom: 4px;
}

.modal-product-details .barcode-tag {
    font-size: 11px;
    color: #888;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

.modal-product-details .category-tag {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Modal Price List */
.modal-price-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.modal-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background-color: #f8fafc;
    border-radius: 14px;
}

.modal-price-item.lowest {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #27ae60;
}

.modal-market-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-market-name {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.modal-price-date {
    font-size: 11px;
    color: #888;
    font-weight: 600;
}

.modal-price-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.modal-item-price {
    font-size: 16px;
    font-weight: 800;
    color: #333;
}

.modal-item-price.lowest {
    color: #27ae60;
}

.modal-price-diff {
    font-size: 12px;
    color: #e74c3c;
    font-weight: 700;
}

/* ========================================
   Bottom Navigation
   ======================================== */
/* App Footer */
.app-footer {
    position: fixed;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    z-index: 199;
    cursor: pointer;
}


.footer-panel.open {
    transform: translateY(0);
}
/* ========================================
   Utility Classes
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 380px) {
    .header {
        padding: 8px;
    }

    .title {
        font-size: 20px;
    }

    .grid-container {
        gap: 12px;
    }

    .category-card {
        padding: 16px 12px;
    }

    .category-icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .product-main {
        padding: 14px;
        gap: 12px;
    }

    .product-image-container {
        width: 52px;
        height: 52px;
    }

    .product-image {
        font-size: 28px;
    }

    .product-name {
        font-size: 14px;
    }

    .price-value {
        font-size: 18px;
    }
}


.product-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.product-info {
    flex: 1;
    min-width: 0; /* Text overflow için gerekli */
}

.product-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #333;
    word-wrap: break-word;
}

.product-icon-large {
    width: 100px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    font-size: 2rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.product-icon-large img{
    width: 100%;
    height: auto;
}
.product-meta {
    display: block;
    width: 100%;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: white;
    border-radius: 4px;
    font-size: 1rem;
    color: #666;
    border: 1px solid #e0e0e0;
}


.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #f0f0f0;
    transition: background 0.2s;
}

.price-item:hover {
    background: #f8f9fa;
}

.price-item:last-child {
    border-bottom: none;
}

/* Sol taraf - Market bilgileri */
.market-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.market-name {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    width: fit-content;
    min-width: 80px;
}

.market-ihbar{
    cursor: pointer;   
}

.market-ihbar div {
    width: 80px;
    height: 24px;
    border: #aaa 1px solid;
    text-align: center;
    background-color: #eee;    
}

.market-date {
    font-size: 1rem;
    color: #666;
    padding-left: 0.25rem;
}

/* Sağ taraf - Fiyat bilgileri */
.price-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.price-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.price-diff {
    font-size: 1rem;
    color: #666;
}

.price-diff.positive {
    color: #dc3545;
}

/* En ucuz ürün vurgulama */
.price-item.lowest {
    background: #e8f5e9;
}

.price-item.lowest .price-value {
    color: #2e7d32;
}

.price-item.lowest .price-diff {
    color: #2e7d32;
    font-weight: 600;
}


.barcode-container {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.barcode-container span{
    font-size: 1.1em;
    vertical-align:middle;
}
/* Responsive */
@media (max-width: 480px) {
    .price-item {
        padding: 0.5rem 0.75rem;
    }

    .market-name {
        font-size: 1rem;
        padding: 0.2rem 0.5rem;
    }

    .price-value {
        font-size: 1.1rem;
    }
}



#installBtn {
    display:none;
    position: absolute;
    top: 10px;
    right: 7px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 9999;
}

#installBtn:hover {
    transform: scale(1.05);
}
.footer-title {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: white;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.footer-panel {
    width: 100%;
    height: 260px;
    background-color: #f5f5f5;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border: 3px #2d5a87 solid;
}

.footer-panel img {
    width: 100%;
    height: auto;
}


.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.video-overlay.active {
    display: flex;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vidclose-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    transition: background-color 0.3s;
}

.vidclose-btn:hover {
    background-color: #c0392b;
}
img.barkod {

    height: 24px;
    width: auto;
}
img.barkodex {
    height: 24px;
    width: auto;
}

.barcode-overlay {
    width: 100%;
    height: 380px;
    z-index: 9998;
    align-items: center;
    justify-content: center;
}

.barcode-overlay.show {
    display: flex;
}

.barcode-iframe {
    width: 100%;
    height: 375px;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
