/* Pike WooCommerce Popup - Frontend Stilleri */

.pike-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pike-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pike-popup-container {
    background: white;
    border-radius: 12px;
    max-width: 380px;
    width: 85%;
    max-height: 70vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.7);
    transition: transform 0.3s ease;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.pike-popup-overlay.active .pike-popup-container {
    transform: scale(1);
}

.pike-popup-header {
    position: relative;
    padding: 15px 15px 0 15px;
}

.pike-popup-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pike-popup-close:hover {
    color: #000;
    background-color: #f0f0f0;
}

.pike-popup-body {
    padding: 15px 20px 20px 20px;
}

.pike-popup-content h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 600;
}

.pike-popup-content p {
    color: #666;
    font-size: 14px;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4;
}

.pike-products-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

/* Eğer birden fazla ürün varsa grid kullan */
.pike-products-grid.multiple-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.pike-product-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: #fafafa;
    width: 100%;
    max-width: 260px;
}

/* Çoklu ürün durumunda */
.pike-products-grid.multiple-products .pike-product-item {
    max-width: none;
    width: auto;
}

.pike-product-item:hover {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 124, 186, 0.1);
    background: white;
}

.pike-product-image {
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.pike-product-image img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Çoklu ürün durumunda küçük resim */
.pike-products-grid.multiple-products .pike-product-image img {
    height: 80px;
}

.pike-product-item:hover .pike-product-image img {
    transform: scale(1.1);
}

.pike-product-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
    height: auto;
    overflow: visible;
}

.pike-product-price {
    font-size: 18px;
    font-weight: bold;
    color: #007cba;
    margin-bottom: 12px;
}

/* Çoklu ürün durumunda küçük font */
.pike-products-grid.multiple-products .pike-product-info h4 {
    font-size: 12px;
    margin-bottom: 6px;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pike-products-grid.multiple-products .pike-product-price {
    font-size: 14px;
    margin-bottom: 10px;
}

.pike-add-to-cart-btn {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Çoklu ürün durumunda küçük buton */
.pike-products-grid.multiple-products .pike-add-to-cart-btn {
    padding: 6px 12px;
    font-size: 11px;
    letter-spacing: 0.3px;
}

.pike-add-to-cart-btn:hover {
    background: linear-gradient(135deg, #005a87 0%, #003d5c 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 124, 186, 0.4);
}

.pike-add-to-cart-btn:active {
    transform: translateY(0);
}

.pike-add-to-cart-btn.loading {
    background: #ccc;
    cursor: not-allowed;
    position: relative;
}

.pike-add-to-cart-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: pike-spin 1s ease infinite;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.pike-add-to-cart-btn.added {
    background: #28a745 !important;
    cursor: default;
}

.pike-add-to-cart-btn.added:hover {
    background: #28a745 !important;
    transform: none !important;
}

@keyframes pike-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pike-popup-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.pike-continue-btn,
.pike-close-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pike-continue-btn {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.pike-continue-btn:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.pike-close-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.pike-close-btn:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-2px);
}

/* Loading ve Error Mesajları */
.pike-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.pike-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: #007cba;
    border-radius: 50%;
    animation: pike-loading-spin 1s ease-in-out infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes pike-loading-spin {
    to { transform: rotate(360deg); }
}

.pike-error {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    font-size: 16px;
}

/* Başarı ve Hata Mesajları */
.pike-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
    z-index: 1000000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    font-weight: 600;
}

.pike-success-message.show {
    transform: translateX(0);
}

.pike-success-message::before {
    content: '✓';
    margin-right: 8px;
    font-size: 16px;
}

.pike-error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    z-index: 1000000;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

/* Çok Büyük Ekranlar için Sınırlama */
@media (min-width: 901px) {
    .pike-popup-container {
        max-width: 380px;
        width: 70%;
    }
    
    .pike-product-item {
        max-width: 260px;
    }
}

/* Body scroll engelleme */
body.pike-popup-open {
    overflow: hidden;
}

/* Büyük Telefonlar için Sınırlama */
@media (max-width: 900px) and (min-width: 769px) {
    .pike-popup-container {
        max-width: 350px;
        width: 80%;
    }
    
    .pike-product-item {
        max-width: 240px;
    }
    
    .pike-product-image img {
        height: 100px;
    }
    
    .pike-product-info h4 {
        font-size: 15px;
    }
    
    .pike-product-price {
        font-size: 16px;
    }
    
    .pike-add-to-cart-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
}

/* Tablet ve Orta Büyüklük Telefonlar */
@media (max-width: 768px) {
    .pike-popup-container {
        width: 90%;
        margin: 15px;
        max-width: 320px;
    }
    
    .pike-products-grid {
        flex-direction: column;
        gap: 10px;
    }
    
    .pike-products-grid.multiple-products {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .pike-product-item {
        max-width: 280px;
        margin: 0 auto;
    }
    
    .pike-popup-content h3 {
        font-size: 18px;
    }
    
    .pike-popup-content p {
        font-size: 13px;
    }
    
    .pike-popup-actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .pike-continue-btn,
    .pike-close-btn {
        flex: 1;
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* Küçük Telefonlar (iPhone 13 ve benzeri) */
@media (max-width: 480px) {
    .pike-popup-container {
        width: 92%;
        max-width: 280px;
    }
    
    .pike-popup-body {
        padding: 12px 15px 15px 15px;
    }
    
    .pike-products-grid {
        flex-direction: column;
        gap: 8px;
    }
    
    .pike-products-grid.multiple-products {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .pike-product-item {
        padding: 12px;
        max-width: 240px;
        margin: 0 auto;
    }
    
    .pike-product-image img {
        height: 90px;
    }
    
    .pike-products-grid.multiple-products .pike-product-image img {
        height: 60px;
    }
    
    .pike-product-info h4 {
        font-size: 14px;
        height: auto;
    }
    
    .pike-products-grid.multiple-products .pike-product-info h4 {
        font-size: 11px;
        height: 2.2em;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .pike-product-price {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .pike-products-grid.multiple-products .pike-product-price {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .pike-add-to-cart-btn {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    .pike-products-grid.multiple-products .pike-add-to-cart-btn {
        font-size: 10px;
        padding: 5px 8px;
    }
    
    .pike-success-message,
    .pike-error-message {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .pike-success-message.show {
        transform: translateY(0);
    }
}
