/* =====================================================
   SIM Theme - Shop styles
   Pagination, Grid/List view toggle, List view layout
   ===================================================== */

/* ---------- Pagination redesign ---------- */
.woocommerce nav.woocommerce-pagination {
    text-align: center;
    margin: 30px 0;
}
.woocommerce nav.woocommerce-pagination ul.page-numbers {
    display: inline-flex !important;
    gap: 8px;
    border: none !important;
    margin: 0;
    padding: 0;
    list-style: none;
}
.woocommerce nav.woocommerce-pagination ul li {
    border: none !important;
    background: transparent !important;
    margin: 0;
    overflow: visible;
}
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 50%;
    background: #f5f5f5 !important;
    color: #333 !important;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #e0e0e0 !important;
    transition: all 0.2s ease;
    line-height: 1;
}
.woocommerce nav.woocommerce-pagination ul li a:hover {
    background: #e8e8e8 !important;
    color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.woocommerce nav.woocommerce-pagination ul li span.current {
    background: #555 !important;
    color: #fff !important;
    border-color: #555 !important;
}

/* ---------- Shop view toggle (Grid / List) ---------- */
.shop-view-toggle {
    display: inline-flex;
    gap: 6px;
    margin-left: 12px;
    vertical-align: middle;
}
.shop-view-toggle button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease;
    padding: 0;
}
.shop-view-toggle button:hover {
    background: #e8e8e8;
    color: #000;
}
.shop-view-toggle button.is-active {
    background: #555;
    color: #fff;
    border-color: #555;
}
.shop-view-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ---------- List view layout ---------- */
ul.products.is-list-view {
    display: block !important;
}
ul.products.is-list-view li.product {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 16px 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    padding: 12px;
    gap: 16px;
}
ul.products.is-list-view li.product .product-card__image,
ul.products.is-list-view li.product a.woocommerce-LoopProduct-link img,
ul.products.is-list-view li.product img {
    width: 200px !important;
    max-width: 200px !important;
    height: auto;
    flex-shrink: 0;
}
ul.products.is-list-view li.product .product-card__content,
ul.products.is-list-view li.product .woocommerce-loop-product__title,
ul.products.is-list-view li.product .price {
    text-align: left !important;
    flex: 1;
}

/* Mobile responsive list view */
@media (max-width: 600px) {
    ul.products.is-list-view li.product {
        flex-direction: column !important;
    }
    ul.products.is-list-view li.product .product-card__image,
    ul.products.is-list-view li.product img {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ---------- Hide quick view in both views ---------- */
.product-card__quick {
    display: none !important;
}

/* ---------- Cart page: actions row (coupon + update on one line) ---------- */
/* NOTE: do NOT set display:flex on td.actions itself — it breaks colspan
   and clamps the cell to first column width. Style only the children. */
.woocommerce-cart table.cart td.actions {
    text-align: left;
    white-space: nowrap;
}
.woocommerce-cart table.cart td.actions .coupon {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 12px 0 0 !important;
    vertical-align: middle;
    white-space: nowrap;
}
.woocommerce-cart table.cart td.actions .coupon #coupon_code {
    width: 220px;
    max-width: 100%;
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
}
.woocommerce-cart table.cart td.actions .coupon #coupon_code::placeholder {
    color: #999;
}
.woocommerce-cart table.cart td.actions button[name="update_cart"] {
    vertical-align: middle;
    margin: 0;
}

/* Mobile: stack to two rows for better readability */
@media (max-width: 600px) {
    .woocommerce-cart table.cart td.actions {
        white-space: normal;
    }
    .woocommerce-cart table.cart td.actions .coupon {
        display: flex !important;
        margin-bottom: 10px !important;
    }
    .woocommerce-cart table.cart td.actions button[name="update_cart"] {
        display: block;
        width: 100%;
    }
}

/* Neutralize hover background on the whole pagination row (ul.page-numbers) - main.css applies bg to .page-numbers:hover which also matches the ul */
.woocommerce nav.woocommerce-pagination ul.page-numbers:hover,
.woocommerce-pagination ul.page-numbers:hover {
    background: transparent !important;
}
