/* =========================================
   Shop Page Styles
   ========================================= */

/* Layout */
.shop-layout {
    padding-top: 40px;
    padding-bottom: 80px;
}

.shop-layout__container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* =========================================
   Sidebar (Widgets)
   ========================================= */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.ec-widget {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
}

.widget-title {
    font-size: 18px;
    color: var(--color-secondary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-light-gray);
    position: relative;
    font-family: var(--font-en);
    text-transform: uppercase;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--color-primary);
}

/* Search Widget Fix */
.ec-widget-search .search-form {
    position: relative;
    width: 100%;
    display: block;
}

.ec-widget-search .search-form label {
    display: block;
    width: 100%;
    margin: 0;
    position: relative;
}

.ec-widget-search .search-field {
    width: 100%;
    height: 50px;
    padding: 0 55px 0 20px;
    border: 1px solid var(--color-border);
    border-radius: 25px;
    outline: none;
    font-family: var(--font-jp);
    transition: var(--transition);
    background-color: white;
    box-sizing: border-box;
    display: block;
}

.ec-widget-search .search-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.ec-widget-search .search-submit {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: var(--color-primary);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    z-index: 2;
}

.ec-widget-search .search-submit:hover {
    background: var(--color-primary-dark);
}

/* Category Widget */
.product-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cat-item {
    margin-bottom: 8px;
    font-size: 14px;
}

.cat-item-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--color-border);
    cursor: pointer;
    transition: var(--transition);
}

.cat-item-inner:hover {
    color: var(--color-primary);
}

.cat-item-inner a {
    flex-grow: 1;
    font-weight: 500;
    color: var(--color-secondary);
}

.cat-item-inner:hover a {
    color: var(--color-primary);
}

.count {
    color: var(--color-text-light);
    font-size: 12px;
    background: var(--color-light-gray);
    padding: 2px 8px;
    border-radius: 10px;
    margin: 0 5px;
}

.cat-toggle {
    font-size: 10px;
    color: var(--color-text-light);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 50%;
}

.cat-item.active>.cat-item-inner .cat-toggle i {
    transform: rotate(45deg);
}

/* Sub Categories */
.children {
    list-style: none;
    padding-left: 15px;
    margin-top: 5px;
    display: none;
    border-left: 2px solid var(--color-light-gray);
}

.cat-item.active>.children {
    display: block;
}

.children .cat-item {
    margin-bottom: 5px;
}

.children .cat-item a {
    font-size: 13px;
    color: var(--color-text-light);
}

.children .cat-item a:hover {
    color: var(--color-primary);
}

/* Price Filter Widget */
.price_slider_wrapper {
    padding-top: 10px;
}

.price_slider {
    position: relative;
    height: 6px;
    background: #e1e1e1;
    border-radius: 3px;
    margin-bottom: 25px;
}

.price_slider_track {
    position: absolute;
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    left: 0;
    right: 0;
    z-index: 1;
}

.range-input {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
    margin: 0;
    padding: 0;
    height: 6px;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--color-primary);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    margin-top: 0;
}

.range-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--color-primary);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.price_slider_amount {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    font-size: 14px;
    font-weight: 600;
}

.price_slider_amount .button {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 25px;
    border-radius: 30px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.price_slider_amount .button:hover {
    background: var(--color-primary-dark);
}

.price_label {
    color: var(--color-secondary);
    font-family: var(--font-en);
    font-weight: 700;
}

.price_label span {
    color: var(--color-primary);
    font-weight: 700;
}

/* Tag Cloud Widget */
.tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud-link {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 12px;
    color: var(--color-text-light);
    transition: var(--transition);
    text-transform: uppercase;
}

.tag-cloud-link:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.tag-link-sale {
    border-color: var(--color-accent-pink);
    color: var(--color-accent-pink);
}

.tag-link-sale:hover {
    background: var(--color-accent-pink);
    border-color: var(--color-accent-pink);
}

/* Featured Items Widget */
.ec-product-list-widget {
    list-style: none;
    padding: 0;
}

.ec-product-list-widget li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-light-gray);
}

