/**
 * Shop Page Styles (cards, list, filters, search, empty states, pagination)
 * Part of: local_edwiserstore
 * Version: v2025121604 | CSS Split refactoring — March 2026
 */

/* Shop Page Styles */
.local-edwiserstore-shop-page {
    padding: 24px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-height: calc(100vh - 200px);
}

/* Filters bar - no background or border */
.shop-filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    padding: 8px 0px;
}

.shop-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.shop-search-input {
    width: 100%;
    padding: 10px 38px 10px 36px;
    border: 1px solid var(--edw-border-light);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: var(--edw-text-dark-alt);
}

.shop-search-input::placeholder {
    color: var(--edw-text-light);
}

.shop-search-input:focus {
    outline: none;
    border-color: var(--edw-primary);
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.1);
}

.shop-search-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--edw-text-light);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.shop-search-btn:hover {
    color: var(--edw-primary);
}

.shop-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--edw-text-light);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.shop-search-clear:hover {
    color: var(--edw-error-clear);
    background: var(--edw-error-clear-bg);
}

.shop-category-wrapper {
    min-width: 180px;
}

.shop-category-select,
.shop-sort-select {
    padding: 10px 32px 10px 12px;
    border: 1px solid var(--edw-border-light);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    appearance: none;
    color: var(--edw-text-dark-alt);
    min-width: 150px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
}

.shop-category-select:focus,
.shop-sort-select:focus {
    outline: none;
    border-color: var(--edw-primary);
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.1);
}

.shop-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.shop-view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--edw-border-light);
    border-radius: 6px;
    padding: 0;
    background: white;
    overflow: hidden;
}

.shop-view-btn {
    background: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--edw-text-muted-alt);
    transition: all 0.2s;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    border-radius: 0;
    margin: 0;
}

.shop-view-icon {
    width: 16px;
    height: 16px;
    display: block;
    pointer-events: none;
    flex-shrink: 0;
}

.shop-view-btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.shop-view-btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.shop-view-btn:not(:last-child) {
    border-right: 1px solid var(--edw-border-light);
}

.shop-view-btn.active {
    background: var(--edw-primary);
    color: white;
    border-right-color: transparent;
}

.shop-view-btn.active+.shop-view-btn {
    border-left: none;
}

.shop-view-btn:hover:not(.active) {
    background: var(--edw-bg-input);
}

.shop-view-btn:not(.active) .shop-view-icon {
    color: var(--edw-text-muted-alt);
}

.shop-view-btn:hover:not(.active) .shop-view-icon {
    color: var(--edw-primary);
}

.shop-view-btn.active .shop-view-icon {
    color: white;
}

.shop-view-btn.active:hover {
    background: var(--edw-primary-hover);
}

.shop-view-btn.active:hover .shop-view-icon {
    color: white;
}

.shop-product-count {
    margin-bottom: 24px;
    color: var(--edw-text-muted-alt);
    font-size: 14px;
    font-weight: 400;
}

/* Empty States */
.shop-empty-state {
    text-align: center;
    padding: 60px 20px 80px;
    margin-top: 40px;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.shop-empty-state .empty-icon {
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.shop-empty-state .empty-illustration {
    width: 200px;
    height: 200px;
    max-width: 100%;
    display: block;
}

.shop-empty-state .empty-message {
    font-size: 24px;
    color: var(--edw-text-body);
    font-weight: 600;
    margin-top: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: -0.015em;
    line-height: 1.4;
}

/* Products Container */
.shop-products-container {
    margin-bottom: 40px;
    padding-top: 23px;
    border-top: 1px solid var(--edw-border-faint);
}

/* Card View - Grid Layout */
.shop-products-container.shop-view-card {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(344px, 1fr));
    /* Figma: card width 344px */
    gap: 24px;
    width: 100%;
}

/* Card wrapper - should not interfere with grid layout */
.shop-product-card-wrapper {
    width: 100%;
}

/* Responsive grid columns */

.shop-product-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--edw-bg-tag);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    min-width: 0;
    /* Prevent flex items from expanding beyond container */
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: none;
}

.shop-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.shop-product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    /* Prevent flex items from expanding beyond container */
    width: 100%;
}

