/* MN WooProduct Widget Styles */

.mn-wooproduct-wrapper {
    width: 100%;
}

.mn-wooproduct-notice {
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    color: #666;
}

/* Grid Layout */
.mn-wooproduct-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
}

/* Product Card */
.mn-wooproduct-item {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mn-wooproduct-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Image Wrapper */
.mn-wooproduct-image-wrapper {
    position: relative;
    overflow: hidden;
}

.mn-wooproduct-image {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.mn-wooproduct-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mn-wooproduct-item:hover .mn-wooproduct-image img {
    transform: scale(1.05);
}

/* Gallery Styles */
.mn-wooproduct-gallery {
    position: relative;
}

.mn-wooproduct-gallery-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.mn-wooproduct-gallery-slide {
    display: none;
    width: 100%;
}

.mn-wooproduct-gallery-slide.active {
    display: block;
}

.mn-wooproduct-gallery-slide img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.mn-wooproduct-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.mn-wooproduct-image-wrapper:hover .mn-wooproduct-gallery-nav {
    opacity: 1;
}

.mn-wooproduct-gallery-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.mn-wooproduct-gallery-prev {
    left: 10px;
}

.mn-wooproduct-gallery-next {
    right: 10px;
}

/* Badges */
.mn-wooproduct-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 5;
}

.mn-wooproduct-badge {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    color: #fff;
}

.mn-wooproduct-badge-sale {
    background: #e74c3c;
}

.mn-wooproduct-badge-featured {
    background: #f39c12;
}

.mn-wooproduct-badge-outofstock {
    background: #95a5a6;
}

/* Category Overlay (Template 1) */
.mn-wooproduct-category-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
}

.mn-wooproduct-category-overlay .mn-wooproduct-category {
    margin: 0;
}

