/* Shop Header */
.ts-filter-section {
max-width: 1300px !important;
}
.ts-product-grid {
max-width: 1300px;
}

.ts-shop-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 16px;
}

.ts-shop-title {
    font-size: 42px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.ts-shop-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

/* Filter Section Container */
.ts-filter-section {
    max-width: 1100px;
    margin: 0 auto 32px auto;
    width: 100%;
    position: relative;
    padding-top: 60px;
    font-family: 'Arial';
}


/* Filter Bar */
.ts-filter-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    gap: 16px !important;
}

.ts-filter-bar p,
.ts-filter-bar br,
.ts-categories p,
.ts-categories br {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Categories Options */
.ts-categories {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    flex-grow: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    list-style: none !important;
}

.ts-categories a.ts-cat-btn,
.ts-cat-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: white !important;
    color: black;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border: none !important;
    line-height: normal !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.ts-categories a.ts-cat-btn:hover,
.ts-cat-btn:hover {
    background-color: #e5e5e5 !important;
    transform: scale(1.05) !important;
}

.ts-categories a.ts-cat-btn.active,
.ts-cat-btn.active {
    background-color: #705046 !important;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(196, 90, 51, 0.3) !important;
}

/* Sorting Option */
.ts-sorting {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.ts-sort-select {
    padding: 10px 36px 10px 16px !important;
    font-size: 15px !important;
    color: #4b5563 !important;
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    appearance: none !important;
    /* remove default arrow */
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%234b5563%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") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px top 50% !important;
    background-size: 10px auto !important;
    cursor: pointer !important;
    min-width: 180px !important;
    outline: none !important;
    margin: 0 !important;
    line-height: normal !important;
}

.ts-sort-select:hover,
.ts-sort-select:focus {
    border-color: #d1d5db;
}

/* Card Styling */
.ts-card {
    background-color: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

/* Image Container */
.ts-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #f5f5f5;
    height: auto;
    /* Fallback color agar image load na ho */
}

.ts-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Change Image Overlay Button */
.ts-change-image-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ts-card:hover .ts-change-image-overlay {
    opacity: 1;
}

.ts-change-img-btn {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

/* Card Content */
.ts-card-content {
    padding-bottom: 0px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.ts-product-title {
    font-size: 24px;
    color: #705046;
    font-weight: 500;
    margin-bottom: 8px;
    margin-top: 0;
    font-family: 'Playfair Display';
}

.ts-product-desc {
    font-size: 18px;
    color: #6b7280;
    margin-top: 9px;
    margin-bottom: 9px;
}

.ts-card-content>p {
    display: none;
}

.ts-card>p {
    display: none;
}

.ts-product-desc p {
    margin: 0;
    /* Override default WP paragraph margins */
}

/* Card Footer (Price & Button) */


.ts-product-price {
    font-size: 20px;
    font-weight: 700;
    color: #1B1B1B;

}

/* WooCommerce specific price styling for Sales */
.ts-product-price del {
    color: #9ba3af;
    font-size: 16px;
    font-weight: 500;
}

.ts-product-price ins {
    text-decoration: none;
}

/* Button */
.ts-view-btn {
    background-color: #705046;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.ts-pagination {
    background: #F4F1F0;
    margin: 0px !important;
    padding-bottom: 80px;
}

.ts-view-btn:hover {
    opacity:.9;
}

/* Grid Layout */
.ts-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 0 auto;
    font-family: 'Arial';
}

/* --- Media Queries for Responsiveness --- */
@media (max-width: 992px) {
    .ts-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Adjust filter bar layout for mobile */
    .ts-filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }

    /* Make sort select take full width on mobile */
    .ts-sorting {
        width: 100% !important;
    }

    .ts-sort-select {
        width: 100% !important;
        max-width: none !important;
    }
}

@media (max-width: 600px) {
    .ts-product-grid {
        grid-template-columns: 1fr;
    }

    .ts-image-container {
        height: 260px;
    }
}

/* Pagination Styling */
.ts-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 90px;
}

.ts-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none !important;
    color: #9ca3af;
    border: none !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    padding: 0;
    transition: all 0.2s ease;
    font-family: 'Arial';
}

.ts-pagination .page-numbers:hover {
    color: #111827;
}

.ts-pagination .page-numbers.current {
    color: #4b5563;
    font-weight: 800;
}

.ts-pagination .prev,
.ts-pagination .next {
    font-size: 18px;
    font-weight: 500;
    color: #9ca3af;
}

.ts-relative-product-heading {
    font-size: 54px;
    font-weight: 500;
    color: black;
    padding: 50px 0px 30px 0px;
    text-align: center;
    font-family: 'Playfair Display';
}

/* --- Cart Products Shortcode Styling --- */
.ts-cart-product-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Arial', sans-serif;
}

.ts-cart-item-card {
    display: flex;
    background-color: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    align-items: stretch;
    transition: transform 0.2s ease;
    min-height: 160px;
    /* Changed to min-height to allow expansion and prevent clipping */
    box-sizing: border-box;
}

.ts-cart-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}

/* Cart Image */
.ts-cart-item-image {
    width: 160px;
    /* Keep it square 160x160 */
    position: relative;
    flex-shrink: 0;
    display: flex;
    overflow: hidden;
    /* Critical for img height resolution with min-height parent */
}

.ts-cart-item-image a {
    display: flex;
    width: 100%;
    height: 100%;
    text-decoration: none;
}
img.ts-product-img {
    height: 100% !important;
}

.ts-cart-item-image img {
    flex-grow: 1;
    /* Stretch to fill container height */
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ts-cart-item-image .ts-change-image-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    pointer-events: none;
    white-space: nowrap;
}

.ts-cart-item-card:hover .ts-change-image-overlay {
    opacity: 1;
}

