/* ====================================================
   🎨 Professional Product Card v5.0
   Brand-aligned · RTL-Aware · Performance Optimized
   Primary: #E8541A (brand orange)
   Accent : #4F46E5 (indigo)
   ==================================================== */

/* ── CSS Custom Properties ─────────────────────────── */
.product-card-modern {
    --pc-primary:        #E8541A;
    --pc-primary-dark:   #c94315;
    --pc-primary-light:  #fff5f0;
    --pc-primary-glow:   rgba(232, 84, 26, 0.22);
    --pc-accent:         #4F46E5;
    --pc-accent-light:   #EEF2FF;
    --pc-success:        #16a34a;
    --pc-danger:         #dc2626;
    --pc-gold:           #f59e0b;
    --pc-text-main:      #111827;
    --pc-text-sub:       #6b7280;
    --pc-text-muted:     #9ca3af;
    --pc-border:         #f1f5f9;
    --pc-bg-soft:        #f8fafc;
    --pc-radius:         18px;
    --pc-radius-sm:      12px;
    --pc-shadow:         0 2px 14px rgba(0,0,0,0.06);
    --pc-shadow-hover:   0 22px 48px rgba(0,0,0,0.13);
    --pc-transition:     0.38s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

/* ── Card Shell ────────────────────────────────────── */
.product-card-modern {
    background: #ffffff;
    border-radius: var(--pc-radius);
    overflow: hidden;
    box-shadow: var(--pc-shadow);
    transition: transform var(--pc-transition),
                box-shadow var(--pc-transition),
                border-color var(--pc-transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1.5px solid var(--pc-border);
    will-change: transform;
}

.product-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: var(--pc-shadow-hover);
    border-color: #ffe4d9;
}

/* ── Shine sweep on hover ──────────────────────────── */
.product-card-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 40%,
        rgba(255,255,255,0.55) 50%,
        transparent 60%
    );
    background-size: 200% 100%;
    background-position: -100% 0;
    transition: background-position 0.6s ease;
    z-index: 1;
    pointer-events: none;
    border-radius: var(--pc-radius);
}

.product-card-modern:hover::before {
    background-position: 200% 0;
}

/* ====================================================
   🖼️  IMAGE SECTION
   ==================================================== */

.card-image-section {
    position: relative;
    background: linear-gradient(145deg, #fafafa 0%, #f1f5f9 100%);
    padding: 20px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    flex-shrink: 0;
}

.card-image-link {
    display: block;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
    display: block;
}

.product-card-modern:hover .product-image {
    transform: scale(1.07);
}

/* ── Badges ────────────────────────────────────────── */
.card-badges-wrapper {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 4;
}

.badge-sale,
.badge-new {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.2px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
    animation: badge-pop 0.55s cubic-bezier(0.68,-0.55,0.265,1.55) both;
}

@keyframes badge-pop {
    0%   { opacity:0; transform: scale(0.4) rotate(-12deg); }
    100% { opacity:1; transform: scale(1)   rotate(0); }
}

.badge-sale {
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-dark) 100%);
}

