/**
 * WooCommerce Özel Butonlar CSS
 * Child tema içinde /assets/css/custom-buttons.css olarak kaydedilecek
 */

/* Buton Konteyner */
.custom-product-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Genel Buton Stilleri */
.custom-product-buttons button,
.custom-product-buttons a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    overflow: hidden;
    outline: none;
    box-shadow: 0 4px 15px rgba(181, 158, 95, 0.15);
}

/* Buton İkon */
.button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

/* Hover'da ikon animasyonu */
.custom-product-buttons button:hover .button-icon,
.custom-product-buttons a:hover .button-icon {
    transform: translateX(3px);
}

/* Sepete Ekle Butonu */
.custom-add-to-cart {
    background: linear-gradient(135deg, #B59E5F 0%, #A99459 100%);
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.custom-add-to-cart .button-text,
.custom-add-to-cart .button-icon {
    position: relative;
    z-index: 2;
}

.custom-add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0.1) 100%);
    transform: skewX(-20deg);
    animation: shine-move 3.5s ease-in-out infinite;
    z-index: 1;
    opacity: 0.6;
}

@keyframes shine-move {
    0% {
        left: -75%;
    }
    100% {
        left: 125%;
    }
}

.custom-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(181, 158, 95, 0.3);
}

.custom-add-to-cart:hover::before {
    opacity: 1;
    animation: shine-move 1.5s;
}


/* Hemen Al – Parıltı efekti */
.custom-buy-now::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    height: 100%;
    width: 100%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
    pointer-events: none;
    animation: buy-now-shine 3s ease-in-out infinite;
}

.custom-buy-now .button-text,
.custom-buy-now .button-icon {
    position: relative;
    z-index: 2;
}

.custom-buy-now {
	background: linear-gradient(135deg, #101010, #1f1f1f);
}

/* WhatsApp Butonu */
.custom-whatsapp {
    background: #25D366;
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
}

.custom-whatsapp::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s ease;
}

.custom-whatsapp:hover::after {
    transform: rotate(45deg) translateX(100%);
}

.custom-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

/* Loading State */
.custom-product-buttons button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.custom-product-buttons button.loading .button-text {
    opacity: 0;
}

.custom-product-buttons button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: button-spin 0.8s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success State */
.custom-product-buttons button.success {
    background: #10B981 !important;
    color: #FFFFFF !important;
}

.custom-product-buttons button.success .button-text {
    animation: success-text 0.4s ease;
}

@keyframes success-text {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ürün Listesi (Loop) Butonları */
.custom-add-to-cart.loop-button {
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    font-size: 14px;
}

/* Pulse Animasyonu - Dikkat Çekici */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(181, 158, 95, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(181, 158, 95, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(181, 158, 95, 0);
    }
}

.custom-buy-now {
    animation: pulse 2s infinite;
}

.custom-buy-now:hover {
    animation: none;
}

/* Mobil Uyumluluk */
@media (max-width: 768px) {
    .custom-product-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .custom-product-buttons button,
    .custom-product-buttons a {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
    }
}

/* Küçük Ekranlar */
@media (max-width: 480px) {
    .custom-product-buttons button,
    .custom-product-buttons a {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .button-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Focus State - Erişilebilirlik */
.custom-product-buttons button:focus,
.custom-product-buttons a:focus {
    outline: 3px solid rgba(181, 158, 95, 0.5);
    outline-offset: 2px;
}

/* Glow Efekti - Lüks Görünüm */
.custom-add-to-cart {
    position: relative;
}

.custom-add-to-cart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(181, 158, 95, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.custom-add-to-cart:hover::after {
    opacity: 1;
}

/* Stok Dışı Durumu */
.stock.out-of-stock {
    color: #EF4444;
    font-weight: 600;
    margin-top: 15px;
}

.custom-fly-notice {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #B59E5F;
    color: white;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s ease;
    z-index: 9999;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.custom-fly-notice.active {
    opacity: 1;
    transform: translateY(0);
}

.custom-fly-notice.error {
    background-color: #e74c3c;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.cart-contents.shake-animation {
  animation: shake 0.5s ease;
}
