/* ═══════════════════════════════════════════════
     ECOMMERCE SHARED COMPONENTS
     These styles power <x-product-card>, <x-vendor-card>,
     <x-category-card>, <x-brand-card>, etc.
     Loaded globally via the layout so every page sees them.
   ═══════════════════════════════════════════════ */

:root {
    --eco-primary: #008EA6;
    --eco-primary-light: #4fc7dd;
    --eco-primary-rgb: 5, 89, 53;
    --eco-accent: #008EA6;
    --eco-dark: #1a1a2e;
    --eco-gray-50: #f8fafc;
    --eco-gray-100: #f1f5f9;
    --eco-gray-200: #e2e8f0;
    --eco-gray-400: #94a3b8;
    --eco-gray-600: #475569;
    --eco-gray-800: #1e293b;
    --eco-radius: 14px;
    --eco-radius-sm: 8px;
    --eco-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --eco-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --eco-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --eco-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Product Card ─── */
.eco-product-card {
    background: #fff;
    border-radius: var(--eco-radius);
    overflow: hidden;
    border: 1px solid var(--eco-gray-200);
    transition: var(--eco-transition);
    display: flex;
    flex-direction: column;
}

.eco-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--eco-shadow-lg);
    border-color: rgba(var(--eco-primary-rgb), 0.25);
}

.eco-card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.eco-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.eco-badge-discount {
    background: rgba(var(--eco-primary-rgb), 0.9);
    color: #fff;
}

.eco-badge-oos {
    background: rgba(220, 38, 38, 0.88);
    color: #fff;
    margin-left: auto;
}

.eco-card-img-wrap {
    display: block;
    overflow: hidden;
    background: var(--eco-gray-50);
    position: relative;
}

.eco-card-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.eco-card-body {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.eco-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.eco-card-title a {
    color: var(--eco-gray-800);
    text-decoration: none;
    transition: color 0.2s;
}

.eco-card-title a:hover {
    color: var(--eco-primary);
}

.eco-card-price {
    margin-bottom: 6px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.eco-price-current {
    font-size: 1rem;
    font-weight: 700;
    color: var(--eco-primary);
}

.eco-price-old {
    font-size: 0.78rem;
    color: var(--eco-gray-400);
    text-decoration: line-through;
}

.eco-card-rating {
    margin-top: auto;
    font-size: 0.72rem;
    color: #f59e0b;
}

.eco-card-rating i {
    margin-right: 1px;
}

.eco-rating-count {
    color: var(--eco-gray-400);
    font-size: 0.7rem;
    margin-left: 3px;
}

.eco-product-card-grid .eco-card-img {
    height: 160px;
}

/* ─── Vendor Card ─── */
.eco-vendor-card {
    background: #fff;
    border-radius: var(--eco-radius);
    overflow: hidden;
    border: 1px solid var(--eco-gray-200);
    transition: var(--eco-transition);
    display: flex;
    flex-direction: column;
}

.eco-vendor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--eco-shadow-lg);
}

.eco-vendor-banner {
    position: relative;
    height: 140px;
    overflow: hidden;
}

.eco-vendor-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.eco-vendor-card:hover .eco-vendor-banner img {
    transform: scale(1.06);
}

.eco-vendor-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
}

.eco-vendor-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-top: -32px;
    position: relative;
    z-index: 3;
}

.eco-vendor-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: var(--eco-shadow-md);
    object-fit: cover;
    background: #fff;
}

.eco-vendor-body {
    padding: 10px 16px 16px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.eco-vendor-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--eco-gray-800);
    margin-bottom: 2px;
}

.eco-vendor-shop {
    font-size: 0.78rem;
    color: var(--eco-gray-400);
    margin-bottom: 12px;
}

.eco-vendor-stats {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: auto;
    flex-wrap: wrap;
}

.eco-vendor-stat-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--eco-transition);
}

.eco-vendor-stat-primary {
    background: var(--eco-primary);
    color: #fff;
}

.eco-vendor-stat-primary:hover {
    background: var(--eco-primary-light);
    color: #fff;
}

.eco-vendor-stat-outline {
    background: transparent;
    color: var(--eco-primary);
    border: 1.5px solid var(--eco-primary);
}

.eco-vendor-stat-outline:hover {
    background: var(--eco-primary);
    color: #fff;
}

/* ─── Category Card ─── */
.eco-category-item {
    text-align: center;
    transition: var(--eco-transition);
}

.eco-category-item:hover {
    transform: translateY(-2px);
}

.eco-category-img-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 8px;
    border: 3px solid var(--eco-gray-200);
    transition: var(--eco-transition);
}

.eco-category-item:hover .eco-category-img-wrap {
    border-color: var(--eco-primary);
    box-shadow: 0 0 0 4px rgba(var(--eco-primary-rgb), 0.12);
}

.eco-category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eco-category-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--eco-gray-600);
}

/* ─── Sidebar Category Dropdowns (Mega Menu) ─── */
.category-list .list-group-item {
    transition: var(--eco-transition);
    cursor: pointer;
    border-left: 3px solid transparent;
}