.badge-new {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* ── Floating Action Icons ─────────────────────────── */
.card-actions-wrapper {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 4;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.product-card-modern:hover .card-actions-wrapper {
    opacity: 1;
    transform: translateX(0);
}

.action-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.68,-0.55,0.265,1.55);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.action-icon-btn svg {
    color: #6b7280;
    transition: color 0.2s ease;
}

.action-icon-btn:hover {
    transform: scale(1.18);
    box-shadow: 0 6px 18px rgba(0,0,0,0.16);
}

/* Wishlist */
.wishlist-toggle:hover svg { color: #ef4444; }
.wishlist-toggle.active {
    background: #ef4444;
    box-shadow: 0 4px 14px rgba(239,68,68,0.4);
}
.wishlist-toggle.active svg { color: #fff !important; }

/* Compare */
.compare-toggle:hover svg { color: var(--pc-accent); }

/* Share */
.share-btn:hover svg { color: var(--pc-primary); }

/* ====================================================
   📝  CONTENT SECTION
   ==================================================== */

.card-content-section {
    padding: 18px 18px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Product Title ─────────────────────────────────── */
.product-title {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.55;
    margin: 0 0 10px;
    min-height: 45px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a {
    color: var(--pc-text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-title a:hover {
    color: var(--pc-primary);
}

/* ── Rating ────────────────────────────────────────── */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-count {
    font-size: 12px;
    color: var(--pc-text-muted);
    font-weight: 600;
}

/* ====================================================
   💰  PRICING SECTIONS
   ==================================================== */

.pricing-section {
    margin-bottom: 12px;
}

/* ── 1. Marketer ───────────────────────────────────── */
.pricing-marketer {
    background: linear-gradient(135deg, #312e81 0%, #4338ca 55%, #4f46e5 100%);
    border-radius: 13px;
    padding: 13px;
    box-shadow: 0 8px 24px rgba(67,56,202,0.28);
    animation: price-slide-in 0.5s ease;
}

@keyframes price-slide-in {
    from { opacity:0; transform:translateY(8px); }
    to   { opacity:1; transform:translateY(0); }
}

.pricing-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 9px;
    border-radius: 8px;
}

.price-row.your-price { background: rgba(255,255,255,0.14); }
.price-row.max-price  { background: rgba(255,255,255,0.07); }

.row-label {
    font-size: 11px;
    color: rgba(255,255,255,0.88);
    font-weight: 600;
}

.row-value {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.row-value.highlight {
    color: #86efac;
    font-size: 15px;
}

.profit-indicator {
    border-top: 1px solid rgba(255,255,255,0.18);
    padding-top: 9px;
}

.profit-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.96);
    border-radius: 9px;
    padding: 9px 11px;
    font-size: 12px;
}

.profit-label  { color: #374151; font-weight: 600; }
.profit-amount { color: #16a34a; font-weight: 800; font-size: 14px; margin-right: auto; }
.profit-percent{ color: #16a34a; font-size: 11px; font-weight: 700; }

/* ── 2. Customer / Visitor ─────────────────────────── */
.pricing-customer,
.pricing-visitor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-with-discount {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.price-current {
    font-size: 22px;
    font-weight: 900;
    color: var(--pc-primary);
    line-height: 1;
    letter-spacing: -0.5px;
}

.price-original {
    font-size: 15px;
    font-weight: 600;
    color: var(--pc-text-muted);
    text-decoration: line-through;
}

.price-single .price-main {
    font-size: 22px;
    font-weight: 900;
    color: var(--pc-text-main);
    letter-spacing: -0.5px;
}

.savings-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: var(--pc-success);
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    width: fit-content;
    border: 1px solid #86efac;
}

/* ====================================================
   🎨  ATTRIBUTES SECTION
   ==================================================== */

.attributes-section {
    margin-bottom: 12px;
    padding: 10px 11px;
    background: var(--pc-bg-soft);
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.attribute-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.attribute-group:last-child { margin-bottom: 0; }

.attr-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--pc-text-sub);
    min-width: 60px;
    flex-shrink: 0;
}

.attr-values {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    flex: 1;
}

.attr-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.22s ease;
}

.color-item {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 1.5px #d1d5db, 0 2px 6px rgba(0,0,0,0.1);
}

.color-item:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--pc-primary);
}

.image-item {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.image-item img { width:100%; height:100%; object-fit:cover; }
.image-item:hover { border-color: var(--pc-primary); transform:scale(1.1); }

.text-item {
    padding: 4px 10px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--pc-text-sub);
}

.text-item:hover {
    border-color: var(--pc-primary);
    color: var(--pc-primary);
    background: var(--pc-primary-light);
}

.more-item {
    padding: 4px 9px;
    background: #e9ecef;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--pc-text-muted);
}

/* ====================================================
   📦  STOCK STATUS
   ==================================================== */

.stock-status { margin-bottom: 10px; }

.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11.5px;
    font-weight: 700;
}

.stock-badge.in-stock {
    background: #dcfce7;
    color: var(--pc-success);
    border: 1px solid #bbf7d0;
}

.stock-badge.out-of-stock {
    background: #fee2e2;
    color: var(--pc-danger);
    border: 1px solid #fecaca;
}

/* ====================================================
   ⏱️  COUNTDOWN TIMER
   ==================================================== */

.countdown-section {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--pc-accent) 0%, #312e81 100%);
    color: #fff;
    padding: 9px 13px;
    border-radius: 10px;
    font-size: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(79,70,229,0.28);
}

.countdown-section.urgent {
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-dark) 100%);
    box-shadow: 0 4px 14px var(--pc-primary-glow);
    animation: pulse-urgent 2s infinite;
}

@keyframes pulse-urgent {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.018); }
}

.countdown-label { font-weight: 700; }

.countdown-time {
    display: flex;
    gap: 2px;
    font-weight: 800;
    margin-right: auto;
    font-size: 13px;
}

