/**
 * Product Card Component Styles
 * 
 * Matches Figma design using design tokens from the parent theme
 */

/* Product Card Container */
.product-card {
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-card__container {
    background: #f3f3f3;
    border-radius: var(--border-radius-md);
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 597px;
    width: 293px;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: var(--spacing-2);
    box-shadow: none;
    border: none;
}

.product-card__container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Product Image Section */
.product-card__image-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--color-background);
    border-radius: var(--spacing-3);
    height: 267px;
    margin-bottom: var(--spacing-4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-card__image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wishlist button - positioned in top right */
.product-card__wishlist {
    position: absolute;
    top: var(--spacing-5);
    right: var(--spacing-5);
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    backdrop-filter: blur(4px);
}

/* Sale Badge */
.product-card__sale-badge {
    position: absolute;
    top: var(--spacing-3, 12px);
    left: var(--spacing-3, 12px);
    background: #ff7544;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    text-transform: none;
    letter-spacing: 0;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(255, 117, 68, 0.2);
    font-family: var(--font-family-body, sans-serif);
    line-height: 1;
}

/* Product Content Section */
.product-card__content {
    padding: 0 var(--spacing-2) var(--spacing-4) var(--spacing-2);
    display: flex;
    flex-direction: column;
    flex: 1;
    background: transparent;
}

/* Product Title */
.product-card__title {
    margin: 0 0 var(--spacing-2) 0;
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    line-height: 1.6;
    color: var(--color-headings-general);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease-in-out;
}

.product-card__title a:hover {
    color: var(--color-primary);
}

/* Product Description */
.product-card__description {
    color: var(--color-text);
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: 1.9;
    margin: 0;
    margin-bottom: auto;
    flex: 1;
}

/* Product Price */
.product-card__price {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    margin: var(--spacing-4) 0;
}

.product-card__price .price {
    font-size: 32px;
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
    line-height: normal;
}

.product-card__price .woocommerce-Price-amount {
    font-size: 32px;
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

.product-card__price del,
.product-card__price del .woocommerce-Price-amount {
    color: var(--color-text) !important;
    font-weight: var(--font-weight-semibold);
    font-size: 32px;
    text-decoration: line-through;
    order: -1;
    margin-right: var(--spacing-2);
}

.product-card__price ins {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
    font-size: 32px;
}

.product-card__price ins .woocommerce-Price-amount {
    font-size: var(--font-size-2xl);
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

/* Out of Stock Message */
.product-card__out-of-stock {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3) var(--spacing-4);
    background: #f3f3f3;
    color: #a1a2a7;
    border: 1px solid #e6e8ec;
    border-radius: var(--border-radius-md);
    font-family: var(--font-family-heading);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    text-align: center;
    margin-top: var(--spacing-2);
    height: 29px;
}

/* Add to Cart Actions */
.product-card__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    margin-top: var(--spacing-2);
}

/* Quantity Selector */
.product-card__quantity-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.quantity-input {
    display: grid;
    grid-template-columns: 1fr 15px;
    grid-template-rows: 1fr 1fr;
    align-items: center;
    border: none;
    border-radius: 15px;
    background: #ffffff;
    overflow: visible;
    width: 58px;
    height: 49px;
    position: relative;
    box-shadow: none;
    gap: 0;
}

.quantity-input .qty {
    grid-column: 1;
    grid-row: 1 / 3;
    height: 100%;
    border: none;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #a1a2a7;
    background: transparent;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
    line-height: 25px;
    margin: 0;
    padding: 0 2px 0 12px;
}

.quantity-arrows {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: space-between;
    width: 15px;
    height: 100%;
    padding: 2px 0;
    overflow: visible;
}

.quantity-btn {
    background: transparent;
    border: none;
    width: 15px;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    padding: 0;
    margin: 0;
    position: relative;
    overflow: visible;
}

.quantity-btn img {
    width: 15px;
    height: 15px;
    opacity: 1;
    padding-right:20px;
}

.quantity-btn:hover {
    color: var(--color-headings-general);
}


.quantity-btn:hover img {
    opacity: 1;
}


.quantity-input .qty::-webkit-outer-spin-button,
.quantity-input .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add to Cart Button - using secondary button style from design tokens */
.product-card__add-to-cart {
    flex: 1;
    background: var(--color-background);
    color: var(--color-headings-general);
    border: 1px solid #e6e8ec;
    border-radius: var(--border-radius-md);
    padding: 0;
    font-family: var(--font-family-heading);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 49px;
    min-width: 203px;
}

.product-card__add-to-cart:hover {
    background: var(--color-headings-general);
    color: var(--color-background);
    border-color: #e6e8ec;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-card__add-to-cart:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Success message animation */
.product-card__success-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-primary);
    color: var(--color-background);
    border-radius: var(--border-radius-md);
    font-family: var(--font-family-heading);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card__success-message.show {
    opacity: 1;
    transform: scale(1);
}

.product-card__success-message.hide {
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
}

/* Position success message relative to actions container */
.product-card__actions {
    position: relative;
}

/* Grid Layout for Product Archives */
.products {
    display: grid;
    grid-template-columns: repeat(3, 293px);
    gap: var(--spacing-8, 32px) var(--spacing-6, 24px);
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

/* Archive page specific styling */
.militra-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 293px);
    gap: var(--spacing-8, 32px) var(--spacing-6, 24px);
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}


