/**
 * LM Product Options - Frontend Styles
 */

/* ==========================================
   PRODUCT PAGE STYLES
   ========================================== */

.lm-accessories-wrapper {
    margin: 30px 0 20px 0;
    padding: 20px 0;
    border-top: 1px solid #e5e5e5;
    clear: both;
}

.lm-accessories-title {
    font-size: 1.25em;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding: 0;
    color: #333;
}

.lm-accessories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.lm-accessories-grid[data-count="1"] {
    grid-template-columns: repeat(1, 1fr);
    max-width: 250px;
}

.lm-accessories-grid[data-count="2"] {
    grid-template-columns: repeat(2, 1fr);
    max-width: 520px;
}

.lm-accessories-grid[data-count="3"] {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 992px) {
    .lm-accessories-grid,
    .lm-accessories-grid[data-count="3"],
    .lm-accessories-grid[data-count="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .lm-accessories-grid,
    .lm-accessories-grid[data-count="2"],
    .lm-accessories-grid[data-count="3"],
    .lm-accessories-grid[data-count="4"] {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
}

.lm-accessory-item {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lm-accessory-inner {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.lm-accessory-item:hover .lm-accessory-inner {
    border-color: #b0b0b0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lm-accessory-item.selected .lm-accessory-inner {
    border-color: #22c55e;
    background-color: #f0fdf4;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

/* Tick mark */
.lm-accessory-tick {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
    z-index: 10;
}

.lm-accessory-item.selected .lm-accessory-tick {
    opacity: 1;
    transform: scale(1);
}

.lm-accessory-tick svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Image */
.lm-accessory-image {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.lm-accessory-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

/* Title */
.lm-accessory-title {
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
    margin: 0 0 12px 0;
    padding: 0;
    line-height: 1.3;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Prices */
.lm-accessory-prices {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}

.lm-price-regular {
    color: #e57373;
    text-decoration: line-through;
    font-size: 0.9em;
    line-height: 1.2;
}

.lm-price-offer {
    color: #2196f3;
    font-weight: 600;
    font-size: 1.1em;
    line-height: 1.2;
}

.lm-price-current {
    color: #2196f3;
    font-weight: 600;
    font-size: 1.1em;
    line-height: 1.2;
}

/* Bundle offer */
.lm-bundle-offer {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 0 0 15px 0;
    clear: both;
    overflow: visible;
}

.lm-bundle-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.lm-bundle-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    flex-shrink: 0;
    accent-color: #22c55e;
    cursor: pointer;
    margin: 0;
    padding: 0;
    -webkit-appearance: checkbox;
    appearance: checkbox;
}

.lm-bundle-text {
    font-size: 0.95em;
    color: #166534;
    font-weight: 500;
    line-height: 1.4;
}

/* Totals */
.lm-accessories-total {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    clear: both;
}

.lm-total-label {
    font-weight: 500;
    color: #475569;
    margin: 0;
}

.lm-total-amount {
    font-weight: 600;
    font-size: 1.2em;
    color: #1e293b;
    margin: 0;
}

.lm-total-savings {
    background: #22c55e;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    margin: 0;
}

/* Animation for selection */
@keyframes lmSelectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.lm-accessory-item.just-selected .lm-accessory-inner {
    animation: lmSelectPulse 0.3s ease;
}


/* ==========================================
   CART & CHECKOUT STYLES
   ========================================== */

.lm-accessories-badge {
    display: inline-block;
    background: #22c55e;
    color: #fff;
    font-size: 0.75em;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 500;
    vertical-align: middle;
}

.lm-cart-accessory {
    color: #166534;
    font-weight: 500;
}

.lm-bundle-applied {
    color: #22c55e;
    font-weight: 600;
}

.lm-bundle-discount-value {
    color: #22c55e;
    font-weight: 500;
}

/* WooCommerce cart item data styling */
.woocommerce-cart .cart_item dl.variation,
.woocommerce-checkout .cart_item dl.variation {
    margin-bottom: 0;
}

.woocommerce-cart .cart_item dl.variation dt,
.woocommerce-checkout .cart_item dl.variation dt {
    font-weight: 500;
    color: #64748b;
    margin-right: 5px;
}

.woocommerce-cart .cart_item dl.variation dd,
.woocommerce-checkout .cart_item dl.variation dd {
    margin-bottom: 5px;
}

/* Order details / Thank you page */
.woocommerce-order-details .product-name .wc-item-meta,
.woocommerce-table--order-details .product-name .wc-item-meta {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e5e5e5;
}

.woocommerce-order-details .product-name .wc-item-meta li,
.woocommerce-table--order-details .product-name .wc-item-meta li {
    margin-bottom: 5px;
}

/* Mini cart widget */
.woocommerce-mini-cart .mini_cart_item .lm-accessories-badge {
    display: block;
    margin: 5px 0 0 0;
    width: fit-content;
}