/**
 * ByEco - Storefront Product Card Design Engine
 * Supports 5 distinct templates, dynamic element toggles, and border curvature
 */

/* ==========================================================
   Base Card Styles (Universal for all templates)
   ========================================================== */
.byeco-product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-sizing: border-box;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.25s ease;
}

.byeco-product-card:hover {
    border-color: var(--primary, #0284c7);
    transform: translateY(-4px);
    box-shadow: 0 14px 28px -4px rgba(2, 132, 199, 0.12), 0 6px 12px -2px rgba(0, 0, 0, 0.06);
}

/* Border Curvature Variations */
.byeco-product-card.radius-standard {
    border-radius: 10px;
}
.byeco-product-card.radius-rounded {
    border-radius: 16px;
}
.byeco-product-card.radius-curved {
    border-radius: 24px;
}

/* ==========================================================
   Card Thumbnail & Image
   ========================================================== */
.byeco-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.byeco-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.byeco-product-card:hover .byeco-card-thumb img {
    transform: scale(1.06);
}

/* Top-Left Custom Badge (e.g. Partner, Featured) */
.byeco-badge-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #0f172a;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
    z-index: 2;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
}

/* Top-Right Discount Pill */
.byeco-discount-pill {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 7.5px;
    border-radius: 6px;
    z-index: 2;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.38);
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.2px;
}

/* Bottom-Left Floating Rating on Thumbnail */
.byeco-thumb-rating {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2.5px 7px;
    border-radius: 20px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 3.5px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.byeco-thumb-rating i {
    font-size: 10px;
    color: #fbbf24;
}

/* ==========================================================
   Card Body & Content Elements
   ========================================================== */
.byeco-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.byeco-product-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8em;
    max-height: 2.8em;
    margin-bottom: 6px;
    cursor: pointer;
    transition: color 0.2s ease;
    word-break: break-word;
}

.byeco-product-card:hover .byeco-product-title {
    color: var(--primary, #0284c7);
}

/* Short Description Snippet (first 10 words + ...) */
.byeco-short-desc {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.45;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.9em;
}

/* Rating & Review Count Row in Body */
.byeco-rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
    font-size: 11.5px;
    line-height: 1;
}

.byeco-rating-stars {
    color: #f59e0b;
    font-size: 11px;
}

.byeco-rating-val {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
}

.byeco-rating-count {
    font-size: 11px;
    color: #94a3b8;
}

.byeco-stock-status {
    font-size: 10px;
    font-weight: 700;
    color: #d97706;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
}

/* Pricing Row */
.byeco-pricing-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.byeco-price-current {
    font-size: 16px;
    font-weight: 800;
    color: #ef4444;
    letter-spacing: -0.2px;
}

.byeco-price-old {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
}

/* Action Buttons */
.byeco-actions-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed #f1f5f9;
}

