/* ============================================================
   ECommerce Public Pages – Shared Styles
   Used by: Home, Search, ProductDetail, ShopDetail views
   ============================================================ */

/* ----- Product Card ----- */
.ec-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
    border: 1px solid #f0f0f0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ec-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.ec-card-img {
    position: relative;
    padding-top: 75%;
    /* 4:3 ratio */
    overflow: hidden;
    background: #f8f8f8;
}

.ec-card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.ec-card:hover .ec-card-img img {
    transform: scale(1.07);
}

.ec-card-img .ec-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 1;
}

.ec-card-img .ec-badge-featured {
    background: linear-gradient(135deg, #47e475, #00b894);
}

.ec-no-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ddd;
}

.ec-card-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ec-card-cat {
    font-size: 11px;
    color: #3cb371;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ec-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.ec-card-name a {
    color: inherit;
    text-decoration: none;
}

.ec-card-name a:hover {
    color: #3cb371;
}

.ec-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ec-price-current {
    font-size: 16px;
    font-weight: 700;
    color: #e74c3c;
}

.ec-price-original {
    font-size: 13px;
    color: #aaa;
    text-decoration: line-through;
}

.ec-price-discount {
    font-size: 11px;
    background: #ffeaea;
    color: #e74c3c;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* ----- Section heading ----- */
.ec-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #283a5a;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 24px;
}

.ec-section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(135deg, #47e475, #00b894);
    border-radius: 2px;
}

.ec-section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* ----- Category chip ----- */
.ec-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f9f5;
    border: 1px solid #d4eddd;
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    transition: background 0.25s, color 0.25s, border 0.25s, transform 0.2s;
    white-space: nowrap;
}

.ec-cat-chip:hover,
.ec-cat-chip.active {
    background: linear-gradient(135deg, #47e475, #00b894);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
}

.ec-cat-chip i {
    font-size: 18px;
}

/* ----- Seller card ----- */
.ec-seller-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    transition: box-shadow 0.3s, transform 0.3s;
    text-decoration: none;
    display: block;
    color: inherit;
}

.ec-seller-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    color: inherit;
}

.ec-seller-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
    border: 3px solid #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f9f5;
    font-size: 32px;
    color: #3cb371;
}

.ec-seller-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ec-seller-name {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
}

.ec-seller-meta {
    font-size: 12px;
    color: #888;
}

.ec-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 6px;
}

/* ----- Page hero (search banner) ----- */
.ec-page-hero {
    background-color: #283a5a;
    background-image: url('/webbg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    padding: 48px 0 36px;
    color: white;
}

.ec-page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 45, 64, .82) 0%, rgba(26, 44, 30, .72) 100%);
}

.ec-page-hero>* {
    position: relative;
    z-index: 1;
}

.ec-page-hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}


.ec-search-bar-lg {
    display: flex;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 600px;
}

.ec-search-bar-lg input {
    flex: 1;
    border: 0;
    padding: 14px 22px;
    font-size: 15px;
    outline: none;
    color: #333;
}

.ec-search-bar-lg button {
    background: linear-gradient(135deg, #47e475, #00b894);
    border: 0;
    padding: 0 24px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ec-search-bar-lg button:hover {
    opacity: 0.85;
}

/* ----- Search sidebar ----- */
.ec-sidebar {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
}

.ec-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.ec-filter-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: color 0.2s;
}

.ec-filter-link:hover,
.ec-filter-link.active {
    color: #3cb371;
    font-weight: 600;
}

.ec-filter-count {
    font-size: 12px;
    background: #f0f0f0;
    color: #888;
    padding: 1px 7px;
    border-radius: 20px;
}

/* ----- Sort + result count bar ----- */
.ec-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.ec-result-count {
    font-size: 14px;
    color: #666;
}

.ec-sort-select {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 14px;
    color: #555;
    background: #fff;
    cursor: pointer;
}

/* ----- Pagination ----- */
.ec-pagination .page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    color: #283a5a;
    border-color: #e0e0e0;
    font-size: 14px;
}

.ec-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #47e475, #00b894);
    border-color: transparent;
    color: white;
}

.ec-pagination .page-link:hover {
    background: #f3f9f5;
    color: #3cb371;
}

/* ----- Product detail ----- */
.ec-detail-img-main {
    border-radius: 14px;
    overflow: hidden;
    background: #f8f8f8;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ec-detail-img-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ec-thumb-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.ec-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
    background: #f8f8f8;
}

.ec-thumb.active,
.ec-thumb:hover {
    border-color: #3cb371;
}

.ec-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ec-detail-name {
    font-size: 24px;
    font-weight: 700;
    color: #1a2a3e;
    margin-bottom: 12px;
    line-height: 1.35;
}

.ec-detail-price-box {
    background: #fafafa;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.ec-detail-price {
    font-size: 28px;
    font-weight: 700;
    color: #e74c3c;
}

.ec-detail-price-orig {
    font-size: 16px;
    color: #aaa;
    text-decoration: line-through;
    margin-left: 10px;
}

.ec-detail-badge {
    display: inline-block;
    background: #ffeaea;
    color: #e74c3c;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    margin-left: 10px;
}

.ec-stock-ok {
    color: #2e7d32;
    font-weight: 600;
    font-size: 14px;
}

.ec-stock-low {
    color: #f57c00;
    font-weight: 600;
    font-size: 14px;
}

.ec-stock-out {
    color: #c62828;
    font-weight: 600;
    font-size: 14px;
}

/* ----- Seller info box (detail page) ----- */
.ec-seller-box {
    border: 1px solid #e8f5e9;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f9fef9;
    text-decoration: none;
    transition: box-shadow 0.2s;
}

.ec-seller-box:hover {
    box-shadow: 0 4px 16px rgba(60, 179, 113, 0.15);
}

.ec-seller-box-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #3cb371;
    flex-shrink: 0;
    overflow: hidden;
}

.ec-seller-box-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ec-seller-box-name {
    font-weight: 700;
    color: #1a2a3e;
    font-size: 15px;
}

.ec-seller-box-meta {
    font-size: 12px;
    color: #888;
}

/* ----- Shop profile header ----- */
.ec-shop-header {
    background-color: #283a5a;
    background-image: url('/webbg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    padding: 40px 0;
    color: white;
}

.ec-shop-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 45, 64, .85) 0%, rgba(20, 60, 45, .78) 100%);
}

.ec-shop-header>* {
    position: relative;
    z-index: 1;
}


.ec-shop-logo-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.ec-shop-logo-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ec-shop-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.ec-shop-stat {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* ----- Empty state ----- */
.ec-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.ec-empty i {
    font-size: 64px;
    color: #ddd;
    display: block;
    margin-bottom: 16px;
}

.ec-empty p {
    font-size: 16px;
}