/* Layout General */
.shop-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 6rem;
}

/* Sidebar Styles */
.shop-sidebar {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.shop-sidebar h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Override Astra ol,ul margin */
.shop-sidebar ol,
.shop-sidebar ul {
    margin: 0 !important;
}

.category-list {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}

.category-list li {
    margin: 0 0 0.8rem 0;
    padding: 0;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.8rem 0.5rem 0.8rem 0;
    margin: 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    cursor: pointer;
}

.category-list a:hover,
.category-list a.active {
    background: rgba(255, 107, 0, 0.1);
    color: var(--accent-gold);
    padding-left: 0.5rem;
}

.count {
    font-size: 0.8rem;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Product Card */
.product-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 1;
    transform: scale(1);
}

.product-card.fade-in {
    animation: fadeInProduct 0.5s ease forwards;
}

@keyframes fadeInProduct {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.product-header {
    padding: 2rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.product-icon {
    color: var(--accent-gold);
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    transition: transform 0.4s;
}

.product-card:hover .product-icon {
    transform: scale(1.2) rotate(10deg);
}

.category-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.product-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-family: var(--font-display);
    line-height: 1.3;
}

.product-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.price-wrapper {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    color: var(--accent-gold);
    font-size: 1.4rem;
    font-weight: 700;
}

.price del {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-right: 5px;
    text-decoration: line-through;
}

.price ins {
    text-decoration: none;
}

.price span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.add-to-cart-btn {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
}

.add-to-cart-btn:hover {
    background: var(--accent-gold);
    color: var(--bg-dark);
    transform: scale(1.1);
}

.add-to-cart-btn.btn-calc-price,
.add-to-cart-btn.btn-request-offer {
    width: auto !important;
    padding: 0 15px !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    font-weight: 600;
    white-space: nowrap;
}

.product-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
}

.product-title a:hover {
    color: var(--accent-gold);
}

.product-header {
    cursor: pointer;
}

/* --- WooCommerce Notices --- */
.woocommerce-notices-wrapper {
    width: 100%;
    margin-bottom: 2rem;
}

/* --- TOOLBAR (Sort + Search + View) --- */
.shop-toolbar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    padding: 1.2rem 1.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 0.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.shop-toolbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    opacity: 0.5;
}

/* Search */
.toolbar-search {
    flex: 1;
    min-width: 180px;
    position: relative;
}

.toolbar-search-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 107, 0, 0.1);
    border-radius: 8px;
    color: var(--accent-gold);
    pointer-events: none;
    z-index: 1;
}

.toolbar-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.7rem 1rem 0.7rem 2.8rem;
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.toolbar-search input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
    background: rgba(255, 107, 0, 0.04);
}

.toolbar-search input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Sort */
.toolbar-sort {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.toolbar-sort label {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 107, 0, 0.1);
    border-radius: 8px;
    color: var(--accent-gold);
    flex-shrink: 0;
}

.toolbar-sort select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.7rem 2.5rem 0.7rem 1rem;
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FF6B00' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.toolbar-sort select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
    background: rgba(255, 107, 0, 0.04);
}

.toolbar-sort select option {
    background: var(--bg-card);
    color: #fff;
}

/* View Toggle */
.toolbar-view {
    display: flex;
    gap: 0.4rem;
}

.view-btn {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn svg {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px;
    min-height: 24px;
    flex-shrink: 0;
}

.view-btn:hover {
    border-color: rgba(255, 107, 0, 0.4);
    color: var(--accent-gold);
    background: rgba(255, 107, 0, 0.06);
    transform: scale(1.05);
}

.view-btn.active {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(255, 107, 0, 0.1);
    box-shadow: 0 0 12px rgba(255, 107, 0, 0.2);
}

/* Counter Pill */
.toolbar-count {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-left: auto;
    white-space: nowrap;
    background: rgba(255, 107, 0, 0.08);
    border: 1px solid rgba(255, 107, 0, 0.2);
    border-radius: 20px;
    padding: 0.4rem 1rem;
}

.toolbar-count strong {
    color: var(--accent-gold);
}

/* List view toggle */
.products-grid.list-view {
    grid-template-columns: 1fr !important;
}

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

.products-grid.list-view .product-header {
    width: 120px;
    flex-shrink: 0;
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.products-grid.list-view .product-body {
    flex: 1;
}

/* No results */
.no-search-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    display: none;
}

.no-search-results i {
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .shop-container {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }

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

    .products-grid.list-view .product-header {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

@media (max-width: 576px) {
    .shop-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.2rem;
        gap: 0.8rem;
    }

    .toolbar-sort {
        width: 100%;
    }

    .toolbar-sort select {
        flex: 1;
    }

    .toolbar-count {
        margin-left: 0;
        text-align: center;
        align-self: center;
    }

    .toolbar-view {
        justify-content: center;
    }
}
