
/* --- Product Page Customizations --- */

/* Hide "Clear" button for variations */
.reset_variations {
    display: none !important;
}

/* Hide duplicate variation price */
.woocommerce-variation-price {
    display: none !important;
}

/* Quantity Buttons */
.quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.quantity input[type="number"] {
    text-align: center;
    border: none;
    width: 50px;
    -moz-appearance: textfield;
    margin: 0;
    padding: 8px 0;
}

.quantity input[type="number"]::-webkit-outer-spin-button,
.quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity .minus {
    background: #f1f1f1;
    color: #333;
}

.quantity .plus {
    background: #28a745; /* Green */
    color: #fff;
}

.quantity .minus,
.quantity .plus {
    border: none;
    width: 30px;
    height: 100%;
    cursor: pointer;
    font-weight: bold;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Ensure quantity input is HIDDEN (replaced by custom control) */
.single-product div.product form.cart .quantity {
    display: none !important;
}

/* Style for the injected control */
.single-product .petsphere-qty-control {
    display: none; /* Hidden by default, shown via JS */
    align-items: center;
    margin-right: 10px;
    margin-bottom: 10px; /* Spacing */
}

.single-product .petsphere-qty-control .qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.single-product .petsphere-qty-control .qty-btn.minus {
    background: #f1f1f1;
    color: #333;
}

.single-product .petsphere-qty-control .qty-btn.plus {
    background: #28a745;
    color: #fff;
}

.single-product .petsphere-qty-control .qty-val {
    width: 40px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

/* Ensure the Add to Cart button is hidden when control is active */
.single_add_to_cart_button.hidden {
    display: none !important;
}

/* --- Price Display Customization (Global) --- */
/* Applies to Single Product, Shop Loop, and Widgets */

.woocommerce div.product p.price,
.woocommerce div.product span.price,
.woocommerce ul.products li.product .price,
.widget .product_list_widget li .amount {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
    color: var(--secondary-color); /* Base color for normal prices */
}

/* Single Product Page - Left Align */
.woocommerce div.product p.price,
.woocommerce div.product span.price {
    align-items: flex-start !important;
}

/* Shop Loop & Widgets - Center Align */
.woocommerce ul.products li.product .price,
.widget .product_list_widget li .amount {
    align-items: center !important;
}

/* Regular Price (Old) - Global */
.woocommerce div.product p.price del,
.woocommerce div.product span.price del,
.woocommerce ul.products li.product .price del,
.widget .product_list_widget li del {
    font-size: 0.8em !important; /* Relative smaller size */
    opacity: 0.7;
    order: 1; /* Ensure it's first */
    display: block;
    text-decoration: line-through;
    color: #777; /* Keep old price grey */
}

/* Sale Price (Current) - Single Product & Widgets */
.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins,
.widget .product_list_widget li ins {
    text-decoration: none;
    color: #28a745 !important; /* Green */
    font-weight: bold;
    order: 2; /* Ensure it's second */
    display: block;
    margin-top: 2px;
}

/* Shop Loop Price - Force Secondary Color */
.woocommerce ul.products li.product .price {
    color: var(--secondary-color, #ffb900) !important;
}

/* Sale Price (Green) */
.woocommerce ul.products li.product .price ins {
    text-decoration: none;
    color: #28a745 !important; /* Green */
    font-weight: bold;
    order: 2;
    display: block;
    margin-top: 2px;
}

/* Ensure amount inside ins is green */
.woocommerce ul.products li.product .price ins .amount {
    color: #28a745 !important;
}

/* Standard amount (Secondary Color) */
.woocommerce ul.products li.product .price .amount {
    color: var(--secondary-color, #ffb900);
}

.woocommerce ul.products li.product .price del,
.woocommerce ul.products li.product .price del .amount {
    color: #777 !important; /* Keep old price grey */
}

/* Specific Font Sizes */
.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins {
    font-size: 24px; /* Larger on single product */
}

.woocommerce ul.products li.product .price ins {
    font-size: 1.3rem; /* Match loop size */
}

/* --- Quantity Control Alignment --- */
/* Force left alignment for the cart form and our custom control */
.woocommerce div.product form.cart,
.woocommerce div.product p.cart {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start !important; /* Force Left Align */
    align-items: center;
}

.single-product .petsphere-qty-control {
    margin-right: 15px; /* Space between control and other elements if any */
    margin-left: 0 !important; /* Ensure no left margin pushes it */
}

/* Ensure variations form aligns correctly */
.woocommerce div.product form.cart .variations {
    width: 100%;
    margin-bottom: 20px;
}

.woocommerce div.product form.cart .woocommerce-variation-add-to-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start !important; /* Force Left Align */
    width: 100%;
}

/* --- Review Form Styling --- */
#review_form_wrapper {
    background: #fff;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

#review_form_wrapper #reply-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
    display: block;
}

.woocommerce #reviews #comments ol.commentlist li .comment-text {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Stars - Selection Form */
.woocommerce p.stars a {
    color: #ccc !important; /* Default grey */
    transition: color 0.2s;
}

/* Hover state: Color all, then grey out subsequent ones */
.woocommerce p.stars:hover a {
    color: var(--secondary-color, #ffb900) !important;
}

.woocommerce p.stars a:hover ~ a {
    color: #ccc !important;
}

/* Selected state: Color all, then grey out subsequent ones */
.woocommerce p.stars.selected a {
    color: var(--secondary-color, #ffb900) !important;
}

.woocommerce p.stars.selected a.active ~ a {
    color: #ccc !important;
}

/* Stars - Display in Reviews/Comments */
.woocommerce .star-rating {
    color: var(--secondary-color, #ffb900) !important;
}

.woocommerce .star-rating span:before {
    color: var(--secondary-color, #ffb900) !important;
}

/* Inputs */
#review_form input[type="text"],
#review_form input[type="email"],
#review_form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

#review_form input[type="text"]:focus,
#review_form input[type="email"]:focus,
#review_form textarea:focus {
    border-color: var(--primary-color, #0078d4);
    outline: none;
}

/* Labels */
#review_form label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
    color: #555;
}

/* Submit Button */
#review_form #submit {
    background-color: var(--primary-color, #28a745); /* Use primary or green */
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#review_form #submit:hover {
    background-color: #218838; /* Darker green */
    opacity: 0.9;
}

/* Shop Loop Rating Alignment */
.woocommerce ul.products li.product .woocommerce-product-rating {
    justify-content: center !important;
    display: flex !important;
    margin-bottom: 5px;
}

