/**
 * Plantscount Product Card Component
 * Modern design with Fraunces/DM Sans typography
 */

.pc-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #E8EDE5;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 220px;
    height: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.pc-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--pc-sage, #7a9b7a);
}

/* Inner wrapper */
.pc-product-card__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Image section */
.pc-product-card__image-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--pc-cream, #faf7f2);
}

.pc-product-card__image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pc-product-card:hover .pc-product-card__image {
    transform: scale(1.05);
}

/* Badges positioning (over image) */
.pc-product-card .pc-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

/* Recommended badge (keuzehulp) */
.pc-product-card__recommended-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(26, 58, 26, 0.9);
    color: #fff;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pc-product-card__recommended-badge svg {
    color: var(--pc-primary, #89A550);
}

/* Content section */
.pc-product-card__content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    flex: 1;
}

/* Title - Ensure sufficient contrast */
.pc-product-card__title {
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.3;
    color: #2c2c2c; /* Darker for better contrast */
}

.pc-product-card__title a {
    color: #2c2c2c; /* Darker for WCAG AA compliance */
    text-decoration: none;
    transition: color 0.2s ease;
}

.pc-product-card__title a:hover {
    color: #1a3a1a; /* Even darker on hover */
}

/* Meta info (hoogte, potmaat) - Improved contrast for accessibility */
.pc-product-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
}

.pc-product-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    /* Darker color for WCAG AA contrast (4.5:1 minimum) */
    color: #5a6b5a; /* Darker sage for better readability */
}

.pc-product-card__meta-item svg {
    flex-shrink: 0;
}

