/* product.css - Modern Product Card Styles */

/* Base Wrapper - Shared Design Foundation */
.product-modern-card-wrapper {
    overflow: visible;
    border: 1px solid rgba(148, 163, 184, 0.15);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff !important;
    border-radius: 24px !important;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* THE SURGICAL GRID: Categories, Search, Brands, Transfers */
#product_data > ul, 
#transfer-data > ul, 
#recent-transfers-data > ul {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 25px !important;
    align-items: stretch !important;
    padding: 0 !important;
    margin: 20px 0 !important;
    list-style: none !important;
    width: 100% !important;
}

#product_data > ul > li, 
#transfer-data > ul > li {
    display: flex !important;
    min-width: 0 !important;
    width: auto !important;
    height: 100% !important;
}

/* Force cards to fill parent height for perfect alignment */

/* THE SLIDER FIX: Featured Products Height Alignment */
.featured-slider-outer .slick-track {
    display: flex !important;
    align-items: stretch !important;
}

.featured-slider-outer .slick-slide {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

.featured-slider-outer .slick-slide > div {
    display: flex !important;
    flex: 1 !important;
    height: 100% !important;
}

@media (max-width: 1200px) {
    #product_data > ul, #transfer-data > ul {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 15px !important;
    }
}

@media (max-width: 768px) {
    #product_data > ul, #transfer-data > ul {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}

@media (max-width: 480px) {
    #product_data > ul, #transfer-data > ul {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
        gap: 15px !important;
    }
}

.product-modern-card-wrapper:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.product-modern-card {
    min-height: 480px;
    height: 100%;
    padding: 12px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 24px;
    box-sizing: border-box;
    overflow: visible;
    position: relative;
    width: 100%;
    text-align: left !important; /* Reset legacy centering */
}

/* Quick View Button */
.product-quick-view-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary_color, #2e528e);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(4px);
    z-index: 50;
    /* Stay above images but below main loader */
}

.product-quick-view-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
    color: var(--primary_color);
}

/* Image Area */
.product-image-section {
    margin-bottom: 0px;
    flex-shrink: 0;
}

.product-image-container {
    height: 180px !important; /* Unified standardized height */
    border-radius: 16px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 15px;
}

.product-main-image {
    max-height: 95%;
    width: auto;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-modern-card-wrapper:hover .product-main-image {
    transform: scale(1.05);
}

.product-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #94a3b8;
}

