/* ========== layout.css ========== */
/* TÜM LAYOUT, HEADER, FOOTER, NAVIGASYON, TOAST, CANLI ARAMA */

/* ========== TOP BAR ========== */
.top-bar {
    background: #1a1a1a;
    color: #fff;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #333;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.top-bar-left {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.top-bar-left span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
}

.top-bar-left i {
    color: #ff6b6b;
    width: 16px;
    font-size: 14px;
}

.top-bar-right {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.top-bar-right a,
.top-bar-right span {
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
    font-size: 13px;
}

.top-bar-right a:hover {
    color: #ff6b6b;
}

.top-bar-right i {
    color: #ff6b6b;
    font-size: 12px;
}

@media only screen and (max-width: 478px) {
    .top-bar-left {
        display: none !important;
    }
}

/* ========== MOBİL TOP BAR DÜZENLEMESİ ========== */
@media (max-width: 768px) {
    .top-bar-left span:nth-child(1),
    .top-bar-left span:nth-child(2),
    .top-bar-left span:nth-child(3) {
        display: none !important;
    }
}

/* ========== MAIN HEADER ========== */
.main-header {
    background: #fff;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* LOGO */
.main-header .logo {
    flex: 0 0 auto;
}

.main-header .logo a {
    display: block;
}

.main-header .logo img {
    max-height: 60px;
    width: auto;
    display: block;
}

.main-header .logo h2 {
    font-size: 24px;
    color: #ff6b6b;
    margin: 0;
}

/* ========== SEARCH BOX & LIVE SEARCH ========== */
.search-box {
    position: relative;
    flex: 1 1 400px;
    max-width: 600px;
    margin: 0;
}

.search-box form {
    display: flex;
    width: 100%;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    overflow: hidden;
    transition: box-shadow 0.3s, border-color 0.3s;
    background: #fff;
}

.search-box form:focus-within {
    border-color: transparent;
    box-shadow: 0 1px 6px rgba(32,33,36,0.28);
    border-radius: 24px 24px 0 0;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    font-size: 14px;
    outline: none;
    font-family: 'Poppins', sans-serif;
    background: transparent;
}

.search-box button {
    padding: 12px 20px;
    background: transparent;
    color: #5f6368;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s;
}

.search-box button:hover {
    color: #ff6b6b;
}

/* Live Search Results */
.live-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 6px rgba(32,33,36,.28);
    z-index: 9999;
    max-height: 80vh;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    padding: 12px 20px;
    border-bottom: 1px solid #f1f3f4;
    text-decoration: none;
    color: #202124;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-image {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin-right: 15px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f4;
}

.search-result-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.search-result-brand {
    font-size: 12px;
    color: #5f6368;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-result-brand i {
    font-size: 10px;
    color: #ff6b6b;
}

.search-result-price {
    font-size: 13px;
    font-weight: 600;
    color: #ff6b6b;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-results-footer {
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e8eaed;
    text-align: center;
}

.btn-view-all {
    display: inline-block;
    padding: 6px 16px;
    background: #fff;
    color: #ff6b6b;
    text-decoration: none;
    border: 1px solid #dadce0;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-view-all:hover {
    background: #f8f9fa;
    border-color: #ff6b6b;
}

.stok-yok {
    color: #dc3545;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.stok-yok i {
    font-size: 10px;
}

.loading, .no-results, .error {
    padding: 30px 20px;
    text-align: center;
    color: #5f6368;
    font-size: 14px;
}

.loading i {
    margin-right: 8px;
    color: #ff6b6b;
}

.no-results i, .error i {
    display: block;
    font-size: 30px;
    color: #dadce0;
    margin-bottom: 10px;
}

.error {
    color: #d93025;
}

/* ========== HEADER CART ========== */
.header-cart {
    flex: 0 0 auto;
    order: 3;
}

.header-cart .cart-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    padding: 8px 15px;
    border-radius: 50px;
    background: #f8f8f8;
    transition: all 0.3s ease;
    gap: 10px;
}

.header-cart .cart-link:hover {
    background: #ff6b6b;
}

.header-cart .cart-link:hover .cart-info *,
.header-cart .cart-link:hover i {
    color: #fff;
}

