/* ===== Shop Products Widget ===== */
.shop-products { width: 100%; }

.shop-products__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.shop-products__result-count {
    margin: 0;
    font-size: 14px;
    color: #555;
}

.shop-products__result-count strong {
    color: #222;
}

.shop-products__sort-form { margin: 0; }

.shop-products__orderby {
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23555' d='M5 6L0 0h10z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.shop-products__orderby:focus { outline: none; border-color: #999; }

/* Grid */
.shop-products__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.shop-products__card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 30px;
    background: #fff;
    border: 1px solid #e3a8a8;
    border-radius: 8px;
    height: 100%;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* Force grid items to stretch to equal heights */
.shop-products__grid { align-items: stretch; }
.shop-products__grid > .shop-products__card { align-self: stretch; }

.shop-products__card:hover {
    box-shadow: 0 6px 20px rgba(178, 59, 59, 0.08);
}

.shop-products__image {
    display: block;
    width: 100%;
    height: 220px;
    overflow: hidden;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.shop-products__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.shop-products__card:hover .shop-products__image img {
    transform: scale(1.04);
}

/* Title clamped to 2 lines so all cards align horizontally */
.shop-products__title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.35em * 2);
}

/* Price sticks just below title; button pushed to card bottom for alignment */
.shop-products__price {
    margin-top: auto;
}

/* Defaults for button slot; Elementor controls override these */
.shop-products__card > .shop-products__cart {
    align-self: center;
    margin-top: 14px;
}

.shop-products__title a {
    color: #b23b3b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.shop-products__title a:hover {
    color: #d96a2e;
}

.shop-products__price {
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.shop-products__price del {
    color: #999;
    margin-right: 6px;
    font-weight: 400;
}

.shop-products__price ins {
    text-decoration: none;
    color: #b23b3b;
}

/* Add to cart button — low specificity so Elementor controls override cleanly */
.shop-products__cart,
.shop-products__cart:link,
.shop-products__cart:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background-color: #f07a1e;
    background-image: none;
    border: none;
    border-radius: 30px;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.shop-products__cart:hover,
.shop-products__cart:focus {
    color: #fff;
    background-color: #d86410;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(240, 122, 30, 0.3);
}

.shop-products__cart.loading {
    opacity: 0.8;
    pointer-events: none;
}

.shop-products__cart.added::after {
    content: " ✓";
    margin-left: 4px;
}

/* Hide WooCommerce "View cart" link that appears after ajax add */
.shop-products__card a.added_to_cart {
    display: none !important;
}

/* Pagination */
.shop-products__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
}

.shop-products__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    color: #333;
    background: #fff;
    border: 1px solid #e3a8a8;
    border-radius: 6px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.shop-products__page:hover {
    color: #fff;
    background: #f07a1e;
    border-color: #f07a1e;
    box-shadow: 0 4px 12px rgba(240, 122, 30, 0.25);
}

.shop-products__page.is-active {
    color: #fff;
    background: #b23b3b;
    border-color: #b23b3b;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(178, 59, 59, 0.25);
}

.shop-products__page--nav {
    padding: 0 18px;
    font-weight: 600;
}

.shop-products__dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 40px;
    color: #999;
    font-size: 16px;
    letter-spacing: 2px;
    user-select: none;
}

.shop-products__empty {
    padding: 40px 0;
    text-align: center;
    color: #888;
}

/* Responsive */
@media (max-width: 1024px) {
    .shop-products__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .shop-products__grid { grid-template-columns: 1fr; }
    .shop-products__toolbar { flex-direction: column; align-items: flex-start; }
    .shop-products__card { padding: 20px; }
    .shop-products__image { height: 200px; }
}

/* ===== Side Cart Drawer ===== */
.sp-drawer {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    visibility: hidden;
}
.sp-drawer.is-open { pointer-events: auto; visibility: visible; }

.sp-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sp-drawer.is-open .sp-drawer__overlay { opacity: 1; }

.sp-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 92vw;
    height: 100%;
    background: #fff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.sp-drawer.is-open .sp-drawer__panel { transform: translateX(0); }

/* Header */
.sp-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.sp-drawer__title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.sp-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 26px;
    line-height: 1;
    color: #555;
    background: transparent;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease, transform 0.2s ease;
}
.sp-drawer__close:hover { color: #b23b3b; transform: scale(1.1); background: transparent; }

/* Content (items + footer) */
.sp-drawer__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Body (scrollable items) */
.sp-drawer__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 24px;
    min-height: 0;
}
.sp-drawer__body--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}
.sp-drawer__empty {
    margin: 0;
    padding: 40px 0;
    color: #888;
    font-size: 15px;
    text-align: center;
}

/* Cart items */
.sp-cart-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sp-cart-item {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: opacity 0.25s ease;
}
.sp-cart-item.is-removing { opacity: 0.4; }

.sp-cart-item__thumb {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    display: block;
    border-radius: 6px;
    overflow: hidden;
    background: #f7f7f7;
}
.sp-cart-item__thumb img,
.sp-cart-item__img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    border-radius: 6px;
}

.sp-cart-item__info {
    flex: 1;
    min-width: 0;
    padding-right: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sp-cart-item__title {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sp-cart-item__title:hover { color: #b23b3b; }

.sp-cart-item__price {
    font-size: 14px;
    color: #b23b3b;
    font-weight: 600;
}
.sp-cart-item__price .woocommerce-Price-amount { color: inherit; }

/* Qty controls */
.sp-cart-item__qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    width: fit-content;
    background: #fff;
}
.sp-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 16px;
    color: #555;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.sp-qty-btn:hover { background: #f07a1e; color: #fff; }
input.sp-qty-num,
input[type="number"].sp-qty-num {
    width: 32px !important;
    min-width: 0 !important;
    max-width: 32px !important;
    height: 24px !important;
    min-height: 0 !important;
    line-height: 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #222 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    text-align: center !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
    vertical-align: middle;
}
input.sp-qty-num:focus,
input.sp-qty-num:focus-visible,
input[type="number"].sp-qty-num:focus {
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}
input.sp-qty-num::-webkit-outer-spin-button,
input.sp-qty-num::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none;
}

/* Remove */
.sp-cart-item__remove {
    position: absolute;
    right: 0;
    top: 16px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: #bbb;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease, transform 0.2s ease;
}
.sp-cart-item__remove:hover { color: #b23b3b; transform: scale(1.15); }

/* Sticky footer */
.sp-drawer__footer {
    flex-shrink: 0;
    padding: 18px 24px 22px;
    border-top: 1px solid #eee;
    background: #fff;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.03);
}
.sp-drawer__subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #eee;
}
.sp-drawer__subtotal-label {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}
.sp-drawer__subtotal-amount {
    font-size: 18px;
    font-weight: 700;
    color: #b23b3b;
}
.sp-drawer__subtotal-amount .woocommerce-Price-amount { color: inherit; }

.sp-drawer__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sp-drawer__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 30px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.sp-drawer__btn--view {
    color: #333;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
}
.sp-drawer__btn--view:hover { background: #ececec; color: #222; }
.sp-drawer__btn--checkout {
    color: #fff;
    background: #f07a1e;
    border: 1px solid #f07a1e;
}
.sp-drawer__btn--checkout:hover {
    color: #fff;
    background: #d86410;
    border-color: #d86410;
    box-shadow: 0 4px 14px rgba(240, 122, 30, 0.3);
}

/* Loading state */
.sp-drawer.is-loading .sp-drawer__content { opacity: 0.6; pointer-events: none; }

/* Body scroll lock */
body.sp-drawer-open { overflow: hidden; }