.product-badge-low-stock {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(245, 158, 11, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Details Area */
.product-details-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}

.product-title-wrapper {
    margin-bottom: 2px;
    height: 24px;
    flex-shrink: 0;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 24px;
    margin: 0;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    width: 100% !important;
}

.product-info-grid {
    margin-bottom: 0.5rem;
}

.product-sku-wrapper {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: flex-start;
}

.product-sku {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.product-price-container {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.product-current-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary_color, #2e528e);
}

.product-old-price {
    font-size: 0.95rem;
    color: #cbd5e1;
    text-decoration: line-through;
}

.signin-pricing-link {
    color: var(--primary_color);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Action areas */
.product-actions-wrapper {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-button-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-primary-btn {
    width: 100%;
    border-radius: 12px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    background: var(--primary_color, #2e528e);
    color: white !important;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    padding: 0 10px;
}

.product-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 82, 142, 0.2);
}

.product-btn-incart,
.product-btn-go-to-cart-modern {
    background: transparent !important;
    color: var(--primary_color, #2e528e) !important;
    border: 2px solid var(--primary_color, #2e528e) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

.product-btn-incart:hover,
.product-btn-go-to-cart-modern:hover {
    background: rgba(46, 82, 142, 0.05) !important;
    border-color: var(--primary_color) !important;
    color: var(--primary_color) !important;
}

.product-qty-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border-radius: 10px;
    padding: 3px;
    border: 1px solid #e2e8f0;
    height: 42px;
}

.product-qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.product-qty-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
}

.product-follow-btn {
    padding: 4px;
    font-size: 0.8rem;
    text-align: center;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-follow-btn i {
    margin-right: 6px;
}

.product-follow-btn.clicked i {
    color: #ef4444;
}

/* Responsiveness */
@media (max-width: 991px) {
    .product-modern-card {
        min-height: 520px;
        padding: 20px;
    }

    .product-current-price {
        font-size: 1.4rem;
    }
}

@media (max-width: 768px) {
    .product-modern-card {
        min-height: auto;
        padding: 16px;
    }

    .product-image-container {
        height: 160px;
    }

    .product-title {
        font-size: 0.95rem;
    }

    .product-current-price {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .product-modern-card-wrapper {
        margin-bottom: 1.5rem;
        border-radius: 16px !important;
    }

    .product-modern-card {
        border-radius: 16px;
    }

    .product-image-container {
        height: 140px;
        border-radius: 12px;
    }
}

/* GLOBAL MODERN POPUP THEME (SWEETALERT 2 & 1) */
/* Targeted with high specificity and modern class names */
body .swal-overlay,
body .sweet-overlay {
    background-color: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
    z-index: 100000 !important;
}

body .swal-modal,
body .sweet-alert {
    border-radius: 24px !important;
    padding: 48px 40px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
    font-family: inherit !important;
    background: #ffffff !important;
    z-index: 100001 !important;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    border: none !important;
}

body .swal-overlay--show-modal .swal-modal,
body .sweet-alert.show-sweet-alert {
    transform: scale(1) !important;
}

body .swal-title,
body .sweet-alert h2 {
    font-size: 1.85rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 12px !important;
    margin-top: 0 !important;
    padding: 0 !important;
    letter-spacing: -0.02em !important;
    text-transform: none !important;
    border: none !important;
}

body .swal-text,
body .sweet-alert p {
    font-size: 1rem !important;
    color: #475569 !important;
    line-height: 1.6 !important;
    font-weight: 500 !important;
    margin-bottom: 32px !important;
    padding: 0 !important;
    text-align: center !important;
    display: block !important;
}

body .swal-icon,
body .sweet-alert .sa-icon {
    transform: scale(1.1) !important;
    margin: 0 auto 24px !important;
    border-width: 4px !important;
}

/* Premium Button Refinement */
body .swal-footer,
body .sweet-alert .sa-button-container {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
    margin-top: 20px !important;
    padding: 0 !important;
    border: none !important;
}

body .swal-button,
body .sweet-alert button {
    margin: 0 !important;
    height: 50px !important;
    min-width: 140px !important;
    border-radius: 14px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
    box-shadow: none !important;
    text-transform: none !important;
}

body .swal-button--confirm,
body .sweet-alert button.confirm {
    background-color: var(--primary_color, #2e528e) !important;
    color: #ffffff !important;
    order: 2;
}

body .swal-button--confirm:hover,
body .sweet-alert button.confirm:hover {
    background-color: var(--primary_color, #2e528e) !important;
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px color-mix(in srgb, var(--primary_color, #2e528e) 40%, transparent) !important;
}

body .swal-button--cancel,
body .sweet-alert button.cancel {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    order: 1;
}

body .swal-button--cancel:hover,
body .sweet-alert button.cancel:hover {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
    transform: translateY(-2px);
}
    /* Breadcrumb Container Standard */
    /* Product Detail Premium Elements */
    .product-title-premium {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        margin-bottom: 1rem !important;
        letter-spacing: -0.02em !important;
    }

    .stock-status-modern {
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 6px 14px !important;
        background: #f0fdf4 !important;
        color: #166534 !important;
        border-radius: 99px !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        border: 1px solid #dcfce7 !important;
        margin-bottom: 20px !important;
    }

    .stock-count {
        background: #22c55e !important;
        color: white !important;
        padding: 0 8px !important;
        border-radius: 6px !important;
        margin-left: 4px !important;
        font-size: 13px !important;
    }

    .product-price-main {
        font-size: 32px !important;
        font-weight: 800 !important;
        color: #10b981 !important;
        margin: 0 !important;
        letter-spacing: -1px !important;
    }

    .old-price-pill {
        font-size: 16px !important;
        color: #94a3b8 !important;
        text-decoration: line-through !important;
        font-weight: 600 !important;
        background: #f1f5f9 !important;
        padding: 4px 12px !important;
        border-radius: 999px !important;
    }

    .bulk-pricing-container {
        background: #fbfdff !important;
        border: 1.5px dashed #cbd5e1 !important;
        border-radius: 16px !important;
        padding: 20px !important;
    }

    .bulk-pricing-title {
        font-size: 14px !important;
        font-weight: 800 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        color: #475569 !important;
        margin-bottom: 15px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .bulk-pricing-title i {
        color: #f59e0b !important;
    }

    .modern-table-inventory {
        background: white !important;
        border-radius: 12px !important;
        border: 1px solid #e2e8f0 !important;
        overflow: hidden !important;
    }

    .modern-table-inventory table {
        margin-bottom: 0 !important;
    }

    .modern-table-inventory th {
        background: #f8fafc !important;
        color: #64748b !important;
        font-size: 11px !important;
        font-weight: 800 !important;
        text-transform: uppercase !important;
        padding: 12px 15px !important;
    }

    .modern-table-inventory td {
        padding: 12px 15px !important;
        font-size: 14px !important;
        color: #334155 !important;
        vertical-align: middle !important;
    }

    /* Premium Detail Buttons */
    .btn-modern-primary {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 32px !important;
        height: 52px !important;
        background: var(--primary_color, #2e528e) !important;
        color: white !important;
        border-radius: 14px !important;
        font-weight: 800 !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        font-size: 14px !important;
        border: none !important;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
        box-shadow: 0 8px 20px rgba(46, 82, 142, 0.25) !important;
        gap: 12px !important;
        cursor: pointer !important;
        text-decoration: none !important;
    }

    .btn-modern-primary:hover {
        transform: translateY(-3px) scale(1.02) !important;
        box-shadow: 0 12px 28px rgba(46, 82, 142, 0.35) !important;
        background: #1a3a6b !important;
    }

    .btn-modern-secondary {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 32px !important;
        height: 52px !important;
        background: white !important;
        color: var(--primary_color, #2e528e) !important;
        border: 2px solid var(--primary_color, #2e528e) !important;
        border-radius: 14px !important;
        font-weight: 800 !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        font-size: 14px !important;
        transition: all 0.3s ease !important;
        gap: 12px !important;
        cursor: pointer !important;
        text-decoration: none !important;
    }

    .btn-modern-secondary:hover {
        background: rgba(46, 82, 142, 0.04) !important;
        transform: translateY(-2px) !important;
    }

    .modern-action-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 20px !important;
        border-radius: 14px !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        text-transform: capitalize !important;
        text-decoration: none !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        gap: 8px !important;
        white-space: nowrap !important;
        height: 52px !important;
        border: 2px solid transparent !important;
    }

    .btn-outline-modern {
        background: white !important;
        border: 1.5px solid #e2e8f0 !important;
        color: #475569 !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    }

    .btn-outline-modern:hover {
        border-color: var(--primary_color, #2e528e) !important;
        color: var(--primary_color, #2e528e) !important;
        background: rgba(46, 82, 142, 0.02) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    }

    .btn-outline-modern i {
        font-size: 14px !important;
        color: var(--primary_color, #2e528e) !important;
    }

    /* Button Grouping & Stack Fix */
    .product-form-outer {
        width: 100% !important;
        display: block !important;
        clear: both !important;
    }

    .product-btn-wraper {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 15px !important;
        align-items: center !important;
        margin-top: 25px !important;
        width: 100% !important;
        clear: both !important;
    }

    /* Prevent Button Text Squishing */
    .btn-modern-primary, 
    .btn-modern-secondary, 
    .modern-action-btn {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        min-width: max-content !important;
    }

    @media (max-width: 768px) {
        .product-btn-wraper {
            flex-direction: column !important;
            align-items: stretch !important;
        }
        .btn-modern-primary, .btn-modern-secondary, .modern-action-btn {
            width: 100% !important;
            min-width: 100% !important;
        }
    }

    /* Premium Tab System */
    .modern-tabs-container {
        border-bottom: 2px solid #f1f5f9 !important;
        margin-bottom: 0 !important;
    }

    .modern-tabs-nav {
        border-bottom: none !important;
        gap: 40px !important;
    }

    .modern-tabs-nav .nav-item {
        margin-bottom: -2px !important;
    }

    .modern-tabs-nav .nav-link {
        border: none !important;
        background: transparent !important;
        padding: 20px 0 !important;
        font-weight: 700 !important;
        font-size: 16px !important;
        color: #64748b !important;
        position: relative !important;
        transition: all 0.3s ease !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    .modern-tabs-nav .nav-link:hover {
        color: var(--primary_color, #2e528e) !important;
    }

    .modern-tabs-nav .nav-link::after {
        content: '' !important;
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 0 !important;
        height: 3px !important;
        background: var(--primary_color, #2e528e) !important;
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-radius: 99px !important;
    }

    .modern-tabs-nav .nav-link.active {
        color: var(--primary_color, #2e528e) !important;
        background: transparent !important;
    }

    .modern-tabs-nav .nav-link.active::after {
        width: 100% !important;
    }

    .modern-tab-content-pane {
        background: white !important;
        border: 1px solid #f1f5f9 !important;
        border-top: none !important;
        border-radius: 0 0 24px 24px !important;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.02) !important;
        overflow: hidden !important;
    }

    .btn-link-modern {
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        color: var(--primary_color, #2e528e) !important;
        font-weight: 700 !important;
        text-decoration: none !important;
        transition: transform 0.2s ease !important;
    }

    .btn-link-modern:hover {
        transform: translateX(4px) !important;
    }

    @media (max-width: 768px) {
        .modern-tabs-nav {
            gap: 20px !important;
            justify-content: center !important;
        }
        .modern-tabs-nav .nav-link {
            font-size: 14px !important;
            padding: 15px 0 !important;
        }
    }

    /* Premium Empty State */
    .modern-empty-state {
        padding: 60px 20px !important;
        text-align: center !important;
        background: #fcfdfe !important;
        border: 1px dashed #e2e8f0 !important;
        border-radius: 20px !important;
        margin: 20px !important;
    }

    .modern-empty-state i {
        font-size: 48px !important;
        color: #94a3b8 !important;
        margin-bottom: 20px !important;
        display: block !important;
    }

    .modern-empty-state .empty-title {
        font-size: 18px !important;
        font-weight: 700 !important;
        color: #475569 !important;
        margin-bottom: 8px !important;
    }

    .modern-empty-state .empty-message {
        font-size: 14px !important;
        color: #94a3b8 !important;
        max-width: 300px !important;
        margin: 0 auto !important;
    }