/* Center content for larger screens while maintaining card dimensions */
@media (min-width: 1300px) {
    .products,
    .militra-products-grid {
        justify-content: center;
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Responsive Design - Medium Screens: 428px to 768px - EXACT COPY OF <428px */
@media (max-width: 768px) and (min-width: 428px) {
    /* Product Categories Section */
    .products {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2, 8px);
    }

    /* Product Showcase Section - use same grid as <428px */
    .militra-product-showcase .products {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2, 8px);
        overflow-x: visible;
    }

    .militra-product-showcase .products .product {
        min-width: auto;
        width: 100%;
    }

    /* Related Products Section */
    .related-products-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: var(--spacing-2, 8px);
    }

    /* Card Styles for All Sections */
    .product-card__container {
        width: 100%;
        max-width: none;
        height: auto;
        min-height: 320px;
        padding: var(--spacing-1);
    }

    /* Specific styling for products in militra-showcase-container */
    .militra-showcase-container .product-card__container {
        max-width: 185px;
    }

    .product-card__image-wrapper {
        height: 100px;
        margin-bottom: var(--spacing-2);
    }

    .product-card__content {
        padding: 0 var(--spacing-1) var(--spacing-2) var(--spacing-1);
    }

    .product-card__title {
        font-size: var(--font-size-sm, 0.875rem);
        line-height: 1.3;
        margin: 0 0 var(--spacing-1) 0;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-card__description {
        font-size: var(--font-size-xs, 0.75rem);
        line-height: 1.4;
        margin: 0 0 var(--spacing-1) 0;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-card__price {
        margin: var(--spacing-1) 0;
    }

    .product-card__price .woocommerce-Price-amount {
        font-size: var(--font-size-lg, 1.125rem);
    }

    .product-card__price del,
    .product-card__price del .woocommerce-Price-amount {
        font-size: var(--font-size-lg, 1.125rem);
    }

    .product-card__price ins .woocommerce-Price-amount {
        font-size: var(--font-size-lg, 1.125rem);
    }

    .product-card__actions {
        gap: var(--spacing-1);
        margin-top: var(--spacing-1);
    }

    .quantity-input {
        display: none;
    }

    .product-card__add-to-cart {
        padding: var(--spacing-1, 4px) var(--spacing-2, 8px);
        font-size: var(--font-size-xs, 0.75rem);
        height: 28px;
        min-width: 70px;
        flex: 1;
    }

    .product-card__out-of-stock {
        padding: var(--spacing-1, 4px) var(--spacing-2, 8px);
        font-size: var(--font-size-xs, 0.75rem);
        height: 28px;
    }
}

/* Small Screens: max 427px only - don't conflict with 428px-768px */
@media (max-width: 427px) {
    /* These rules are handled by the specific 428px+ breakpoints above */
}

/* Small Mobile: max 428px */
@media (max-width: 428px) {
    /* Product Categories Section */
    .products {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2, 8px);
    }

    /* Product Showcase Section */
    .militra-product-showcase .products {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2, 8px);
        overflow-x: visible;
    }

    .militra-product-showcase .products .product {
        min-width: auto;
        width: 100%;
    }

    /* Related Products Section */
    .related-products-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: var(--spacing-2, 8px);
    }

    /* Card Styles for All Sections */
    .product-card__container {
        width: 100%;
        max-width: none;
        height: auto;
        min-height: 320px;
        padding: var(--spacing-1);
    }

    /* Specific styling for products in militra-showcase-container */
    .militra-showcase-container .product-card__container {
        max-width: 185px;
    }

    .product-card__image-wrapper {
        height: 100px;
        margin-bottom: var(--spacing-2);
    }

    .product-card__content {
        padding: 0 var(--spacing-1) var(--spacing-2) var(--spacing-1);
    }

    .product-card__title {
        font-size: var(--font-size-sm, 0.875rem);
        line-height: 1.3;
        margin: 0 0 var(--spacing-1) 0;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-card__description {
        font-size: var(--font-size-xs, 0.75rem);
        line-height: 1.4;
        margin: 0 0 var(--spacing-1) 0;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-card__price {
        margin: var(--spacing-1) 0;
    }

    .product-card__price .woocommerce-Price-amount {
        font-size: var(--font-size-lg, 1.125rem);
    }

    .product-card__price del,
    .product-card__price del .woocommerce-Price-amount {
        font-size: var(--font-size-lg, 1.125rem);
    }

    .product-card__price ins .woocommerce-Price-amount {
        font-size: var(--font-size-lg, 1.125rem);
    }

    .product-card__actions {
        gap: var(--spacing-1);
        margin-top: var(--spacing-1);
    }

    .quantity-input {
        display: none;
    }

    .product-card__add-to-cart {
        padding: var(--spacing-1, 4px) var(--spacing-2, 8px);
        font-size: var(--font-size-xs, 0.75rem);
        height: 28px;
        min-width: 70px;
        flex: 1;
    }

    .product-card__out-of-stock {
        padding: var(--spacing-1, 4px) var(--spacing-2, 8px);
        font-size: var(--font-size-xs, 0.75rem);
        height: 28px;
    }
}

/* Remove WooCommerce added_to_cart link completely */
.added_to_cart,
a.added_to_cart {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Only hide wc-forward links that are also added_to_cart, not checkout buttons */
a.added_to_cart.wc-forward {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* High-contrast and accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .product-card__container,
    .product-card__image,
    .product-card__add-to-cart {
        transition: none;
    }
    
    .product-card__container:hover {
        transform: none;
    }
    
    .product-card__container:hover .product-card__image {
        transform: none;
    }
}

