/* Product Card */
.product-card {
    position: relative;
    width: 100%;
    background: var(--color-white);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: row;
    gap: 20px;
    transition: box-shadow 0.2s ease;
    box-sizing: border-box;
}

.product-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Container style remains the same */
.product-card__image {
    flex: 0 0 100px;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-white);
    overflow: hidden;
    position: relative;
}

/* ADD THIS NEW RULE for the link */
.product-card__image a {
    display: block; /* Make the link behave like a block */
    width: 100%;    /* Make it fill the container width */
    height: 100%;   /* Make it fill the container height */
    /* Optional: Add flex if you need to align img within <a>, but usually not needed here */
    /* display: flex; */
    /* align-items: center; */
    /* justify-content: center; */
}

/* Image style remains the same */
.product-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
}

/* Content */
.product-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent content from overflowing */
}

/* SKU */
.product-card__sku {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

/* Title */
.product-card__title {
    font-size: 16px;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.product-card__title a {
    color: var(--color-heading);
    text-decoration: none;
}

.product-card__title a:hover {
    color: var(--color-light-blue);
}

/* Stock Status */
.product-card__stock-status {
    margin-bottom: 15px;
}

.product-card__stock-status .in-stock {
    color: #2c882f;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.product-card__stock-status .out-of-stock {
    color: #e74c3c;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.product-card__stock-status .in-stock::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
}

/* Price and Actions Row */
.product-card__price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.price-amount {
    font-size: 18px;
    font-weight: 600;
}

/* Actions */
.product-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Quantity Control Component */
.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 50px;
    overflow: hidden;
    background: var(--color-white, #fff);
    width: 120px;
    height: 42px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quantity-control .quantity-btn {
    width: 34px;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    color: #333;
}

.quantity-control .quantity-btn:hover {
    background: var(--color-hover, #f5f5f5);
    color: #333;
}

.quantity-control .quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #333;
}

.quantity-control .qty {
    width: 52px;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 16px;
    padding: 0;
    margin: 0;
    -moz-appearance: textfield; /* Remove default number input arrows */
    transition: border 0.2s ease; /* Smooth transition for focus state */
}

.quantity-control .qty::-webkit-outer-spin-button,
.quantity-control .qty::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Remove default number input arrows */
    margin: 0;
}

.quantity-control .qty:focus {
    outline: none; /* Remove default outline */
    border: 1px solid #333; /* Add a subtle #333 border instead of blue box-shadow */
    border-left: none; /* Avoid double borders with buttons */
    border-right: none; /* Avoid double borders with buttons */
    border-radius: 0; /* Ensure it fits within the rounded container */
}

/* Remove legacy quantity styles that might conflict */
.product-card__actions .quantity {
    width: auto; /* Override previous fixed width */
}

/* Add to Cart Button */
.product-card__actions .add_to_cart_button {
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: 50px;
    background: var(--color-medium-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.product-card__actions .add_to_cart_button:hover {
    background: var(--color-dark-blue);
}

.product-card__actions .cart-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    user-select: none;
}

/* Loading state for add to cart button */
.add_to_cart_button.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.add_to_cart_button.loading .cart-icon {
    opacity: 0;
}

.add_to_cart_button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -12px 0 0 -12px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-spin 1s linear infinite;
}

@keyframes button-spin {
    to { transform: rotate(360deg); }
}

/* Success Message */
.woocommerce-success {
    background-color: #f0fff4;
    border-left: 4px solid #2c882f;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #1b7a43;
}

/* Error Message */
.woocommerce-error {
    background-color: #fff5f5;
    border-left: 4px solid #e74c3c;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #c0392b;
}

/* Login to See Price Message */
.login-to-see-price {
    margin: 0;
    font-size: 16px;
    color: #666;
    font-style: normal;
}

.login-to-see-price a {
    color: var(--color-dark-blue);
    text-decoration: none;
}

.login-to-see-price a:hover {
    text-decoration: underline;
}

/* Remove any margin/width that might be causing horizontal scroll */
.product-card,
.product-card__content,
.product-card__image {
    max-width: 100%;
    margin: 0;
}

/* Responsive Styles */
@media (max-width: 576px) {
    .product-card {
        padding: 15px;
        gap: 15px;
    }

    .product-card__image {
        flex: 0 0 80px;
    }

    .product-card__image img {
        height: 80px;
    }

    .product-card__title {
        font-size: 14px;
    }

    .product-card__price {
        flex-direction: row;
        gap: 15px;
        align-items: center;
        flex-wrap: wrap;
    }

    .price-amount {
        font-size: 16px;
    }

    .product-card__actions {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .quantity-control {
        width: 100px;
        height: 36px;
    }

    .quantity-control .quantity-btn {
        width: 28px;
        color: #333;
    }

    .quantity-control .qty {
        width: 44px;
        font-size: 14px;
    }

    .product-card__actions .add_to_cart_button {
        width: 36px;
        height: 36px;
        min-height: 36px;
        flex-shrink: 0;
    }
}