.shop-product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 344 / 200;
    /* Figma grid view image 344x200 */
    overflow: hidden;
    background: var(--edw-bg-input);
    border-radius: 8px 8px 0 0;
}

.shop-product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-product-label {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    /* tighter padding */
    border-radius: 3px;
    /* match Figma tag */
    font-size: 12px;
    /* slightly smaller text */
    font-weight: 600;
    background-color: var(--edw-white);
    z-index: 10;
    letter-spacing: 0.05em;
    /* subtle spacing */
    text-transform: uppercase;
    line-height: 1;
}

.shop-label-featured {
    color: var(--edw-accent);
    /* Figma primary blue */
}

.shop-label-popular {
    color: var(--edw-tag-orange);
    /* Figma orange */
}

.shop-label-custom {
    color: var(--edw-tag-orange-alt);
    /* placeholder secondary */
}

/* Category tag positioned below image, centered */
.shop-product-category-tag {
    background: var(--edw-bg-tag);
    color: var(--edw-text-nav);
    margin: -12px auto 12px 12px;
    /* center horizontally */
    padding: 4px 12px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    font-weight: 600;
    z-index: 5;
    position: relative;
    display: block;
    /* allows auto margins */
    width: fit-content;
    max-width: calc(100% - 32px);
    /* Safety fallback */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    text-align: center;
    font-size: 12px;
}

.shop-product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.shop-product-title {
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 14px;
    margin-top: 0;
    color: var(--edw-text-nav);
    line-height: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-product-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--edw-text-muted-alt);
    flex-wrap: wrap;
    justify-content: space-between;
}

.shop-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shop-meta-item i {
    font-size: 12px;
}

/* Star icon styling for ratings - yellow/gold color */
.shop-meta-item i.fa-star {
    color: var(--edw-star-alt);
    /* Amber/yellow color matching design */
    font-size: 13px;
}

/* Footer section with price and button */
.shop-product-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
}

.shop-product-price {
    font-size: 16px;
    font-weight: 700;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.shop-price-free,
.shop-price-enrolled,
.shop-price-actual {
    color: var(--edw-primary);
}

.shop-price-original {
    color: var(--edw-text-light);
    text-decoration: line-through;
    font-size: 14px;
    font-weight: 400;
    margin-right: 0;
    line-height: 1.2;
}

.shop-product-btn {
    padding: 8px 16px;
    background: white;
    color: var(--edw-accent);
    border: 1px solid var(--edw-accent);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
    height: fit-content;
}

.shop-product-btn:hover {
    background: var(--edw-accent);
    color: white;
    border-color: var(--edw-accent);
}

/* List View */
.shop-products-container.shop-view-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* List wrapper - should not interfere with flex layout */
.shop-product-list-wrapper {
    width: 100%;
}

.shop-product-list-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.shop-product-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shop-product-list-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    gap: 20px;
}

/* List view image wrapper fixed size */
.shop-product-list-image-wrapper {
    position: relative;
    width: 390px;
    min-width: 390px;
    height: 208px;
    /* Figma list view image 390x208 */
    overflow: hidden;
    background: var(--edw-bg-input);
}

.shop-product-list-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-product-list-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.shop-product-description {
    color: var(--edw-text-muted-alt);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-product-list-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--edw-text-muted-alt);
}

.shop-product-list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.shop-product-list-footer .shop-product-btn {
    width: auto;
    min-width: 140px;
}

/* Pagination */
.shop-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.shop-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--edw-border-light);
    border-radius: 6px;
    color: var(--edw-text-body);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.shop-pagination-link:hover {
    background: var(--edw-bg-input);
    border-color: var(--edw-primary);
    color: var(--edw-primary);
}

.shop-pagination-link.active {
    background: var(--edw-primary);
    border-color: var(--edw-primary);
    color: white;
}

.shop-pagination-ellipsis {
    padding: 0 8px;
    color: var(--edw-text-muted-alt);
}

/* Product Price Cell in Tables */
.product-price-cell {
    white-space: nowrap;
}

.product-price-cell .text-muted {
    text-decoration: line-through;
    margin-right: 8px;
}

/* Responsive */