.time-block {
    min-width: 24px;
    text-align: center;
    background: rgba(255,255,255,0.18);
    border-radius: 4px;
    padding: 2px 4px;
}

.time-sep { opacity: 0.65; }

/* ====================================================
   🛒  FOOTER ACTION BUTTONS
   ==================================================== */

.card-footer-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

/* ── Primary: Buy Now ─────────────────────────────── */
.btn-primary-action {
    flex: 1;
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--pc-radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: 0 5px 18px var(--pc-primary-glow);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.2px;
}

/* Ripple layer */
.btn-primary-action::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent);
    border-radius: inherit;
    pointer-events: none;
}

.btn-primary-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(232,84,26,0.38);
    filter: brightness(1.05);
}

.btn-primary-action:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px var(--pc-primary-glow);
}

/* ── Secondary: Add to Cart ────────────────────────── */
.btn-secondary-action {
    width: 48px;
    height: 48px;
    background: var(--pc-primary-light);
    color: var(--pc-primary);
    border: 1.5px solid #ffd5c2;
    border-radius: var(--pc-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.68,-0.55,0.265,1.55);
    flex-shrink: 0;
}

.btn-secondary-action:hover {
    background: var(--pc-primary);
    color: #fff;
    border-color: var(--pc-primary);
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 6px 18px var(--pc-primary-glow);
}

.btn-secondary-action:active {
    transform: translateY(0) scale(1);
}

.btn-secondary-action svg {
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.btn-secondary-action:hover svg {
    color: #fff;
}

/* ====================================================
   📱  RESPONSIVE
   ==================================================== */

@media (max-width: 768px) {
    .product-card-modern {
        border-radius: 14px;
    }

    .card-content-section {
        padding: 14px 14px 12px;
    }

    .card-image-section {
        padding: 16px;
    }

    .product-title {
        font-size: 13.5px;
        min-height: 42px;
    }

    .price-current,
    .price-main {
        font-size: 19px;
    }

    .btn-primary-action {
        padding: 11px 13px;
        font-size: 13px;
    }

    .btn-secondary-action {
        width: 44px;
        height: 44px;
    }

    /* Show actions always on mobile (no hover) */
    .card-actions-wrapper {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 480px) {
    .product-card-modern {
        border-radius: 12px;
    }

    .card-image-section {
        padding: 12px;
    }

    .product-title {
        font-size: 13px;
    }

    .pricing-marketer {
        padding: 11px;
    }

    .row-label  { font-size: 10px; }
    .row-value  { font-size: 12px; }

    .badge-sale,
    .badge-new {
        font-size: 10px;
        padding: 4px 9px;
    }
}

/* ====================================================
   🌙  DARK MODE  (future-ready)
   ==================================================== */

[data-theme="dark"] .product-card-modern {
    background: #1e293b;
    border-color: #334155;
    --pc-text-main:  #f1f5f9;
    --pc-text-sub:   #94a3b8;
    --pc-text-muted: #64748b;
    --pc-bg-soft:    #0f172a;
    --pc-border:     #334155;
    --pc-shadow:     0 2px 14px rgba(0,0,0,0.3);
    --pc-shadow-hover: 0 22px 48px rgba(0,0,0,0.45);
}

[data-theme="dark"] .card-image-section {
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .attributes-section {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .text-item {
    background: #1e293b;
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .product-title a { color: #f1f5f9; }
[data-theme="dark"] .action-icon-btn { background: rgba(30,41,59,0.97); }
[data-theme="dark"] .action-icon-btn svg { color: #94a3b8; }

[data-theme="dark"] .btn-secondary-action {
    background: rgba(232,84,26,0.12);
    border-color: rgba(232,84,26,0.3);
}

[data-theme="dark"] .product-card-modern:hover {
    border-color: rgba(232,84,26,0.35);
}

/* ==========================================
   ✅ Quick View Button
   ========================================== */
.card-image-section {
    position: relative;
}

.quick-view-btn {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1.125rem;
    background: rgba(255,255,255,0.97);
    color: #374151;
    border: none;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.14);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.25s ease;
    z-index: 5;
    font-family: 'Cairo', sans-serif;
}

.product-card-modern:hover .quick-view-btn {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.quick-view-btn:hover {
    background: #E8541A;
    color: #fff;
    box-shadow: 0 6px 20px rgba(232,84,26,0.35);
}

/* Mobile: always visible */
@media (hover: none) {
    .quick-view-btn {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