.cart-icon {
    position: relative;
}

.cart-icon i {
    font-size: 24px;
    color: #ff6b6b;
    transition: color 0.3s ease;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    transition: background 0.3s ease;
}

.header-cart .cart-link:hover .cart-count {
    background: #fff;
    color: #ff6b6b;
}

.cart-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.cart-text {
    font-size: 16px;
    color: #666;
    transition: color 0.3s ease;
}

.cart-total {
    font-weight: 600;
    color: #ff6b6b;
    font-size: 14px;
    transition: color 0.3s ease;
}

/* ========== MAIN NAVIGATION ========== */
.main-nav {
    background: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-menu > li > a i {
    font-size: 14px;
}

.nav-menu > li:hover > a {
    background: #ff6b6b;
}

.nav-menu .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    display: none;
    list-style: none;
    padding: 10px 0;
    z-index: 1000;
    border-radius: 0 0 5px 5px;
}

.nav-menu .submenu li a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
}

.nav-menu .submenu li a:hover {
    background: #f8f8f8;
    color: #ff6b6b;
    padding-left: 25px;
}

.nav-menu li:hover .submenu {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ========== MOBILE MENU TOGGLE ========== */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 10px 15px;
}

.mobile-menu-toggle i {
    font-size: 24px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    min-height: 400px;
    padding: 0;
}

/* ========== TOAST NOTIFICATION ========== */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #fff;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform .3s ease;
    border-left: 4px solid;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left-color: #28a745;
}

.toast-error {
    border-left-color: #dc3545;
}

.toast-warning {
    border-left-color: #ffc107;
}

.toast-info {
    border-left-color: #17a2b8;
}

.toast i {
    font-size: 20px;
}

.toast-success i {
    color: #28a745;
}

.toast-error i {
    color: #dc3545;
}

.toast-warning i {
    color: #ffc107;
}

.toast-info i {
    color: #17a2b8;
}

/* ========== FOOTER ========== */
.main-footer {
    background: #1a1a1a;
    color: #fff;
    padding: 60px 0 0;
    margin-top: 60px;
    font-size: 14px;
    line-height: 1.7;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.footer-widget h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-widget h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: #ff6b6b;
}

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

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

.footer-menu li a {
    color: #999;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.footer-menu li a i {
    margin-right: 8px;
    font-size: 12px;
    color: #ff6b6b;
    transition: margin 0.3s;
}

.footer-menu li a:hover {
    color: #ff6b6b;
    transform: translateX(5px);
}

.footer-menu li a:hover i {
    margin-right: 12px;
}

.contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    color: #999;
}

.contact-info li i {
    color: #ff6b6b;
    font-size: 18px;
    min-width: 20px;
    margin-top: 3px;
}

.contact-info li span {
    flex: 1;
    line-height: 1.6;
}

.contact-info li strong {
    color: #fff;
    font-weight: 600;
    display: block;
    margin-bottom: 3px;
}

.contact-info li a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-info li a:hover {
    color: #ff6b6b;
}

.footer-middle {
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    padding: 30px 0;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-middle h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 500;
}

.social-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #333;
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 18px;
}

.social-links a:hover {
    background: #ff6b6b;
    transform: translateY(-3px);
}

.payment-icons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.payment-icons img {
    width: 50px;
    height: 30px;
    object-fit: contain;
    background: #fff;
    border-radius: 5px;
    padding: 5px;
    transition: transform 0.3s;
}

.payment-icons img:hover {
    transform: scale(1.1);
}

.payment-icon-fallback {
    display: inline-block;
    padding: 5px 10px;
    background: #333;
    color: #fff;
    border-radius: 5px;
    font-size: 12px;
    border: 1px solid #444;
}

.secure-payment {
    color: #999;
    font-size: 13px;
}

.secure-payment i {
    color: #ff6b6b;
    margin-right: 5px;
}

.secure-payment i:last-child {
    margin-left: 15px;
}

.footer-bottom {
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
}

.footer-bottom-left p {
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.footer-bottom-right a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
    margin: 0 5px;
}

.footer-bottom-right a:hover {
    color: #ff6b6b;
}

