/* ==========================================================================
   Product Card Component
   - Styles for individual product cards used across the site.
   ========================================================================== */

.product-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.product-card a, .product-card a:hover {
    text-decoration: none;
    color: inherit;
}

/* Image Wrapper & Overlay */
.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 250px; /* Or use padding-top for aspect ratio */
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
}

.product-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

/* New overlay button from index-styles */
.image-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 2;
    background: var(--accent);
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.image-button:hover {
    background-color: #0077ED;
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 113, 227, 0.2);
}

/* Card Content */
.product-card .card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows footer to stick to bottom */
}

.product-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 10px 0;
    text-align: left;
}

.product-card p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 8px;
    flex-grow: 1;
}

/* Card Bottom/Footer for price, actions etc. */
.card-bottom {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 50%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
}

/* Price styling */
.product-card .price {
    font-weight: 500;
    font-size: 15px;
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-block;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-align: center;
    position: relative;
    z-index: 3;
    letter-spacing: 0.5px;
    margin: 0; /* Override general price margin */
}

.product-card .price::before {
    content: "₺";
    margin-right: 3px;
    font-weight: 400;
}

.product-card .price:hover {
    background-color: rgba(0, 0, 0, 0.85);
    transform: scale(1.05);
}

.product-card .price.discounted {
    color: #fff;
    background-color: var(--accent-secondary);
}

.product-card .price.discounted::after {
    content: "İndirimli";
    position: absolute;
    top: -18px;
    right: -10px;
    background-color: #FF3B30;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    transform: rotate(-5deg);
}

/* Old card CTA - may need to be deprecated */
.product-card .card-cta {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1;
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.product-card .card-cta:hover {
    background-color: #0077ED;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.2);
}

/* Mobilde card-cta'yı card-content içine taşı */
@media (max-width: 900px) {
    /* Görsel üzerindeki butonu mobilde gizle */
    .product-card .card-image-wrapper .card-cta.desktop-only {
        display: none !important;
    }
    
    /* Card-content içindeki mobil butonu göster */
    .product-card .card-content .card-cta.mobile-only {
        display: inline-block;
        position: static;
        flex-shrink: 0;
        white-space: nowrap;
        margin: 0;
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* Mobilde hover efekti */
    .product-card .card-content .card-cta.mobile-only:hover {
        background-color: #0077ED;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 113, 227, 0.2);
    }
    
    /* Card content'i flexbox yap, ürün ismi ve buton yan yana */
    .product-card .card-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 16px 20px;
    }
    
    .product-card .card-content h3 {
        margin: 0;
        flex: 1;
        font-size: 18px;
        min-width: 0; /* Text overflow için */
    }
}

/* Desktop'ta mobil butonu gizle */
@media (min-width: 901px) {
    .product-card .card-content .card-cta.mobile-only {
        display: none !important;
    }
    
    .product-card .card-image-wrapper .card-cta.desktop-only {
        display: inline-block;
    }
}

.heart-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.product-card .add-to-cart-btn {
    width: calc(100% - 30px); /* Padding'i hesaba kat */
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 600;
    margin: 0 15px 15px 15px;
    border-radius: 6px;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    visibility: hidden; /* Başlangıçta gizli */
    opacity: 0;
    transform: translateY(10px);
}

.product-card:hover .add-to-cart-btn {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.product-card .add-to-cart-btn:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
}

/* Unavailable / Out of Region Styles */
.product-card img.unavailable {
    filter: grayscale(100%);
    opacity: 0.6;
}

.product-card .product-price.unavailable {
    color: #999;
    font-style: italic;
    font-size: 14px;
}

.product-card .cta-button.disabled,
.product-card .quick-action-btn[disabled] {
    background-color: #ccc;
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.6;
}