/* Forcibly hide any <p> tags generated by wpautop inside the card */
.ts-cart-item-card p,
.ts-cart-item-card p:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

/* Cart Content Area */
.ts-cart-item-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    flex-grow: 1;
    box-sizing: border-box;
    width: calc(100% - 160px);
    /* Strict boundary */
    border: 1px solid #00000029;
}

/* Top Section: Title & Price */
.ts-cart-item-content-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Gap between title and price */
    height: max-content;
}

.ts-cart-product-title {
    font-size: 20px;
    color: #705046;
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    line-height: 1.2;
}

.ts-cart-product-title a {
    color: inherit;
    text-decoration: none;
}

.ts-cart-product-price,
.ts-cart-product-price * {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2;
    display: inline-block;
}

/* Bottom Section: QTY & Subtotal */
.ts-cart-item-content-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Align bottom of pill with bottom of subtotal */
}

/* Quantity Pill */
.ts-qty-pill {
    display: inline-flex;
    display: inline-flex;
    align-items: center;
    border: 2px solid #F4F1F0;
    border-radius: 8px;
    padding: 6px 16px !important;
    background-color: #ffffff;
    gap: 16px;
    margin: 0 !important;
    height: max-content;
}

.ts-qty-btn {
    font-size: 16px;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
    padding: 0;
    font-weight: 500;
}

.ts-qty-btn:hover {
    color: #111827;
}

.ts-qty-value {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    min-width: 20px;
    text-align: center;
    margin: 0 !important;
}

/* Subtotal Group */
.ts-subtotal-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px !important;
    /* Force tight gap */
    margin: 0 !important;
    height: max-content;
    justify-content: flex-end;
}

.ts-subtotal-label {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1;
}

.ts-subtotal-amount,
.ts-subtotal-amount * {
    /* Target inner elements like .amount to kill rogue WooCommerce padding */
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2;
    display: inline-block;
}

/* --- Cart Page Wrapper (Two Columns) --- */
.ts-cart-page-wrapper {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
    margin-top: 100px;
}

.ts-cart-items-column {
    flex-grow: 1;
}

.ts-cart-product-list {
    max-width: 100%;
    /* Reset max width as it's handled by wrapper now */
}

/* --- Order Summary Column --- */
.ts-cart-summary-column {
    width: 380px;
    flex-shrink: 0;
}

.ts-order-summary-box {
    background: #FAFAF9;
    border: 2px solid #00000029;
    border-radius: 12px;
    padding: 30px;
}

.ts-order-summary-box .ts-summary-title {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 20px 0;
}

.ts-order-summary-box .ts-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
    color: #4b5563;
    font-weight: 400;
    font-family: 'Arial';
    gap: 15px;
}

.ts-order-summary-box .ts-summary-row .ts-row-value {
    font-weight: 600;
    color: #111827;
    text-align: right;
    word-break: break-word;
}

.ts-order-summary-box .ts-summary-total {
    margin-top: 15px;
    margin-bottom: 0;
    border-top: 2px solid #00000029;
    padding-top: 20px;
}

.ts-order-summary-box .ts-summary-total .ts-row-label {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    font-family: 'Arial';
}

.ts-order-summary-box .ts-summary-total .ts-row-value {
    margin-bottom: 0;
}

/* Promo Code Section */
.ts-order-summary-box .ts-promo-code-section {
    margin-bottom: 24px;
}

.ts-order-summary-box .ts-promo-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.ts-order-summary-box .ts-promo-input-group {
    display: flex;
    gap: 8px;
}

.ts-order-summary-box .ts-promo-input {
    flex-grow: 1;
    padding: 10px 14px;
    border: 1px solid #00000029;
    border-radius: 8px;
    background: #F3F3F5;
    font-size: 14px;
    outline: none;
}

.ts-order-summary-box .ts-promo-input:focus {
    border-color: #d1d5db;
}

.ts-order-summary-box .ts-apply-btn {
    background-color: #7050463D;
    color: #7050463D;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ts-order-summary-box .ts-apply-btn:hover {
    background-color: #d1d5db;
}

/* Checkout Button */
.ts-order-summary-box .ts-checkout-btn {
    display: block;
    width: 100%;
    background-color: #705046;
    color: #ffffff;
    text-align: center;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid #705046;
    box-sizing: border-box;
}

.ts-order-summary-box .ts-checkout-btn:hover {
    background-color: #ffffff;
    color: #705046;
}

/* Secure Checkout */
.ts-order-summary-box .ts-secure-checkout-msg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    text-align: center;
}

.ts-order-summary-box .ts-lock-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.ts-order-summary-box .ts-secure-text {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}

/* Responsive Cart */
@media (max-width: 900px) {
    .ts-cart-page-wrapper {
        flex-direction: column;
    }

    .ts-cart-items-column {
        width: 100%;
    }

    .ts-cart-summary-column {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .ts-cart-item-card {
        border-left: none !important;
    }
}

@media (max-width: 640px) {
    .ts-cart-item-card {
        flex-direction: column;
        height: auto;
        /* Reset fixed height for stacking */
    }
    .ts-order-summary-box{
        padding: 15px;
    }

    .ts-cart-item-image {
        width: 100%;
        height: 200px;
    }

    .ts-cart-item-content {
        padding: 20px;
        gap: 20px;
        /* Space between top and bottom sections when stacked */
        width: 100%;
    }

    .ts-cart-item-content-bottom {
        /*flex-direction: column;*/
        align-items: flex-start;
        gap: 16px;
    }

    .ts-subtotal-group {
        align-items: flex-start;
    }
}
@media (max-width: 768px) {
    .ts-cart-page-wrapper {
    margin-top: 10px;
}
.ts-cart-summary-column {
    margin-top: -100px;
}

}