/* =========================================================================
   DesiHerbal Product Showcase — Isolated & Premium Styles
   Prevents theme overrides, ensures high performance & responsiveness
   ========================================================================= */

/* Host element in the Light DOM */
:host {
    display: block !important;
    width: 100% !important;
    clear: both !important;
}

/* Scope container - resets all inherited theme properties */
.desiherbal-showcase {
    all: initial !important;
    display: block !important;
    max-width: 1100px !important;
    margin: 40px auto !important;
    padding: 0 16px !important;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif !important;
    color: #1A1A1A !important;
    -webkit-font-smoothing: antialiased !important;
    box-sizing: border-box !important;
}

.desiherbal-showcase *,
.desiherbal-showcase *::before,
.desiherbal-showcase *::after {
    box-sizing: border-box !important;
}

/* Grid Layout (Vertical stack of horizontal/vertical cards) */
.desiherbal-showcase .desiherbal-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 32px !important;
    width: 100% !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
}

/* Card */
.desiherbal-showcase .desiherbal-card {
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden !important;
    position: relative !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-top: 5px solid #D4AF37 !important; /* Premium Gold top border */
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.desiherbal-showcase .desiherbal-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12) !important;
}

/* Badges */
.desiherbal-showcase .desiherbal-card__badges {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 16px 0 !important;
    gap: 8px !important;
    background: transparent !important;
}

.desiherbal-showcase .desiherbal-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 6px 14px !important;
    border-radius: 30px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    line-height: 1 !important;
}

.desiherbal-showcase .desiherbal-badge--in_stock {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9) !important;
    color: #1B5E20 !important;
    border: 1px solid rgba(27, 94, 32, 0.15) !important;
}

.desiherbal-showcase .desiherbal-badge--out_of_stock {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0) !important;
    color: #E53935 !important;
    border: 1px solid rgba(229, 57, 53, 0.15) !important;
}

.desiherbal-showcase .desiherbal-badge--discount {
    background: linear-gradient(135deg, #E53935, #c62828) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border: 1px solid rgba(198, 40, 40, 0.15) !important;
}

/* Image Wrap */
.desiherbal-showcase .desiherbal-card__image-wrap {
    padding: 16px 16px 0 !important;
    text-align: center !important;
    overflow: hidden !important;
    background: transparent !important;
}

.desiherbal-showcase .desiherbal-card__image {
    width: 100% !important;
    max-height: 240px !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-block !important;
}

.desiherbal-showcase .desiherbal-card:hover .desiherbal-card__image {
    transform: scale(1.04) !important;
}

/* Content */
.desiherbal-showcase .desiherbal-card__content {
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    background: transparent !important;
    text-align: center !important; /* Centered layout for premium feel */
}

/* Title */
.desiherbal-showcase .desiherbal-card__title {
    font-size: 19px !important;
    font-weight: 700 !important;
    color: #1A1A1A !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.4 !important;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    height: 53px !important; /* Fixed height to prevent layout shifts */
}

/* Description */
.desiherbal-showcase .desiherbal-card__desc {
    font-size: 13px !important;
    color: #666666 !important;
    line-height: 1.6 !important;
    margin: 0 0 16px 0 !important;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    height: 42px !important; /* Fixed height for description alignment */
}

/* Rating container */
.desiherbal-showcase .desiherbal-card__rating {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
    white-space: nowrap !important;
}

/* Isolated Stars SVG */
.desiherbal-showcase .desiherbal-stars-svg {
    display: inline-block !important;
    vertical-align: middle !important;
    width: 105px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

.desiherbal-showcase .desiherbal-rating-value {
    color: #666666 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Pricing Section */
.desiherbal-showcase .desiherbal-card__pricing {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
    flex-wrap: wrap !important;
}

.desiherbal-showcase .desiherbal-card__price {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #1B5E20 !important;
    line-height: 1 !important;
}

/* Compare Price with centered Red strikethrough line */
.desiherbal-showcase .desiherbal-card__compare-price {
    font-size: 16px !important;
    color: #999999 !important;
    font-weight: 400 !important;
    position: relative !important;
    display: inline-block !important;
    line-height: 1 !important;
}

.desiherbal-showcase .desiherbal-card__compare-price::after {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    width: 100% !important;
    height: 1.5px !important;
    background: #E53935 !important; /* Red Strikethrough */
    transform: translateY(-50%) !important;
}

/* Trust Badges */
.desiherbal-showcase .desiherbal-card__trust {
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
    flex-wrap: wrap !important;
}

.desiherbal-showcase .desiherbal-trust-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #F5F5F5 !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #1A1A1A !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    line-height: 1 !important;
}

.desiherbal-showcase .desiherbal-trust-icon {
    font-size: 14px !important;
}

/* CTA Buy Button (Smaller & Centered) */
.desiherbal-showcase .desiherbal-card__cta {
    display: block !important;
    width: 100% !important;
    max-width: 250px !important; /* Reduced max-width for compact feel */
    margin: 0 auto !important; /* Always centered */
    padding: 12px 24px !important; /* Compact padding */
    background: linear-gradient(135deg, #1B5E20, #0D3B12) !important;
    color: #F5D060 !important; /* Light Gold Text */
    text-align: center !important;
    text-decoration: none !important;
    font-size: 15px !important; /* Slightly smaller font */
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    border: none !important;
    border-radius: 50px !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: uppercase !important;
}

.desiherbal-showcase .desiherbal-card__cta:hover {
    background: linear-gradient(135deg, #2E7D32, #1B5E20) !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.35), 0 4px 15px rgba(27, 94, 32, 0.2) !important;
    transform: translateY(-2px) !important;
    color: #ffffff !important;
}

/* Shine effect on hover */
.desiherbal-showcase .desiherbal-card__cta::before {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    left: -75% !important;
    width: 50% !important;
    height: 200% !important;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.2) 45%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0.2) 55%,
        transparent 60%
    ) !important;
    transform: skewX(-25deg) !important;
    transition: left 0.7s ease !important;
}

.desiherbal-showcase .desiherbal-card__cta:hover::before {
    left: 125% !important;
}

/* Pulsing call to action */
.desiherbal-showcase .desiherbal-cta-pulse {
    animation: desiherbal-pulse 2s ease-in-out !important;
}

@keyframes desiherbal-pulse {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.03); box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }
    30% { transform: scale(1); }
    45% { transform: scale(1.03); box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }
    60% { transform: scale(1); }
}

