/**
 * Homepage Product Cards Redesign
 * Modern hover effects and button positioning
 * 
 * @version 1.0.0
 */

/* ========================================
   PRODUCT CARD BASE STYLES
======================================== */
.de__pcard {
    position: relative;
    overflow: visible;
    transition: all 0.3s ease;
    padding: 15px;
    background: transparent !important;
    margin-bottom: 30px; /* Add bottom margin for spacing */
}

.de__pcard:hover {
    transform: translateY(-5px);
}

/* Remove any default gradients from parent containers */
.item,
.swiper-slide,
.product-carousel .item {
    background: transparent !important;
}

/* Force remove any pseudo-element gradients */
.item::before,
.item::after,
.de__pcard::before,
.de__pcard::after {
    background: none !important;
    display: none !important;
}

/* Product Image Container */
.de__pcard .atr__images {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    margin-bottom: 15px;
    background: transparent !important; /* Remove gray background */
    transition: all 0.3s ease;
}

.de__pcard:hover .atr__images {
    /* No shadow on hover */
    background: transparent !important;
}

/* Remove any gradient overlays */
.de__pcard .atr__images::before,
.de__pcard .atr__images::after {
    display: none !important;
}

/* Product Main Image */
.de__pcard .atr__image-main {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.de__pcard:hover .atr__image-main {
    transform: scale(1.05);
}

/* Sale Badge */
.de__pcard .atr__promo {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #ff4747 0%, #ff6b6b 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 5;
    box-shadow: 0 3px 10px rgba(255, 71, 71, 0.3);
}

/* ========================================
   HOVER ACTION BUTTONS
======================================== */
.de__pcard .atr__extra-menu {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    justify-content: center;
    gap: 25px; /* Increased gap between buttons */
    padding: 0;
    background: none !important; /* Force no background */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.de__pcard:hover .atr__extra-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Individual Action Buttons - Match Header Style */
.de__pcard .atr__extra-menu > * {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.de__pcard .atr__extra-menu > *:hover {
    transform: translateY(-2px);
    background: white;
}

/* Quick View Button - Like Header Search */
.de__pcard .atr__quick-view {
    background: rgba(255, 255, 255, 0.95);
    color: #666;
    text-decoration: none;
    border: 2px solid #e0e0e0;
}

.de__pcard .atr__quick-view:hover {
    background: white;
    border-color: #2D7B2C;
    color: #2D7B2C;
}

.de__pcard .atr__quick-view i {
    font-size: 18px;
}

/* Add to Cart Button - Like Header Cart */
.de__pcard .atr__add-cart {
    background: rgba(255, 255, 255, 0.95);
    color: #2D7B2C;
    border: 2px solid #2D7B2C;
}

.de__pcard .atr__add-cart:hover {
    background: #2D7B2C;
    color: white;
    border-color: #2D7B2C;
}

.de__pcard .atr__add-cart i {
    font-size: 16px;
}

/* Wishlist Button - Like Header Wishlist */
.de__pcard .atr__wish-list {
    background: rgba(255, 255, 255, 0.95);
    color: #ff4757;
    border: 2px solid #ffecec;
}

.de__pcard .atr__wish-list:hover {
    background: #fff5f5;
    border-color: #ff4757;
    color: #ff4757;
}

.de__pcard .atr__wish-list.active {
    background: #ff4757;
    color: white;
    border-color: #ff4757;
}

.de__pcard .atr__wish-list i {
    font-size: 16px;
}

/* ========================================
   PRODUCT INFO SECTION
======================================== */
.de__pcard h3 {
    margin: 10px 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    min-height: 50px;
    line-height: 1.4;
}

.de__pcard h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.de__pcard h3 a:hover {
    color: #2D7B2C;
}

/* Product Price */
.de__pcard .atr__main-price {
    font-size: 20px;
    font-weight: 700;
    color: #2D7B2C;
    margin-top: 10px;
    margin-bottom: 5px; /* Reduced from 15px */
    min-height: 30px;
}

.de__pcard .atr__main-price del {
    color: #999;
    font-size: 16px;
    font-weight: 400;
    margin-right: 8px;
}

.de__pcard .atr__main-price ins {
    text-decoration: none;
    color: #ff4757;
}

/* ========================================
   PRODUCT VARIATIONS
======================================== */
.de__pcard .product-sizes,
.de__pcard .product-colors {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 10px 0;
}

/* Size Options */
.de__pcard .size-option {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.de__pcard .size-option:hover {
    border-color: #2D7B2C;
    color: #2D7B2C;
}

.de__pcard .size-option.active {
    background: #2D7B2C;
    color: white;
    border-color: #2D7B2C;
}

/* Color Options */
.de__pcard .color-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.de__pcard .color-option:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.de__pcard .color-option.active {
    box-shadow: 0 0 0 2px white, 0 0 0 4px #2D7B2C;
}

/* Color swatches */
.de__pcard .color-option.white {
    background: #ffffff;
    border: 1px solid #ddd;
}

.de__pcard .color-option.green {
    background: #4CAF50;
}

.de__pcard .color-option.purple {
    background: #9C27B0;
}

.de__pcard .color-option.gray {
    background: #757575;
}

.de__pcard .color-option.black {
    background: #212121;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
======================================== */
@media (max-width: 768px) {
    /* Larger images on mobile */
    .de__pcard .atr__image-main {
        height: 320px;
        object-fit: cover;
    }
    
    .de__pcard .atr__images {
        margin-bottom: 20px;
    }
    
    .de__pcard .atr__extra-menu {
        gap: 20px;
        bottom: 10px;
    }
    
    .de__pcard .atr__extra-menu > * {
        width: 40px;
        height: 40px;
    }
    
    .de__pcard .atr__extra-menu i {
        font-size: 16px !important;
    }
    
    /* Larger, more readable text on mobile */
    .de__pcard h3 {
        font-size: 16px; /* Increased from 14px */
        line-height: 1.5;
        min-height: 80px; /* More space for title */
        margin-bottom: 10px; /* Reduced margin */
        padding: 5px 0; /* Add some padding */
    }
    
    .de__pcard h3 a {
        -webkit-line-clamp: 3; /* Allow 3 lines on mobile */
    }
    
    .de__pcard .atr__main-price {
        font-size: 20px; /* Keep price prominent */
        margin-bottom: 5px; /* Much less bottom margin */
        margin-top: 5px; /* Less top margin too */
    }
    
    .de__pcard .atr__main-price del {
        font-size: 16px;
    }
    
    /* Better padding for mobile */
    .de__pcard {
        padding: 10px;
        margin-bottom: 15px; /* Reduced bottom margin on mobile */
    }
    
    /* Adjust swiper slide padding on mobile */
    .product-carousel .swiper-slide {
        padding: 5px;
    }
    
    /* Larger sale badge on mobile */
    .de__pcard .atr__promo {
        font-size: 13px;
        padding: 6px 14px;
    }
}

/* ========================================
   LOADING STATE
======================================== */
.de__pcard.loading {
    pointer-events: none;
    opacity: 0.6;
}

.de__pcard.loading .atr__add-cart::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Remove tooltips for cleaner look */

/* ========================================
   CAROUSEL SPECIFIC STYLES
======================================== */
.product-carousel .swiper-slide {
    padding: 10px;
    opacity: 1 !important; /* Force full opacity */
}

/* Remove Swiper's default slide effects */
.swiper-container .swiper-slide {
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.swiper-container .swiper-slide-active,
.swiper-container .swiper-slide-next,
.swiper-container .swiper-slide-prev,
.swiper-container .swiper-slide-duplicate,
.swiper-container .swiper-slide-duplicate-active,
.swiper-container .swiper-slide-duplicate-next,
.swiper-container .swiper-slide-duplicate-prev {
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* Remove any brightness/contrast filters */
.swiper-slide img,
.swiper-slide .atr__images,
.swiper-slide .de__pcard {
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1 !important;
}

/* Ensure no overlay on slide transitions */
.swiper-container .swiper-wrapper {
    transition-timing-function: linear !important;
}

.product-carousel .de__pcard,
#new-arrivals-carousel .de__pcard,
#best-seller-carousel .de__pcard {
    height: 100%;
    min-height: 480px; /* Ensure minimum height for content */
    display: flex;
    flex-direction: column;
    opacity: 1 !important;
    filter: none !important;
}

.product-carousel .de__pcard .atr__images,
#new-arrivals-carousel .de__pcard .atr__images,
#best-seller-carousel .de__pcard .atr__images {
    flex-shrink: 0;
    opacity: 1 !important;
    filter: none !important;
}

/* Content wrapper for text */
.product-carousel .de__pcard > div:not(.atr__images),
#new-arrivals-carousel .de__pcard > div:not(.atr__images),
#best-seller-carousel .de__pcard > div:not(.atr__images) {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}

.product-carousel .de__pcard h3,
#new-arrivals-carousel .de__pcard h3,
#best-seller-carousel .de__pcard h3 {
    margin-bottom: 20px; /* More space after title */
}