.category-list .list-group-item:hover {
    background: var(--eco-gray-50);
    border-left-color: var(--eco-primary);
    color: var(--eco-primary);
}

.subcategory-dropdown {
    position: absolute;
    top: -1px;
    left: 100%;
    width: 650px;
    background: #fff;
    box-shadow: 15px 0 35px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--eco-gray-200);
    border-radius: 0 var(--eco-radius) var(--eco-radius) var(--eco-radius);
    z-index: 1000;
    display: none;
    padding: 25px;
    min-height: calc(100% + 2px);
}

.category-list .list-group-item:hover .subcategory-dropdown {
    display: block;
    animation: ecoFadeIn 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes ecoFadeIn {
    from {
        opacity: 0;
        transform: translateX(15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.subcategory-group-title {
    font-weight: 800;
    color: var(--eco-primary);
    font-size: 0.95rem;
    text-decoration: none;
    display: block;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--eco-gray-50);
}

.subcategory-group-title:hover {
    color: var(--eco-accent);
}

.subcategory-item {
    list-style: none;
    margin-bottom: 6px;
}

.subcategory-item a {
    font-weight: 500;
    color: var(--eco-gray-600);
    font-size: 0.82rem;
    text-decoration: none;
    transition: var(--eco-transition);
    display: block;
}

.subcategory-item a:hover {
    color: var(--eco-primary);
    transform: translateX(5px);
}


/* ─── Brand Card ─── */
.eco-brand-item {
    text-align: center;
    transition: var(--eco-transition);
}

.eco-brand-item:hover {
    transform: translateY(-2px);
}

.eco-brand-img-wrap {
    width: 85px;
    height: 85px;
    border-radius: var(--eco-radius-sm);
    overflow: hidden;
    margin: 0 auto 8px;
    box-shadow: var(--eco-shadow);
    border: 1px solid var(--eco-gray-200);
    transition: var(--eco-transition);
}

.eco-brand-item:hover .eco-brand-img-wrap {
    border-color: var(--eco-primary);
    box-shadow: var(--eco-shadow-md);
}

.eco-brand-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.eco-brand-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--eco-gray-600);
}

/* ─── Feature Strip ─── */
.eco-features-strip {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 28px 16px;
    background: var(--eco-gray-50);
    border-top: 1px solid var(--eco-gray-200);
    flex-wrap: wrap;
}

.eco-feature-item {
    text-align: center;
    min-width: 140px;
}

.eco-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(var(--eco-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 1.2rem;
    color: var(--eco-primary);
}

.eco-feature-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--eco-gray-800);
    margin-bottom: 2px;
}

.eco-feature-text {
    font-size: 0.68rem;
    color: var(--eco-gray-400);
    margin: 0;
}

/* ════════════════════════════════════
   RESPONSIVE — Mobile First
   ════════════════════════════════════ */
@media (max-width: 767px) {

    /* Product cards in carousel */
    .eco-card-img {
        height: 130px !important;
        padding: 8px !important;
    }

    .eco-card-body {
        padding: 8px 10px 10px !important;
    }

    .eco-card-title {
        font-size: 0.72rem !important;
        margin-bottom: 4px !important;
    }

    .eco-price-current {
        font-size: 0.82rem !important;
    }

    .eco-price-old {
        font-size: 0.68rem !important;
    }

    .eco-card-rating {
        font-size: 0.62rem !important;
    }

    .eco-badge {
        font-size: 0.6rem !important;
        padding: 2px 7px !important;
    }

    /* Grid products — 3 cols on mobile */
    .eco-product-card-grid .eco-card-img {
        height: 110px !important;
    }

    /* Vendor cards tighter */
    .eco-vendor-banner {
        height: 100px;
    }

    .eco-vendor-avatar {
        width: 48px;
        height: 48px;
    }

    .eco-vendor-avatar-wrap {
        margin-top: -24px;
    }

    .eco-vendor-name {
        font-size: 0.8rem;
    }

    .eco-vendor-shop {
        font-size: 0.68rem;
    }

    .eco-vendor-stat-btn {
        font-size: 0.62rem;
        padding: 4px 8px;
    }

    /* Category */
    .eco-category-img-wrap {
        width: 65px;
        height: 65px;
        border-width: 2px;
    }

    .eco-category-name {
        font-size: 0.65rem;
    }

    /* Brand */
    .eco-brand-img-wrap {
        width: 70px;
        height: 70px;
    }

    .eco-brand-name {
        font-size: 0.65rem;
    }

    /* Feature strip */
    .eco-features-strip {
        gap: 20px;
        padding: 18px 10px;
    }

    .eco-feature-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .eco-feature-title {
        font-size: 0.62rem;
    }

    .eco-feature-text {
        font-size: 0.58rem;
    }
}

@media (max-width: 400px) {
    .eco-card-img {
        height: 100px !important;
    }

    .eco-card-title {
        font-size: 0.65rem !important;
    }

    .eco-price-current {
        font-size: 0.72rem !important;
    }
}

