/**
 * Alvasco Pro - Product Grid Widget Styles
 * Version: 4.1.5
 */

/* ============================================
   Toolbar
   ============================================ */
.alvasco-products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 30px;
}

.alvasco-toolbar-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.alvasco-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.alvasco-layout-switcher {
    display: flex;
    gap: 5px;
}

.alvasco-layout-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.alvasco-layout-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.alvasco-layout-btn.active {
    background: #ff6b35;
    border-color: #ff6b35;
    color: #fff;
}

.alvasco-sort-dropdown select {
    padding: 8px 30px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 180px;
}

/* ============================================
   Product Grid Container
   ============================================ */
.alvasco-products-grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

/* Column Layouts */
.alvasco-products-grid.alvasco-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.alvasco-products-grid.alvasco-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.alvasco-products-grid.alvasco-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.alvasco-products-grid.alvasco-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* ============================================
   Product Card
   ============================================ */
.alvasco-product-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.alvasco-product-card:hover {
    border-color: #ff6b35;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.1);
    transform: translateY(-2px);
}

/* ============================================
   Product Image
   ============================================ */
.alvasco-product-image {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alvasco-product-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.alvasco-product-card:hover .alvasco-product-image img {
    transform: scale(1.05);
}

/* ============================================
   Product Category
   ============================================ */
.alvasco-product-category {
    font-size: 12px;
    text-transform: uppercase;
    color: #ff6b35;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* ============================================
   Product Title
   ============================================ */
.alvasco-product-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
    color: #1e3a5f;
}

.alvasco-product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.alvasco-product-title a:hover {
    color: #ff6b35;
}

/* ============================================
   Product Excerpt
   ============================================ */
.alvasco-product-excerpt {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* ============================================
   Product Attributes
   ============================================ */
.alvasco-product-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    flex-grow: 1;
}

.alvasco-product-attribute {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6c757d;
    padding: 4px 0;
}

.alvasco-product-attribute i,
.alvasco-product-attribute svg {
    font-size: 14px;
    color: #ff6b35;
}

/* Attribute Layouts */

/* Icons with Text (default) */
.alvasco-product-attributes.layout-icons .alvasco-product-attribute {
    flex-basis: calc(50% - 4px);
}

/* Badge Style */
.alvasco-product-attributes.layout-badges .alvasco-product-attribute {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 10px;
}

/* List Style */
.alvasco-product-attributes.layout-list {
    flex-direction: column;
    gap: 6px;
}

.alvasco-product-attributes.layout-list .alvasco-product-attribute {
    width: 100%;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.alvasco-product-attributes.layout-list .alvasco-product-attribute:last-child {
    border-bottom: none;
}

/* ============================================
   Product Footer / Buttons
   ============================================ */
.alvasco-product-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.alvasco-add-to-quote {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: #ff6b35;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.alvasco-add-to-quote:hover {
    background: #32cd32;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(50, 205, 50, 0.3);
}

/* ============================================
   No Products Message
   ============================================ */
.alvasco-no-products {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.alvasco-no-products p {
    font-size: 18px;
    color: #6c757d;
    margin: 0;
}

/* ============================================
   Pagination
   ============================================ */
.alvasco-pagination {
    margin-top: 40px;
    text-align: center;
}

.alvasco-pagination .page-numbers {
    display: inline-block;
    padding: 10px 16px;
    margin: 0 4px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #1e3a5f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.alvasco-pagination .page-numbers:hover {
    background: #ff6b35;
    color: #ffffff;
    border-color: #ff6b35;
}

.alvasco-pagination .page-numbers.current {
    background: #ff6b35;
    color: #ffffff;
    border-color: #ff6b35;
}

.alvasco-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 992px) {
    .alvasco-products-grid.alvasco-columns-4,
    .alvasco-products-grid.alvasco-columns-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .alvasco-products-grid.alvasco-columns-3,
    .alvasco-products-grid.alvasco-columns-4,
    .alvasco-products-grid.alvasco-columns-5 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .alvasco-product-card {
        padding: 12px;
    }
    
    .alvasco-product-title {
        font-size: 14px;
    }
    
    .alvasco-product-attribute {
        font-size: 12px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    /* Mobile column controls */
    .alvasco-products-grid.alvasco-columns-mobile-1 {
        grid-template-columns: 1fr !important;
    }
    
    .alvasco-products-grid.alvasco-columns-mobile-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .alvasco-products-grid.alvasco-columns-mobile-3 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .alvasco-products-grid {
        gap: 15px;
    }
    
    .alvasco-product-card {
        padding: 15px;
    }
    
    .alvasco-product-attributes {
        flex-direction: column;
        gap: 8px;
    }
    
    .alvasco-product-attribute {
        width: 100%;
    }
    
    .alvasco-add-to-quote {
        padding: 14px 20px;
        font-size: 13px;
    }
    
    .alvasco-pagination .page-numbers {
        padding: 8px 12px;
        font-size: 13px;
        margin: 0 2px;
    }
}

/* ============================================
   Loading State
   ============================================ */
.alvasco-products-grid.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.alvasco-products-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: alvasco-spin 1s linear infinite;
    z-index: 10;
}

@keyframes alvasco-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Elementor Editor Styles
   ============================================ */
.elementor-editor-active .alvasco-product-card {
    pointer-events: none;
}

.elementor-editor-active .alvasco-add-to-quote {
    pointer-events: none;
}

/* ============================================
   Product Image Carousel Styles
   ============================================ */
.alvasco-product-carousel {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: inherit;
}

.alvasco-product-carousel .swiper-wrapper {
    width: 100%;
    height: auto;
}

.alvasco-product-carousel .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important; /* Force 100% width per slide */
    max-width: 100%;
}

.alvasco-product-carousel .swiper-slide a {
    display: block;
    width: 100%;
    max-width: 100%;
}

.alvasco-product-carousel .swiper-slide img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Navigation Arrows */
.alvasco-product-carousel .swiper-button-prev,
.alvasco-product-carousel .swiper-button-next {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alvasco-product-carousel:hover .swiper-button-prev,
.alvasco-product-carousel:hover .swiper-button-next {
    opacity: 1;
}

.alvasco-product-carousel .swiper-button-prev:after,
.alvasco-product-carousel .swiper-button-next:after {
    font-size: 14px;
    color: #333;
    font-weight: bold;
}

.alvasco-product-carousel .swiper-button-prev {
    left: 8px;
}

.alvasco-product-carousel .swiper-button-next {
    right: 8px;
}

/* Pagination Dots */
.alvasco-product-carousel .swiper-pagination {
    bottom: 8px !important;
}

.alvasco-product-carousel .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    opacity: 1;
}

.alvasco-product-carousel .swiper-pagination-bullet-active {
    background: #fff;
}

/* Disable pointer events on links during drag */
.alvasco-product-carousel.swiper-dragging a {
    pointer-events: none;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .alvasco-add-to-quote,
    .alvasco-pagination {
        display: none;
    }
    
    .alvasco-product-card {
        break-inside: avoid;
    }
}

/* ============================================
   Product SKU Display
   ============================================ */
.alvasco-product-sku {
    font-size: 13px;
    color: #888888;
    margin: 8px 0 12px 0;
    font-family: 'Courier New', monospace;
}

.alvasco-product-sku .sku-label {
    font-weight: 600;
    color: #666666;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.alvasco-product-sku .sku-value {
    color: #999999;
    font-weight: 400;
}

/* ============================================
   MOQ Bold Orange Styling
   ============================================ */
.alvasco-product-attribute.alvasco-attr-moq .moq-label {
    font-weight: 700;
    color: #ff6b35;
}

.alvasco-product-attribute.alvasco-attr-moq .moq-value {
    font-weight: 400;
    color: #666666;
}
/**
 * Alvasco Pro - NEW MINIMAL PRODUCT CARD DESIGN
 * Version: 4.45.0
 * Matches prototype.jpg and 2prototype.jpg
 */

/* ============================================
   PRODUCT CARD - MINIMAL DESIGN
   ============================================ */
.alvasco-product-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 0 !important; /* Sharp corners like prototype */
    padding: 0 !important; /* No padding on card itself */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.alvasco-product-card:hover {
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   PRODUCT IMAGE WITH BADGES
   ============================================ */
.alvasco-product-image {
    position: relative;
    overflow: hidden;
    margin-bottom: 0 !important; /* No margin */
    background: #f5f5f5;
}

.alvasco-product-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.alvasco-product-card:hover .alvasco-product-image img {
    transform: scale(1.03);
}

/* Inventory Badge (top-left) */
.alvasco-inventory-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #1e3a8a; /* Dark blue like prototype */
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: 3px;
    text-transform: uppercase;
    z-index: 10;
}

/* Product Icons (bottom-right of image) */
.alvasco-product-icons {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 10;
    flex-direction: row-reverse; /* Right to left order */
}

.alvasco-product-icons span {
    width: 28px;
    height: 28px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: help;
}

/* Flag icons - SVG images */
.alvasco-product-icons .icon-inventory {
    padding: 4px;
    background: #ffffff;
}

.alvasco-product-icons .icon-inventory img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.icon-quick-ship {
    background: #fbbf24 !important; /* Yellow/gold */
}

.icon-featured {
    background: #ef4444 !important; /* Red */
}

/* ============================================
   PRODUCT INFO SECTION
   ============================================ */
.alvasco-product-info {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* SKU - Small, gray, minimal */
.alvasco-product-sku {
    font-size: 11px !important;
    color: #6b7280 !important;
    margin-bottom: 6px !important;
    font-weight: 400 !important;
    letter-spacing: 0.3px;
}

/* Title - Bold, 2 lines max */
.alvasco-product-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    margin-bottom: 12px !important;
    color: #111827 !important;
    min-height: 42px; /* 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.alvasco-product-title a {
    color: inherit !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.alvasco-product-title a:hover {
    color: #1e3a8a !important;
}

/* ============================================
   MOQ & PRODUCTION META (SIDE-BY-SIDE)
   ============================================ */
.alvasco-product-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: transparent;
    border: none;
    margin-top: auto;
    margin-bottom: 16px;
}

.alvasco-meta-item {
    background: #ffffff;
    padding: 10px 12px;
    text-align: center;
    position: relative;
}

/* Center divider only */
.alvasco-meta-item:first-child::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: #e5e7eb;
}