/* Excerpt (optional, used in some views) */
.pc-product-card__excerpt {
    font-size: 13px;
    line-height: 1.5;
    color: var(--pc-sage, #7a9b7a);
    margin: 0;
}

/* Price */
.pc-product-card__price {
    margin-top: auto;
    font-size: 18px;
    font-weight: 600;
    color: var(--pc-forest, #1a3a1a);
}

.pc-product-card__price del {
    color: var(--pc-sage, #7a9b7a);
    font-size: 14px;
    font-weight: 400;
    margin-right: 6px;
}

.pc-product-card__price ins {
    text-decoration: none;
    color: var(--pc-primary, #89A550);
}

/* Actions */
.pc-product-card__actions {
    margin-top: 12px;
}

.pc-product-card__button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Add to cart button - FIXED: Force white text */
.pc-product-card__button--add-to-cart,
a.pc-product-card__button--add-to-cart {
    background: #89A550;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

.pc-product-card__button--add-to-cart:hover,
a.pc-product-card__button--add-to-cart:hover {
    background: #6b8540;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 133, 64, 0.3);
}

/* View product button */
.pc-product-card__button--view {
    background: var(--pc-white, #ffffff);
    color: var(--pc-forest, #1a3a1a);
    border: 1px solid var(--pc-mist, #e8ebe8);
}

.pc-product-card__button--view:hover {
    background: var(--pc-cream, #faf7f2);
    border-color: var(--pc-sage, #7a9b7a);
}

/* Out of stock state */
.pc-product-card--out-of-stock {
    opacity: 0.6;
}

.pc-product-card__button--out-of-stock {
    background: var(--pc-mist, #e8ebe8);
    color: var(--pc-sage, #7a9b7a);
    cursor: not-allowed;
}

/* Loading state (voor AJAX add to cart) */
.pc-product-card__button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.pc-product-card__button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pc-spin 0.6s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .pc-product-card {
        min-width: 200px;
    }

    .pc-product-card__content {
        padding: 12px;
    }

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

    .pc-product-card__price {
        font-size: 16px;
    }

    .pc-product-card__button {
        padding: 10px 14px;
        font-size: 13px;
    }

    .pc-product-card .pc-badges {
        top: 8px;
        left: 8px;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .pc-product-card {
        min-width: 0;
    }

    .pc-product-card__meta {
        gap: 8px;
    }

    .pc-product-card__meta-item {
        font-size: 11px;
    }
}

/* ========================================================================
   CRITICAL: FORCE WHITE TEXT ON ALL ADD TO CART BUTTONS - GLOBAL
   ======================================================================== */

/* Ultra-specific selectors for add-to-cart buttons */
/* Note: Most !important remain due to WooCommerce inline styles */
.pc-product-card__button--add-to-cart,
.pc-product-card__button--add-to-cart:link,
.pc-product-card__button--add-to-cart:visited,
.pc-product-card__button--add-to-cart:active,
a.pc-product-card__button--add-to-cart,
a.pc-product-card__button--add-to-cart.ajax_add_to_cart,
.pc-product-card .pc-product-card__button--add-to-cart,
/* WooCommerce default buttons */
.woocommerce a.button.add_to_cart_button,
.woocommerce button.button.add_to_cart_button,
.woocommerce .product a.button,
.woocommerce ul.products li.product a.button,
.woocommerce ul.products li.product .add_to_cart_button,
a.add_to_cart_button,
button.add_to_cart_button,
.add_to_cart_button,
/* Shop page buttons */
.shop-products .product .button,
.shop-products .product a.button,
.shop-products .add_to_cart_button,
/* Single product buttons */
.single_add_to_cart_button,
button.single_add_to_cart_button,
.woocommerce button.single_add_to_cart_button {
    background-color: #2D5A3D !important; /* Needed for inline styles */
    color: #ffffff !important; /* Needed for inline styles */
    -webkit-text-fill-color: #ffffff !important; /* Webkit quirk */
    text-shadow: none;
    font-family: var(--font-family-sans, 'DM Sans', sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 14px 20px;
    border-radius: 10px;
    border: none !important; /* Needed for inline styles */
    text-decoration: none;
    letter-spacing: 0;
    text-transform: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Hover states */
.pc-product-card__button--add-to-cart:hover,
a.pc-product-card__button--add-to-cart:hover,
a.pc-product-card__button--add-to-cart.ajax_add_to_cart:hover,
.woocommerce a.button.add_to_cart_button:hover,
.woocommerce ul.products li.product a.button:hover,
.shop-products .product .button:hover,
.shop-products .add_to_cart_button:hover,
.single_add_to_cart_button:hover,
button.single_add_to_cart_button:hover,
.add_to_cart_button:hover {
    background-color: #1E3D29 !important; /* Needed for inline styles */
    color: #ffffff !important; /* Needed for inline styles */
    -webkit-text-fill-color: #ffffff !important; /* Webkit quirk */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 90, 61, 0.3);
}

/* Out of stock / disabled button */
.woocommerce a.button.add_to_cart_button[disabled],
.add_to_cart_button.disabled,
.button.disabled {
    background-color: #C5C5C5 !important; /* Needed for inline styles */
    color: #666666 !important; /* Needed for inline styles */
    -webkit-text-fill-color: #666666 !important; /* Webkit quirk */
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* View product button - modern style */
.pc-product-card__button--view,
a.pc-product-card__button--view {
    background: transparent;
    color: #2D5A3D;
    border: 2px solid #2D5A3D;
    font-family: var(--font-family-sans, 'DM Sans', sans-serif);
    font-weight: 500;
    border-radius: 10px;
}

.pc-product-card__button--view:hover,
a.pc-product-card__button--view:hover {
    background: #2D5A3D;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

/* ========================================================================
   VARIATION SELECTOR - For variable products on listing pages
   ======================================================================== */

.pc-product-card__variation-selector {
    margin: 12px 0;
}

.pc-variation-select {
    width: 100%;
    padding: 10px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--pc-forest, #1a3a1a);
    background-color: var(--pc-white, #ffffff);
    border: 1px solid var(--pc-mist, #e8ebe8);
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231a3a1a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pc-variation-select:hover {
    border-color: var(--pc-sage, #7a9b7a);
}

.pc-variation-select:focus {
    outline: none;
    border-color: var(--pc-forest, #1a3a1a);
    box-shadow: 0 0 0 3px rgba(29, 90, 61, 0.1);
}

.pc-variation-select option[disabled] {
    color: var(--pc-sage, #7a9b7a);
}

/* Variable add to cart button */
.pc-variable-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.pc-variable-add-to-cart:disabled {
    background-color: var(--pc-mist, #e8ebe8);
    color: var(--pc-sage, #7a9b7a);
    -webkit-text-fill-color: var(--pc-sage, #7a9b7a);
    cursor: not-allowed;
    opacity: 0.7;
}

.pc-variable-add-to-cart .pc-button__text,
.pc-variable-add-to-cart .pc-button__loading,
.pc-variable-add-to-cart .pc-button__success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pc-variable-add-to-cart .pc-button__success {
    font-size: 18px;
}

/* Spin animation for loading state */
@keyframes pc-spin {
    to {
        transform: rotate(360deg);
    }
}

.pc-spin {
    animation: pc-spin 1s linear infinite;
}