/* ==========================================
   CUSTOM SHOP PAGE STYLES
   ========================================== */

/* Layout Container with Screen Margins */
.custom-shop-container {
    max-width: 1320px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* Sidebar Styles */
.shop-sidebar {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #eee;
    height: fit-content;
}

.filter-widget {
    margin-bottom: 30px;
}

.filter-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    border-bottom: 2px solid #8c3f23;
    padding-bottom: 8px;
    color: #222;
}

.shop-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shop-filter-list li {
    margin-bottom: 10px;
}

.shop-filter-list li a {
    color: #555;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    transition: color 0.2s;
}

.shop-filter-list li a:hover {
    color: #8c3f23;
}

/* Top Bar Sorting */
.shop-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: #f9f9f9;
    padding: 12px 20px;
    border-radius: 8px;
}



/* Sorting Dropdown Wrapper */
.shop-sorting {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* WooCommerce Default Form Override */
.shop-sorting form.woocommerce-ordering {
    margin: 0;
    position: relative;
}

/* Custom Select Dropdown Styling */
.shop-sorting select.orderby {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 40px 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    cursor: pointer;
    outline: none;
    transition: all 0.25s ease-in-out;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%22%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px auto;
}

/* Dropdown Hover & Focus States */
.shop-sorting select.orderby:hover {
    background-color: #f0f0f0;
    border-color: #cccccc;
}

.shop-sorting select.orderby:focus {
    border-color: #8c3f23;
    box-shadow: 0 0 0 3px rgba(140, 63, 35, 0.15);
    background-color: #ffffff;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
	.shop-sidebar{
        display:none;
    }
    .shop-top-bar {
		display:none;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 15px;
    }

    .shop-sorting select.orderby {
        width: 100%;
    }
}

/* Product Grid Layout */
.custom-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Product Card Styling */
.custom-product-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.custom-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.card-image-wrapper {
    position: relative;
    background: #fdfdfd;
    text-align: center;
}

.card-image-wrapper img {
    width: 100%;
    height: 170px;
    object-fit: contain;
    padding: 10px;
}

.badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #8c3f23;
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Title Constraints (Max 2 Lines) */
.custom-product-card .product-title {
    font-size: 16px;
    line-height: 1.3;
    height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.custom-product-card .product-title a {
    color: #222;
    text-decoration: none;
}

.product-subtitle {
    font-size: 13px;
    color: #777;
    margin-bottom: 10px;
    height: 2.8em;
    overflow: hidden;
}

.custom-product-card .product-rating {
    color: #ffb400;
    font-size: 13px;
    margin-bottom: 10px;
}

.custom-product-card .product-price {
    font-size: 17px;
    font-weight: 700;
    color: #8c3f23;
    margin-bottom: 15px;
}

/* Action Buttons Grid */
.card-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
}

.btn-add-cart, .btn-buy-now {
    text-align: center;
    padding: 8px 5px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-add-cart {
    background: #eee;
    color: #333;
}

.btn-add-cart:hover {
    background: #ddd;
}

.btn-buy-now {
    background: #8c3f23;
    color: #fff;
}

.btn-buy-now:hover {
    background: #70311a;
}

/* Pagination */
.shop-pagination {
    margin-top: 40px;
    text-align: center;
}

.shop-pagination .page-numbers {
    display: inline-flex;
    gap: 8px;
    list-style: none;
}

.shop-pagination a, .shop-pagination span {
    padding: 8px 14px;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
}

.shop-pagination .current {
    background: #8c3f23;
    color: #fff;
    border-color: #8c3f23;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
	.shop-sidebar{
        display:none;
    }
    .custom-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
	.shop-sidebar{
        display:none;
    }
    .custom-shop-container {
        grid-template-columns: 1fr;
        margin: 20px auto;
        padding: 0 15px;
    }
    .custom-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
	.shop-sidebar{
        display:none;
    }
    .card-action-buttons {
    display: flex;
    flex-direction:column;
}
    .product-subtitle{
        display:none;
    }
	
    .card-image-wrapper img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    padding: 5px;
}
    .custom-product-grid {
      grid-template-columns: repeat(2, 1fr);
    }
    .shop-sorting {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .shop-sorting form.woocommerce-ordering {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .shop-sorting select.orderby {
        width: 100%;
        max-width: 100%;
        text-align: center;
        text-align-last: center; /* ড্রপডাউনের ভেতরের টেক্সট সেন্টারে রাখার জন্য */
    }
}