.ec-product-list-widget li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ec-product-list-widget img {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
}

.ec-product-list-widget a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-secondary);
    font-weight: 600;
    font-size: 14px;
}

.ec-product-list-widget .product-title {
    display: block;
    margin-bottom: 2px;
}

.category-name {
    display: none;
}

.ec-product-list-widget .amount {
    display: block;
    font-size: 13px;
    color: var(--color-primary);
    font-weight: 700;
    margin-left: auto;
}

/* Featured Products Widget - New Style */
.featured-product-link {
    display: flex !important;
    align-items: flex-start !important;
    gap: 15px !important;
    padding: 10px 0;
    transition: opacity 0.3s ease;
}

.featured-product-link:hover {
    opacity: 0.8;
}

.featured-product-link img {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.featured-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.featured-category {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-en);
    letter-spacing: 0.5px;
}

.featured-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-secondary);
    line-height: 1.3;
}

.featured-rating {
    font-size: 10px;
    color: #ffc107;
}

.featured-rating .fa-regular {
    color: #ccc;
}

.featured-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-en);
}

.featured-price del {
    color: var(--color-text-light);
    font-size: 12px;
    margin-right: 5px;
}

.featured-price ins {
    text-decoration: none;
}

/* Envato Badge */
.envato-badge {
    background: #82B541;
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.envato-icon {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.2;
    position: absolute;
    top: -10px;
    right: -10px;
    transform: rotate(20deg);
}

.envato-text {
    margin-bottom: 15px;
}

.envato-text strong {
    display: block;
    font-size: 18px;
}

.envato-text span {
    font-size: 12px;
    opacity: 0.9;
}

.follow-link {
    display: inline-block;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.follow-link:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Sidebar Banner */
.sidebar-banner {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.sidebar-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.banner-text {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.banner-text span {
    display: block;
    font-weight: 700;
    font-size: 18px;
}

/* =========================================
   Main Content
   ========================================= */

/* Shop Hero */
.shop-hero {
    background: linear-gradient(135deg, #a8ff78 0%, #78ffd6 100%);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    border-radius: var(--border-radius);
    padding: 40px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.shop-hero__content {
    z-index: 2;
    position: relative;
}

.shop-hero__subtitle {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-secondary);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.shop-hero__title {
    font-size: 42px;
    color: #2E7D32;
    line-height: 1.1;
    margin-bottom: 10px;
    font-family: var(--font-en);
}

.shop-hero__desc {
    font-size: 16px;
    color: var(--color-secondary);
    font-weight: 500;
}

.shop-hero__image img {
    width: 200px;
    height: auto;
    transform: rotate(-10deg);
    z-index: 2;
    position: relative;
}

/* Toolbar */
.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
}

.shop-toolbar__result-count {
    font-size: 13px;
    color: var(--color-text-light);
    font-weight: 600;
}

.shop-toolbar__ordering {
    display: flex;
    gap: 10px;
    margin-left: auto;
    align-items: center;
}

.ordering-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ordering-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-secondary);
}

.orderby {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 13px;
    color: var(--color-text);
    outline: none;
    cursor: pointer;
}

.shop-toolbar__view-switcher {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.view-btn {
    background: none;
    border: 1px solid var(--color-border);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition);
}

.view-btn.active,
.view-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Product Grid */
.ec-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

/* No Products Message */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 30px;
    background: #f9f9f9;
    border-radius: var(--border-radius);
    color: var(--color-text-light);
    font-size: 16px;
}

/* List View Override */
.ec-products-grid.list-view {
    grid-template-columns: 1fr;
}

.ec-products-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: auto;
}

.ec-products-grid.list-view .product-card__thumb {
    width: 250px;
    min-height: 250px;
    height: auto;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.ec-products-grid.list-view .product-card__thumb img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.ec-products-grid.list-view .product-card__info {
    padding: 20px 25px;
    flex-grow: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ec-products-grid.list-view .product-card__excerpt {
    display: block;
}

/* List View - Actions hidden by default, shown on hover */
.ec-products-grid.list-view .product-card__actions {
    position: absolute;
    right: 10px;
    top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    z-index: 10;
}

/* List View - Show actions on hover */
.ec-products-grid.list-view .product-card:hover .product-card__actions {
    opacity: 1;
    transform: translateX(0);
}

/* List View - Show separate actions container */
.ec-products-grid.list-view .product-card__actions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    justify-content: center;
    border-left: 1px solid var(--color-border);
}

.ec-products-grid.list-view .product-card__actions-list .add-to-cart-btn,
.ec-products-grid.list-view .add_to_cart_button {
    white-space: nowrap;
    padding: 10px 20px;
    width: auto;
    min-width: 150px;
}

/* Grid View - Hide list-specific actions */
.ec-products-grid:not(.list-view) .product-card__actions-list {
    display: none;
}

/* Product Card Styling (Specific to Shop) */
.product-card__info {
    text-align: left;
}

.product-card__rating {
    margin: 0 0 10px;
    justify-content: flex-start;
    display: flex;
}

.product-card__title a {
    color: var(--color-secondary);
    transition: var(--transition);
}

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

.product-card__excerpt {
    display: none;
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 15px;
    line-height: 1.5;
}

.product-card__price {
    justify-content: flex-start;
}

/* Wishlist Button on Image */
.wishlist-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: white;
    color: var(--color-primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.wishlist-btn:hover,
.wishlist-btn.active {
    background: var(--color-primary);
    color: white;
}

/* Pagination */
.ec-pagination {
    text-align: center;
}

.page-numbers {
    display: flex;
    justify-content: center;
    gap: 10px;
    list-style: none;
    padding: 0;
}

.page-numbers li {
    display: inline-block;
}

.page-numbers a,
.page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--color-border);
    color: var(--color-text-light);
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
}

.page-numbers a:hover,
.page-numbers .current {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.page-numbers .dots {
    border: none;
    background: transparent;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 1024px) {
    .shop-layout__container {
        grid-template-columns: 240px 1fr;
        gap: 20px;
    }

    .ec-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .shop-layout__container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .shop-content {
        order: 1;
    }

    .ec-products-grid {
        grid-template-columns: 1fr;
    }

    .ec-products-grid.list-view .product-card {
        flex-direction: column;
    }

    .ec-products-grid.list-view .product-card__thumb {
        width: 100%;
        height: 200px;
    }

    .shop-toolbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .shop-toolbar__ordering {
        flex-direction: column;
        width: 100%;
    }

    .ordering-group {
        justify-content: space-between;
    }

    .shop-hero {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }

    .shop-hero__image {
        margin-top: 20px;
    }
}

/* =========================================
   Sidebar Search Results
   ========================================= */
.sidebar-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 5px;
}

.ec-widget-search {
    position: relative;
}

.sidebar-search-results .search-results-list {
    padding: 5px;
}

.sidebar-search-results .search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-search-results .search-result-item:hover {
    background: #f5f5f5;
}

.sidebar-search-results .search-result-image {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
}

.sidebar-search-results .search-result-info {
    flex: 1;
    min-width: 0;
}

.sidebar-search-results .search-result-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-search-results .search-result-category {
    font-size: 10px;
    color: var(--color-text-light);
    text-transform: uppercase;
}

.sidebar-search-results .search-result-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
}

.sidebar-search-results .search-no-results {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-light);
}

.sidebar-search-results .search-view-all {
    display: block;
    text-align: center;
    padding: 10px;
    background: #f5f5f5;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border-top: 1px solid var(--color-border);
}

.sidebar-search-results .search-view-all:hover {
    background: #eee;
}

.sidebar-search-results .search-modal-loading {
    padding: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .shop-toolbar {
        display: none !important;
    }
}