/* Responsive Breakpoints */

/* Desktop Horizontal Card Layout */
@media (min-width: 769px) {
    .desiherbal-showcase .desiherbal-card {
        flex-direction: row !important;
        align-items: stretch !important;
        min-height: 280px !important;
        border-top: none !important;
        border-inline-start: 5px solid #D4AF37 !important; /* Gold border on start edge (left in LTR, right in RTL) */
    }

    /* Badges floating on start-top of the card */
    .desiherbal-showcase .desiherbal-card__badges {
        position: absolute !important;
        top: 16px !important;
        left: 16px !important; /* Align to left to match image position */
        padding: 0 !important;
        z-index: 10 !important;
        width: calc(100% - 32px) !important;
    }

    /* Split layout: 32% image, 68% details content */
    .desiherbal-showcase .desiherbal-card__image-wrap {
        width: 32% !important;
        max-width: 300px !important;
        padding: 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        border-inline-end: 1px solid rgba(0, 0, 0, 0.06) !important; /* Border between image and content */
        margin: 0 !important;
    }

    .desiherbal-showcase .desiherbal-card__image {
        max-height: 220px !important;
        width: auto !important;
    }

    .desiherbal-showcase .desiherbal-card__content {
        width: 68% !important;
        padding: 28px !important;
        text-align: start !important; /* Align text to start edge (left in LTR, right in RTL) */
        align-items: flex-start !important; /* Align block items to start */
        justify-content: center !important;
    }

    /* Title auto height */
    .desiherbal-showcase .desiherbal-card__title {
        height: auto !important;
        margin-bottom: 8px !important;
        -webkit-line-clamp: 2 !important;
        text-align: start !important;
    }

    /* Description auto height */
    .desiherbal-showcase .desiherbal-card__desc {
        height: auto !important;
        margin-bottom: 12px !important;
        -webkit-line-clamp: 3 !important;
        text-align: start !important;
    }

    /* Rating alignment */
    .desiherbal-showcase .desiherbal-card__rating {
        justify-content: flex-start !important;
        margin-bottom: 12px !important;
    }

    /* Pricing alignment */
    .desiherbal-showcase .desiherbal-card__pricing {
        justify-content: flex-start !important;
        margin-bottom: 12px !important;
    }

    /* Trust badges alignment */
    .desiherbal-showcase .desiherbal-card__trust {
        justify-content: flex-start !important;
        margin-bottom: 16px !important;
    }

    /* Left/Right-aligned compact button on desktop */
    .desiherbal-showcase .desiherbal-card__cta {
        margin: 0 !important;
    }
}

/* Mobile Layout Fixes */
@media (max-width: 768px) {
    .desiherbal-showcase .desiherbal-card__title {
        font-size: 17px !important;
    }
    .desiherbal-showcase .desiherbal-card__cta {
        max-width: 100% !important;
        padding: 12px 20px !important;
    }
}

/* Print Overrides */
@media print {
    .desiherbal-showcase { break-inside: avoid !important; }
    .desiherbal-showcase .desiherbal-card__cta { display: none !important; }
}