.footer-bottom-right .separator {
    color: #333;
    margin: 0 5px;
}

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: #ff6b6b;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 1000;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(255,107,107,0.3);
}

.scroll-top:hover {
    background: #ff5252;
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(255,107,107,0.5);
}

/* ========== RESPONSIVE - LAYOUT ========== */
@media (max-width: 992px) {
    .main-header .logo img {
        max-height: 50px;
    }
    
    .search-box {
        flex: 1 1 00px;
    }
    
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-middle {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .top-bar .container {
        flex-direction: column;
        text-align: center;
    }
    
    .top-bar-left,
    .top-bar-right {
        justify-content: center;
        width: 100%;
    }
    
    .top-bar-left {
        flex-direction: column;
        gap: 5px;
    }
    
    .main-header .container {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 10px;
    }
    
    .main-header .logo {
        grid-column: 1;
        text-align: left;
    }
    
    .main-header .logo img {
        max-height: 40px;
        margin: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
        grid-column: 2;
        text-align: center;
        color: #333;
    }
    
    .header-cart {
        grid-column: 3;
        align-self: center;
        margin-left: 0;
        order: 0;
    }
    
    .header-cart .cart-link {
        padding: 5px 10px;
        background: transparent;
    }
    
    .header-cart .cart-link:hover {
        background: transparent;
    }
    
    .cart-icon i {
        font-size: 22px;
    }
    
    .cart-info {
        display: none;
    }
    
    .search-box {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: 100%;
        margin-top: 10px;
        order: 0;
    }
    
    .search-box input {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .search-box button {
        padding: 10px 20px;
    }
    
    /* Live Search Mobile */
    .search-result-item {
        padding: 10px 12px;
    }
    
    .search-result-image {
        width: 35px;
        height: 35px;
        margin-right: 12px;
    }
    
    .search-result-title {
        font-size: 13px;
    }
    
    .search-result-brand {
        font-size: 11px;
    }
    
    .search-result-price {
        font-size: 12px;
    }
    
    .search-results-footer {
        padding: 10px 12px;
    }
    
    .btn-view-all {
        font-size: 11px;
        padding: 5px 12px;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: #2c3e50;
        z-index: 1000;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    }
    
    .nav-menu.show {
        display: flex;
    }
    
    .nav-menu > li {
        width: 100%;
    }
    
    .nav-menu > li > a {
        padding: 12px 15px;
        border-bottom: 1px solid #34495e;
    }
    
    .nav-menu .submenu {
        position: static;
        box-shadow: none;
        padding-left: 20px;
        background: #34495e;
        width: 100%;
    }
    
    .nav-menu .submenu li a {
        color: #fff;
        padding: 10px 15px;
    }
    
    .kategori-mega-menu {
        position: static;
        min-width: 100%;
        box-shadow: none;
        grid-template-columns: 1fr;
        padding: 10px;
        border-top: none;
    }
    
    .kategori-menu-col {
        border-right: none;
        padding-right: 0;
        margin-bottom: 15px;
    }
    
    .kategori-baslik {
        white-space: normal;
    }
    
    .kategori-adi {
        max-width: none;
        white-space: normal;
    }
    
    /* Toast Mobile */
    .toast {
        min-width: 250px;
        max-width: 300px;
        padding: 12px 15px;
    }
    
    #toast-container {
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .top-bar-right {
        /* flex-direction: column; */
        position: relative;
        gap: 5px;
    }
    
    .search-box input {
        padding: 8px 12px;
    }
    
    .search-box button {
        padding: 8px 15px;
    }
    
    /* Live Search Extra Small */
    .search-result-image {
        width: 35px;
        height: 35px;
    }
    
    .search-result-title {
        font-size: 12px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.3;
    }
    
    .search-result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .search-result-brand {
        font-size: 10px;
    }
    
    .search-result-price {
        font-size: 11px;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .main-header .logo img {
        max-height: 35px;
    }
    
    .cart-count {
        width: 16px;
        height: 16px;
        font-size: 10px;
        top: -6px;
        right: -6px;
    }
    
    .toast {
        min-width: 220px;
        max-width: 280px;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .toast i {
        font-size: 18px;
    }
    
    #toast-container {
        bottom: 10px;
        right: 10px;
    }
}