/* ─── Product Detail Page ─── */
.eco-detail-image-wrap {
    background: var(--eco-gray-50);
    border-radius: var(--eco-radius);
    padding: 20px;
    border: 1px solid var(--eco-gray-200);
}

.eco-detail-main-img {
    width: 100%;
    height: 450px;
    object-fit: contain;
    transition: var(--eco-transition);
}

.eco-detail-thumbnails {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.eco-thumb-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    padding: 8px;
    border: 2px solid var(--eco-gray-200);
    border-radius: var(--eco-radius-sm);
    cursor: pointer;
    background: #fff;
    transition: var(--eco-transition);
}

.eco-thumb-img:hover,
.eco-thumb-img.active {
    border-color: var(--eco-primary);
    box-shadow: 0 0 0 3px rgba(var(--eco-primary-rgb), 0.1);
}

.eco-detail-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--eco-gray-800);
    margin-bottom: 12px;
}

.eco-detail-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
}

.eco-detail-price {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--eco-primary);
}

.eco-detail-price-old {
    font-size: 1.25rem;
    color: var(--eco-gray-400);
    text-decoration: line-through;
}

.eco-detail-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eco-detail-badge-stock {
    background: rgba(var(--eco-primary-rgb), 0.1);
    color: var(--eco-primary);
}

.eco-detail-badge-oos {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.eco-attribute-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--eco-gray-800);
    margin-bottom: 10px;
    display: block;
}

/* Color select */
.eco-color-wrap {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.eco-color-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--eco-gray-200);
    cursor: pointer;
    transition: var(--eco-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.eco-color-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.eco-color-dot:hover,
.eco-color-dot.active {
    transform: scale(1.18);
    box-shadow: 0 0 0 2px var(--eco-primary), var(--eco-shadow-md);
    z-index: 2;
}

/* Size select */
.eco-size-options {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.eco-size-radio {
    display: none;
}

.eco-size-label {
    min-width: 45px;
    padding: 6px 14px;
    border: 1px solid var(--eco-gray-200);
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--eco-transition);
    background: #fff;
}

.eco-size-radio:checked+.eco-size-label {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}

/* Action buttons */
.eco-qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--eco-gray-200);
    border-radius: 12px;
    overflow: hidden;
    width: fit-content;
    background: #fff;
}

.eco-qty-btn {
    background: #f8fafc;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #475569;
}

.eco-qty-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.eco-qty-input {
    width: 60px;
    border: none;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
}

.eco-btn-add-cart {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.eco-btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.3);
    color: #fff;
    filter: brightness(1.1);
}

.eco-btn-add-cart:active {
    transform: translateY(0);
}

.eco-btn-order-now {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.eco-btn-order-now::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transition: 0.5s;
}

.eco-btn-order-now:hover::before {
    left: 100%;
}

.eco-btn-order-now:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    color: #fff;
    filter: brightness(1.1);
}

.eco-btn-order-now i {
    animation: ecoLightningFlash 2s infinite;
}

@keyframes ecoLightningFlash {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.15);
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    }
}

/* Trust features */
.eco-trust-box {
    display: flex;
    gap: 15px;
    padding: 20px;
    border: 1px solid var(--eco-gray-200);
    border-radius: var(--eco-radius);
    margin-bottom: 12px;
    background: #fff;
    transition: var(--eco-transition);
}

.eco-trust-box:hover {
    border-color: var(--eco-primary);
    box-shadow: var(--eco-shadow-md);
    transform: translateX(5px);
}

.eco-trust-icon {
    font-size: 1.65rem;
    color: var(--eco-primary);
    opacity: 0.9;
}

.eco-trust-title {
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--eco-gray-800);
}

.eco-trust-text {
    font-size: 0.78rem;
    color: var(--eco-gray-400);
    margin: 0;
}

/* Tabs */
.eco-tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--eco-gray-200);
    gap: 30px;
    margin-bottom: 20px;
}

.eco-tab-link {
    padding: 15px 0;
    font-weight: 700;
    font-size: 1rem;
    color: var(--eco-gray-400);
    background: none;
    border: none;
    position: relative;
    transition: var(--eco-transition);
}

.eco-tab-link.active {
    color: var(--eco-primary);
}

.eco-tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--eco-primary);
    border-radius: 3px 3px 0 0;
}

.eco-tab-pane {
    padding: 20px 0;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .eco-detail-main-img {
        height: 300px;
    }

    .eco-detail-title {
        font-size: 1.5rem;
    }

    .eco-detail-price {
        font-size: 1.75rem;
    }

    .eco-tabs-nav {
        gap: 15px;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Checkout Premium Styles */
.eco-btn-place-order {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    border: none !important;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
}

.eco-btn-place-order:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.35);
    color: #fff;
    filter: brightness(1.05);
}

.eco-btn-place-order:active {
    transform: translateY(-1px);
}

.eco-btn-place-order i {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.eco-btn-place-order:hover i {
    transform: rotate(15deg) scale(1.1);
}