.byeco-btn-cart {
    flex: 1;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 6px 4px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.byeco-btn-cart:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.byeco-btn-buy {
    flex: 1.25;
    background: linear-gradient(135deg, var(--primary, #0284c7), var(--primary-dark, #0369a1));
    color: #ffffff;
    border: none;
    border-radius: 7px;
    padding: 6px 4px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.22);
    white-space: nowrap;
}

.byeco-btn-buy:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
    filter: brightness(1.05);
}

/* ==========================================================
   TEMPLATE 2: Minimalist Clean (No Discount/Badge, Main Price + Snippet)
   ========================================================== */
.byeco-product-card.template-minimal {
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.byeco-product-card.template-minimal .byeco-card-body {
    padding: 14px;
}

.byeco-product-card.template-minimal .byeco-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 5px;
    min-height: auto;
    max-height: none;
}

.byeco-product-card.template-minimal .byeco-short-desc {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 10px;
    min-height: auto;
}

.byeco-product-card.template-minimal .byeco-pricing-row {
    margin-bottom: 12px;
}

.byeco-product-card.template-minimal .byeco-price-current {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
}

.byeco-product-card.template-minimal .byeco-actions-row {
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}

.byeco-product-card.template-minimal .byeco-btn-buy {
    background: #0f172a;
    box-shadow: none;
}

.byeco-product-card.template-minimal .byeco-btn-buy:hover {
    background: var(--primary, #0284c7);
}

/* ==========================================================
   TEMPLATE 3: Curved Floating Luxe (24px Radius, Soft Shadow)
   ========================================================== */
.byeco-product-card.template-curved {
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

.byeco-product-card.template-curved:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -6px rgba(2, 132, 199, 0.16), 0 8px 12px -3px rgba(0, 0, 0, 0.08);
}

.byeco-product-card.template-curved .byeco-card-thumb {
    border-radius: 24px 24px 0 0;
}

.byeco-product-card.template-curved .byeco-discount-pill {
    border-radius: 20px;
    padding: 3.5px 9px;
    font-size: 11px;
}

.byeco-product-card.template-curved .byeco-badge-tag {
    border-radius: 20px;
    padding: 3px 9px;
}

.byeco-product-card.template-curved .byeco-thumb-rating {
    border-radius: 20px;
    padding: 3px 8.5px;
}

.byeco-product-card.template-curved .byeco-btn-cart {
    border-radius: 30px;
    padding: 7px 10px;
}

.byeco-product-card.template-curved .byeco-btn-buy {
    border-radius: 30px;
    padding: 7px 12px;
}

/* ==========================================================
   TEMPLATE 4: Rounded Modern Bordered (Crisp 16px Radius)
   ========================================================== */
.byeco-product-card.template-rounded_modern {
    border-radius: 16px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.byeco-product-card.template-rounded_modern:hover {
    border-color: var(--primary, #0284c7);
    box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.08);
}

.byeco-product-card.template-rounded_modern .byeco-card-thumb {
    border-radius: 14.5px 14.5px 0 0;
}

.byeco-product-card.template-rounded_modern .byeco-badge-tag {
    border-radius: 6px;
}

.byeco-product-card.template-rounded_modern .byeco-discount-pill {
    border-radius: 6px;
}

.byeco-product-card.template-rounded_modern .byeco-btn-cart {
    border-radius: 10px;
}

.byeco-product-card.template-rounded_modern .byeco-btn-buy {
    border-radius: 10px;
}

/* ==========================================================
   TEMPLATE 5: Neo-Store Sleek (Modern Compact Sleek)
   ========================================================== */
.byeco-product-card.template-neo_sleek {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.byeco-product-card.template-neo_sleek .byeco-price-current {
    color: var(--primary, #0284c7);
    font-size: 16.5px;
}

.byeco-product-card.template-neo_sleek .byeco-actions-row {
    background: #f8fafc;
    margin: 8px -12px -12px -12px;
    padding: 8px 12px;
    border-top: 1px solid #e2e8f0;
}

.byeco-product-card.template-neo_sleek .byeco-btn-cart {
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

.byeco-product-card.template-neo_sleek .byeco-btn-buy {
    background: var(--primary, #0284c7);
}

/* ==========================================================
   Dynamic Toggle Overrides (Hide/Show via Classes)
   ========================================================== */
.byeco-product-card.hide-discount-badge .byeco-discount-pill,
.hide-discount-badge .byeco-discount-pill {
    display: none !important;
}

.byeco-product-card.hide-thumb-rating .byeco-thumb-rating,
.hide-thumb-rating .byeco-thumb-rating {
    display: none !important;
}

.byeco-product-card.hide-rating-row .byeco-rating-row,
.hide-rating-row .byeco-rating-row {
    display: none !important;
}

.byeco-product-card.hide-badge .byeco-badge-tag,
.hide-badge .byeco-badge-tag {
    display: none !important;
}

.byeco-product-card.hide-regular-price .byeco-price-old,
.hide-regular-price .byeco-price-old {
    display: none !important;
}

.byeco-product-card.hide-short-desc .byeco-short-desc,
.hide-short-desc .byeco-short-desc {
    display: none !important;
}

.byeco-product-card.hide-cart-btn .byeco-btn-cart,
.hide-cart-btn .byeco-btn-cart {
    display: none !important;
}

.byeco-product-card.hide-cart-btn .byeco-btn-buy,
.hide-cart-btn .byeco-btn-buy {
    flex: 1 1 100% !important;
    width: 100% !important;
    padding: 7px 10px !important;
}

/* Backward compatibility for suggested-product-card styles */
.suggested-product-card {
    border-radius: inherit;
}
