/**
 * =====================================================
 * SIFENCY ADDONS - PRODUCT META + ADD TO CART WIDGETS
 * =====================================================
 *
 * Organized modern CSS for WooCommerce Elementor widgets.
 * Covers:
 *  1. Product Meta Widget
 *  2. Add to Cart Widget
 */

/* =====================================================
   1. PRODUCT META WIDGET
   ===================================================== */

/* --- Base Styles --- */
.sifency-product-meta-wrapper .product_meta {
    line-height: 1.6;
    font-size: 15px;
    color: #5f6773;
}

/* Remove WooCommerce default commas */
.sifency-product-meta-wrapper .product_meta .posted_in::after,
.sifency-product-meta-wrapper .product_meta .tagged_as::after {
    content: "";
}

/* --- Labels & Values --- */
.sifency-product-meta-wrapper .product_meta > span {
    font-weight: 500;
}

.sifency-product-meta-wrapper .product_meta .sku,
.sifency-product-meta-wrapper .product_meta a {
    font-weight: 400;
    color: #1e2125;
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.sifency-product-meta-wrapper .product_meta a:hover {
    color: #005de8;
}

/* --- Tag Pills --- */
.sifency-product-meta-wrapper .tagged_as a {
    display: inline-block;
    margin: 2px 5px 2px 0;
    padding: 3px 10px;
    font-size: 0.9em;
    line-height: 1.4;
    border: 1px solid #e1e3e6;
    border-radius: 4px;
    background-color: #f8f9fa;
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
}

.sifency-product-meta-wrapper .tagged_as a:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #1e2125;
}

/* --- Layout: Stacked --- */
.sifency-product-meta-view-stacked .product_meta > span {
    display: block;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f1f2;
}

.sifency-product-meta-view-stacked .product_meta > span:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Separator Toggle */
.sifency-stacked-sep-yes.sifency-product-meta-view-stacked .product_meta > span:not(:last-child) {
    border-bottom: 1px solid #f0f1f2;
}

.sifency-stacked-sep-no.sifency-product-meta-view-stacked .product_meta > span:not(:last-child) {
    border-bottom: none !important;
}

/* --- Layout: Inline --- */
.sifency-product-meta-view-inline .product_meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 0;
}

.sifency-product-meta-view-inline .product_meta > span {
    display: inline-flex;
    align-items: center;
}

/* Inline Separator (controlled by widget) */
.sifency-inline-sep-show-yes.sifency-product-meta-view-inline .product_meta > span:not(:last-child)::after {
    content: '·';
    font-weight: bold;
    color: #d0d2d5;
    margin-left: calc(var(--sifency-space-between, 15px) / 2);
    margin-right: calc(var(--sifency-space-between, 15px) / 2);
}

.sifency-inline-sep-show-no.sifency-product-meta-view-inline .product_meta > span:not(:last-child)::after {
    content: none !important;
    margin: 0 !important;
}

.sifency-inline-sep-show-no.sifency-product-meta-view-inline .product_meta > span:not(:last-child) {
    margin-right: var(--sifency-space-between, 10px);
}

/* =====================================================
   2. ADD TO CART WIDGET
   ===================================================== */

/* --- Wrapper --- */
.sifency-add-to-cart-wrapper .cart {
    margin-bottom: 0;
}

/* --- Layouts --- */
.sifency-add-to-cart-layout-inline .cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.sifency-add-to-cart-layout-stacked .cart {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

/* --- Alignment --- */
.sifency-add-to-cart-align-left .cart {
    justify-content: flex-start;
}
.sifency-add-to-cart-layout-stacked.sifency-add-to-cart-align-left .cart {
    align-items: flex-start;
}

.sifency-add-to-cart-align-center .cart {
    justify-content: center;
}
.sifency-add-to-cart-layout-stacked.sifency-add-to-cart-align-center .cart {
    align-items: center;
}

.sifency-add-to-cart-align-right .cart {
    justify-content: flex-end;
}
.sifency-add-to-cart-layout-stacked.sifency-add-to-cart-align-right .cart {
    align-items: flex-end;
}

/* --- Button Width --- */
.sifency-button-width-full .single_add_to_cart_button {
    width: 100%;
    justify-content: center;
}
.sifency-button-width-full.sifency-add-to-cart-layout-inline .cart {
    flex-grow: 1;
}

/* --- Quantity Stepper --- */
.sifency-add-to-cart-wrapper .quantity {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 42px;
}

.sifency-add-to-cart-wrapper .quantity .plus,
.sifency-add-to-cart-wrapper .quantity .minus {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    border: none;
    cursor: pointer;
    padding: 0 12px;
    font-size: 16px;
    line-height: 1;
    color: #555;
    transition: background-color 0.2s ease, color 0.2s ease;
    appearance: none;
}

.sifency-add-to-cart-wrapper .quantity .plus:hover,
.sifency-add-to-cart-wrapper .quantity .minus:hover {
    background-color: #eee;
    color: #000;
}

.sifency-add-to-cart-wrapper .quantity .qty {
    width: 45px;
    height: 100%;
    padding: 0 5px;
    text-align: center;
    background-color: #fff;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    color: #333;
    font-size: 1em;
    -moz-appearance: textfield;
}

.sifency-add-to-cart-wrapper .quantity .qty:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(50, 100, 255, 0.3);
}

/* Hide number spinners (Webkit) */
.sifency-add-to-cart-wrapper .quantity .qty::-webkit-outer-spin-button,
.sifency-add-to-cart-wrapper .quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- Add to Cart Button --- */
.sifency-add-to-cart-wrapper .single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    padding: 10px 20px;
    line-height: 1.2;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Button States */
.sifency-add-to-cart-wrapper .single_add_to_cart_button.loading {
    opacity: 0.7;
    cursor: wait;
}

.sifency-add-to-cart-wrapper .single_add_to_cart_button.added::after {
    font-family: 'WooCommerce';
    content: '\e017';
    margin-left: 0.5em;
}

/* --- Helpers --- */
.sifency-quantity-hidden .quantity {
    display: none !important;
}

.sifency-add-to-cart-wrapper .woocommerce-variation-add-to-cart {
    display: contents;
}