.mn-wooproduct-category-overlay .mn-wooproduct-category a {
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mn-wooproduct-category-overlay .mn-wooproduct-category a:hover {
    background: #F6A756;
    color: #fff;
}

/* Content Area */
.mn-wooproduct-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Category (in content) */
.mn-wooproduct-content > .mn-wooproduct-category {
    margin-bottom: 8px;
}

.mn-wooproduct-category a {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mn-wooproduct-category a:hover {
    color: #F6A756;
}

/* Title */
.mn-wooproduct-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.mn-wooproduct-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mn-wooproduct-title a:hover {
    color: #F6A756;
}

/* Variations */
.mn-wooproduct-variations-wrapper {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mn-wooproduct-variations {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.mn-wooproduct-variation-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mn-wooproduct-variation-item {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

/* Variation Shapes - ONLY affects color and thumbnail, NOT text/label */
.mn-wooproduct-wrapper[data-variation-shape="circle"] .mn-variation-color,
.mn-wooproduct-wrapper[data-variation-shape="circle"] .mn-variation-thumb {
    border-radius: 50%;
}

.mn-wooproduct-wrapper[data-variation-shape="square"] .mn-variation-color,
.mn-wooproduct-wrapper[data-variation-shape="square"] .mn-variation-thumb {
    border-radius: 0;
}

.mn-wooproduct-wrapper[data-variation-shape="rounded"] .mn-variation-color,
.mn-wooproduct-wrapper[data-variation-shape="rounded"] .mn-variation-thumb {
    border-radius: 4px;
}

.mn-wooproduct-wrapper[data-variation-shape="plain"] .mn-variation-color,
.mn-wooproduct-wrapper[data-variation-shape="plain"] .mn-variation-thumb {
    border-radius: 4px;
}

/* Plain style - text/label without border/background */
.mn-wooproduct-wrapper[data-variation-shape="plain"] .mn-variation-text,
.mn-wooproduct-wrapper[data-variation-shape="plain"] .mn-variation-label {
    border: none;
    background: transparent;
    padding: 2px 6px;
    border-radius: 0;
    box-shadow: none;
    min-width: auto;
}

.mn-wooproduct-wrapper[data-variation-shape="plain"] .mn-variation-text:hover,
.mn-wooproduct-wrapper[data-variation-shape="plain"] .mn-variation-label:hover {
    border: none;
    background: transparent;
    transform: none;
    box-shadow: none;
}

.mn-wooproduct-wrapper[data-variation-shape="plain"] .mn-variation-text.active,
.mn-wooproduct-wrapper[data-variation-shape="plain"] .mn-variation-label.active {
    border: none;
    background: transparent;
    box-shadow: none;
    font-weight: 700;
    text-decoration: underline;
}

/* Variation Type: Text - ALWAYS auto-width, never affected by shape/size setting */
.mn-variation-text {
    background: #f5f5f5;
    color: #333;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 500;
    min-width: 24px;
    border: 1px solid #e0e0e0;
    width: auto !important;
    height: auto !important;
    border-radius: 4px;
}

.mn-variation-text:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.mn-variation-text.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Variation Type: Color Swatch */
.mn-variation-color {
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ddd;
    transition: all 0.3s ease;
}

.mn-variation-color:hover {
    box-shadow: 0 0 0 2px #F6A756;
    transform: scale(1.1);
}

.mn-variation-color.active {
    box-shadow: 0 0 0 2px #F6A756;
    transform: scale(1.1);
}

/* Variation Type: Thumbnail */
.mn-variation-thumb {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ddd;
    transition: all 0.3s ease;
}

.mn-variation-thumb:hover {
    box-shadow: 0 0 0 2px #F6A756;
    transform: scale(1.1);
}

.mn-variation-thumb.active {
    box-shadow: 0 0 0 2px #F6A756;
    transform: scale(1.1);
}

/* Legacy support for old class name */
.mn-variation-label {
    background: #f5f5f5;
    color: #333;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 500;
    min-width: 24px;
}

.mn-wooproduct-variation-counter {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    padding-left: 5px;
}

/* Price */
.mn-wooproduct-price {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 700;
}

.mn-wooproduct-price del {
    color: #999;
    font-weight: 400;
    font-size: 14px;
    margin-right: 8px;
}

.mn-wooproduct-price ins {
    color: #e74c3c;
    text-decoration: none;
}

/* Counter & Reviews */
.mn-wooproduct-counter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}

.mn-wooproduct-rating {
    display: flex;
    gap: 2px;
}

.mn-wooproduct-rating .star-filled {
    color: #f1c40f;
}

.mn-wooproduct-rating .star-empty {
    color: #ddd;
}

.mn-wooproduct-review-count {
    color: #999;
    font-size: 12px;
}

.mn-wooproduct-sold-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.mn-wooproduct-sold-count i {
    font-size: 11px;
    color: #999;
}

/* Buttons */
.mn-wooproduct-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.mn-wooproduct-buttons-left {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mn-wooproduct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.mn-wooproduct-btn-cart {
    background: #F6A756;
    color: #fff;
}

.mn-wooproduct-btn-cart:hover {
    background: #005a87;
    color: #fff;
}

.mn-wooproduct-btn-cart.loading {
    opacity: 0.7;
    pointer-events: none;
}

.mn-wooproduct-btn-cart.added {
    background: #27ae60;
}

.mn-wooproduct-btn-checkout {
    background: #27ae60;
    color: #fff;
}

.mn-wooproduct-btn-checkout:hover {
    background: #1e8449;
    color: #fff;
}

.mn-wooproduct-btn-readmore {
    background: transparent;
    color: #F6A756;
    padding: 8px 0;
}

.mn-wooproduct-btn-readmore:hover {
    color: #005a87;
}

/* Pagination */
.mn-wooproduct-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.mn-wooproduct-pagination a,
.mn-wooproduct-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.mn-wooproduct-pagination a:hover {
    background: #F6A756;
    color: #fff;
    border-color: #F6A756;
}

.mn-wooproduct-pagination .current {
    background: #F6A756;
    color: #fff;
    border-color: #F6A756;
}

/* Responsive */
@media (max-width: 1024px) {
    .mn-wooproduct-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .mn-wooproduct-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .mn-wooproduct-image img,
    .mn-wooproduct-gallery-slide img {
        height: 200px;
    }
    
    .mn-wooproduct-content {
        padding: 12px;
    }
    
    .mn-wooproduct-title {
        font-size: 14px;
    }
    
    .mn-wooproduct-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .mn-wooproduct-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mn-wooproduct-buttons-left {
        width: 100%;
    }
    
    .mn-wooproduct-btn-cart,
    .mn-wooproduct-btn-checkout {
        flex: 1;
        text-align: center;
    }
    
    .mn-wooproduct-btn-readmore {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .mn-wooproduct-grid {
        grid-template-columns: 1fr;
    }
    
    .mn-wooproduct-image img,
    .mn-wooproduct-gallery-slide img {
        height: 220px;
    }
}

/* Animation for AJAX Add to Cart */
@keyframes mn-wooproduct-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mn-wooproduct-btn-cart.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mn-wooproduct-spin 0.8s linear infinite;
    margin-left: 8px;
}

/* Success checkmark animation */
@keyframes mn-wooproduct-checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.mn-wooproduct-btn-cart.added::after {
    content: '✓';
    margin-left: 8px;
    animation: mn-wooproduct-checkmark 0.3s ease;
}

/* Expandable Panel for Variable Products */
.mn-wooproduct-panel {
    display: none;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    padding: 10px 12px;
    margin-top: 8px;
}

.mn-wooproduct-panel.active {
    display: block;
    animation: mnPanelSlideDown 0.2s ease;
}

@keyframes mnPanelSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mn-wooproduct-panel-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 12px;
}

.mn-wooproduct-panel-summary-label {
    color: #666;
}

.mn-wooproduct-panel-summary-value {
    font-weight: 600;
    color: #333;
}

.mn-wooproduct-panel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mn-wooproduct-panel-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mn-wooproduct-panel-quantity-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.mn-wooproduct-panel-quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.mn-wooproduct-panel-qty-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s ease;
    line-height: 1;
}

.mn-wooproduct-panel-qty-btn:hover {
    background: #f0f0f0;
}

.mn-wooproduct-panel-qty-input {
    width: 32px;
    height: 26px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.mn-wooproduct-panel-qty-input:focus {
    outline: none;
}

.mn-wooproduct-panel-footer {
    display: flex;
    gap: 6px;
    flex: 1;
}

.mn-wooproduct-panel-btn {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.mn-wooproduct-panel-btn-cart {
    background: #333;
    color: #fff;
}

.mn-wooproduct-panel-btn-cart:hover {
    background: #444;
}

.mn-wooproduct-panel-btn-cart.loading {
    opacity: 0.7;
    pointer-events: none;
}

.mn-wooproduct-panel-btn-cart.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mn-wooproduct-spin 0.8s linear infinite;
    margin-left: 6px;
}

.mn-wooproduct-panel-btn-cart.added {
    background: #28a745;
}

.mn-wooproduct-panel-btn-checkout {
    background: #F6A756;
    color: #fff;
}

.mn-wooproduct-panel-btn-checkout:hover {
    background: #006ba1;
}

.mn-wooproduct-panel-btn-checkout.loading {
    opacity: 0.7;
    pointer-events: none;
}

.mn-wooproduct-panel-message {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 8px;
    display: none;
}

.mn-wooproduct-panel-message.show {
    display: block;
}

.mn-wooproduct-panel-message.success {
    background: #d4edda;
    color: #155724;
}

.mn-wooproduct-panel-message.error {
    background: #f8d7da;
    color: #721c24;
}

/* ========================================
   Template 2 - List Style
   ======================================== */

.mn-wooproduct-template-2 .mn-wooproduct-item-list {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
}

.mn-wooproduct-template-2 .mn-wooproduct-item-list:hover {
    transform: none;
}

/* Row 1: Image + Title side by side */
.mn-wooproduct-list-row1 {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
}

.mn-wooproduct-list-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.mn-wooproduct-list-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.mn-wooproduct-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mn-wooproduct-list-image .mn-wooproduct-badges {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
}

.mn-wooproduct-list-image .mn-wooproduct-badge {
    font-size: 9px;
    padding: 2px 5px;
}

.mn-wooproduct-list-info {
    flex: 1;
    min-width: 0;
}

.mn-wooproduct-list-info .mn-wooproduct-category {
    margin-bottom: 2px;
}

.mn-wooproduct-list-info .mn-wooproduct-category a {
    font-size: 11px;
}

.mn-wooproduct-list-info .mn-wooproduct-title {
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mn-wooproduct-list-info .mn-wooproduct-title a {
    font-size: inherit;
}

.mn-wooproduct-list-info .mn-wooproduct-variations-wrapper {
    margin-bottom: 4px;
}

.mn-wooproduct-list-info .mn-wooproduct-counter {
    font-size: 11px;
}

/* Row 2: Price + Buttons */
.mn-wooproduct-list-row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px 12px;
    border-top: 1px solid #f0f0f0;
}

.mn-wooproduct-list-row2 .mn-wooproduct-price {
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.mn-wooproduct-list-row2 .mn-wooproduct-price del {
    font-size: 11px;
    opacity: 0.6;
}

.mn-wooproduct-list-row2 .mn-wooproduct-price ins {
    text-decoration: none;
}

.mn-wooproduct-list-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mn-wooproduct-list-actions .mn-wooproduct-btn {
    padding: 6px 14px;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
}

/* Responsive - Template 2 */
@media (max-width: 767px) {
    .mn-wooproduct-list-image {
        width: 70px;
        height: 70px;
    }
    
    .mn-wooproduct-list-info .mn-wooproduct-title {
        font-size: 12px;
    }
    
    .mn-wooproduct-list-row2 {
        flex-wrap: wrap;
    }
    
    .mn-wooproduct-list-row2 .mn-wooproduct-price {
        font-size: 13px;
    }
    
    .mn-wooproduct-list-actions .mn-wooproduct-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* Counter: prevent overflow in narrow 2-column template-2 layout */
    .mn-wooproduct-list-info .mn-wooproduct-counter {
        font-size: 10px;
        gap: 3px 6px;
    }

    .mn-wooproduct-list-info .mn-wooproduct-counter .mn-wooproduct-rating {
        font-size: 10px;
    }

    .mn-wooproduct-list-info .mn-wooproduct-counter .mn-wooproduct-review-count {
        font-size: 10px;
    }

    .mn-wooproduct-list-info .mn-wooproduct-counter .mn-wooproduct-sold-count {
        font-size: 10px;
    }

    /* Panel: stack quantity label above controls on mobile */
    .mn-wooproduct-panel-row {
        flex-direction: column;
        align-items: stretch;
    }

    .mn-wooproduct-panel-quantity {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .mn-wooproduct-panel-quantity-label {
        font-size: 10px;
    }

    .mn-wooproduct-panel-qty-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .mn-wooproduct-panel-qty-input {
        width: 36px;
        height: 28px;
        font-size: 12px;
    }

    /* Panel: stack Add to Cart + Buy Now buttons vertically */
    .mn-wooproduct-panel-footer {
        flex-direction: column;
        width: 100%;
    }

    .mn-wooproduct-panel-btn {
        font-size: 11px;
        padding: 9px 10px;
    }

    /* List actions: stack buttons vertically on narrow mobile */
    .mn-wooproduct-list-actions {
        flex-direction: column;
        width: 100%;
    }

    .mn-wooproduct-list-actions .mn-wooproduct-btn {
        width: 100%;
        text-align: center;
    }
}
