/* MODERN PRODUCT CARD ENHANCEMENTS */

.product-image-wrapper img {
    max-height: 300px !important; /* default image max-height (home default) */
    width: auto !important;
    display: block !important;
    margin: 0 auto !important;
    object-fit: contain !important; /* ensure entire image is visible */
    transition: transform 0.4s ease !important;
}

.product-image-wrapper {
    height: 320px !important; /* default wrapper height (home default) */
    flex-shrink: 0 !important;
    border-radius: 15px 15px 0 0 !important;
    overflow: hidden !important;
}

/* Home-specific: make images a bit taller on the front page */
.home .product-image-wrapper img,
.front-page .product-image-wrapper img {
    max-height: 300px !important;
}

.home .product-image-wrapper,
.front-page .product-image-wrapper {
    height: 320px !important;
}

/* Shop-specific slight reduction to make images shorter on shop lists */
.woocommerce .products-grid .product-image-wrapper img,
.woocommerce .products-row .product-image-wrapper img,
.woocommerce ul.products .product-image-wrapper img {
    max-height: 240px !important; /* shop target */
}

.woocommerce .products-grid .product-image-wrapper,
.woocommerce .products-row .product-image-wrapper,
.woocommerce ul.products .product-image-wrapper {
    height: 260px !important; /* shop wrapper height */
}

.product-card-enhanced {
    /* Cards size naturally by default; tall baseline is only applied on the front page */
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
    border-radius: 20px !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%) !important;
}

/* Front page baseline: keep homepage cards slightly taller for a banner-like layout */
.home .product-card-enhanced,
.front-page .product-card-enhanced {
    min-height: 520px !important;
}

/* Single product page enhancements */
.single-product .single-product-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.single-product .product-gallery-main {
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.single-product .product-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.single-product .product-thumbs .thumb {
    width: 68px;
    height: 68px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: all 0.18s ease;
}

.single-product .product-thumbs .thumb.active {
    border-color: #8B4513;
    transform: translateY(-4px);
}

.single-product .product-summary h1 {
    font-size: 1.9rem;
    margin-bottom: 12px;
}

.single-product .product-price { font-size: 1.5rem; color: #8B4513; font-weight: 700; margin-bottom: 18px; }

.single-product .product-meta { color: #666; font-size: 14px; margin-bottom: 18px; }

.single-product .product-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }

.single-product .tabbed-content { margin-top: 30px; }

.product-card-enhanced:hover {
    transform: translateY(-12px) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2) !important;
}

.product-card-enhanced:hover .product-image-wrapper img {
    transform: scale(1.08) !important;
}

.product-card-enhanced .product-info {
    padding: 12px 12px 0 12px !important; /* Align with compact card spacing */
    overflow: hidden !important;
    flex: 1 !important;
}

.product-card-enhanced .product-excerpt {
    max-height: 2.4em !important; /* normal excerpt height */
    overflow: hidden !important;
    color: #666 !important;
    line-height: 1.4 !important;
    margin-bottom: 8px !important; /* restore normal spacing */
}

/* Topic boxing: ensure title area occupies a consistent two-line space */
.product-card-enhanced .product-topic {
    height: 2.4em !important; /* allow ~2 lines for the title */
    overflow: hidden !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 0 6px 0 !important; /* small gap to price/qty */
}

.product-card-enhanced .product-topic .woocommerce-loop-product__title {
    margin: 0 !important;
    line-height: 1.2 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
}

/* Broad rule: ensure boxed topic if not using enhanced card */
.product-topic {
    height: 2.4em !important;
    overflow: hidden !important;
    margin: 0 0 6px 0 !important;
}

/* Price area layout: keep a consistent block for price/compare so cards align */
.product-card-enhanced .price-quantity-row {
    min-height: 48px !important; /* reserve consistent area for price + quantity */
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.product-card-enhanced .price {
    min-height: 44px !important; /* make price area visually stable */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.product-card-enhanced .price del,
.product-card-enhanced .price ins {
    display: block !important;
}
.product-card-enhanced .description-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(0,0,0,0.6) !important;
    color: white !important;
    padding: 15px !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    z-index: 10 !important;
}

.product-card-enhanced:hover .description-overlay {
    opacity: 1 !important;
    transform: translateY(-5px) !important;
}

.product-title a {
    color: #1a1a2e !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.product-title a:hover {
    color: #1a1a2e !important;
    text-decoration: none !important;
}

.product-price-wrapper .price {
    background: linear-gradient(45deg, #8B4513, #2fb5d2) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    margin-bottom: 0 !important; /* Remove bottom margin */
}

.add-to-cart-enhanced, .view-product-btn {
    background: #8B4513 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.add-to-cart-enhanced:hover, .view-product-btn:hover {
    background: #FF8C00 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

.stock-info {
    margin-bottom: 8px !important;
    display: block !important;
}

.in-stock, .out-of-stock {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.in-stock { 
    color: #27ae60 !important; 
}

.out-of-stock { 
    color: #e74c3c !important; 
}

.product-card-enhanced .product-actions {
    padding: 0 12px 0 !important; /* No bottom padding for tightest spacing */
    gap: 8px !important;
}

.quantity-selector {
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.qty-btn {
    transition: all 0.3s ease !important;
    font-weight: 600 !important;
}

.qty-btn:hover {
    background: #FF8C00 !important;
    color: white !important;
}

.stock-badge {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    z-index: 15 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

.stock-badge.out {
    background: rgba(231,76,60,0.9) !important;
}