.meta-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.meta-value {
    font-size: 14px;
    color: #111827;
    font-weight: 700;
}

/* ============================================
   ADD TO QUOTE BUTTON - OUTLINE STYLE
   ============================================ */
.alvasco-product-footer {
    padding: 0 16px 16px 16px;
    margin-top: 0 !important;
    border-top: none !important;
}

.alvasco-add-to-quote {
    display: block !important;
    width: 100% !important;
    padding: 12px 20px !important;
    background: transparent !important;
    color: #111827 !important;
    border: 2px solid #111827 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    transition: all 0.2s ease !important;
    cursor: pointer;
}

.alvasco-add-to-quote:hover {
    background: #111827 !important;
    color: #ffffff !important;
    border-color: #111827 !important;
}

/* ============================================
   HIDE OLD ELEMENTS
   ============================================ */
.alvasco-product-category,
.alvasco-product-excerpt,
.alvasco-product-attributes {
    display: none !important; /* Hide category, excerpt, and old attributes layout */
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .alvasco-product-title {
        font-size: 14px !important;
    }
    
    .alvasco-product-meta {
        gap: 0;
    }
    
    .meta-label {
        font-size: 10px;
    }
    
    .meta-value {
        font-size: 13px;
    }
    
    .alvasco-inventory-badge {
        font-size: 9px;
        padding: 5px 10px;
    }
}

/* AJAX Loading States */
.alvasco-products-grid.alvasco-loading {
    position: relative;
    pointer-events: none;
}

.alvasco-products-grid.alvasco-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #f57e36;
    border-radius: 50%;
    animation: alvasco-spin 1s linear infinite;
}

@keyframes alvasco-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Active Filter Tags */
.alvasco-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 0;
    margin-bottom: 20px;
}

.alvasco-active-filters .filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
    cursor: default;
}

.alvasco-active-filters .filter-tag .remove-filter {
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    margin: 0;
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    z-index: 10;
}

.alvasco-active-filters .filter-tag .remove-filter:hover {
    background: #e74c3c;
    color: white;
}

.alvasco-active-filters .clear-all-filters {
    padding: 6px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.alvasco-active-filters .clear-all-filters:hover {
    background: #c0392b;
}

/* Error Message */
.alvasco-error-message {
    padding: 40px 20px;
    text-align: center;
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
    border-radius: 8px;
    margin: 20px 0;
}
