/**
 * IT Solution Custom Theme - Standard Product Card Stylesheet
 */

/* Column layout inside WooCommerce / Homepage Grid */
.it-product-grid-col {
    display: flex;
    flex-direction: column;
}

.it-shop-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.it-shop-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.08);
}

/* 1. BADGES */
.it-card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 5;
    pointer-events: none;
}

.it-badge-status {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.it-badge-instock {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.it-badge-outofstock {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.it-badge-backorder {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.it-badge-sale {
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

/* 2. THUMBNAIL */
.it-card-thumb-wrap {
    height: 190px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.it-thumb-link {
    display: block; /* හෝ display: flex */
    width: 100%;
    height: 100%;
}

.it-product-img {
    width: 100% !important;        /* max-width වෙනුවට width: 100% */
    height: 100% !important;       /* max-height වෙනුවට height: 100% */
    object-fit: cover !important;  /* සම්පූර්ණ කොටුව පුරාම image එක stretch නොවී ලස්සනට පිරවීමට */
    display: block !important;
    transition: transform 0.3s ease;
}

.it-shop-card:hover .it-product-img {
    transform: scale(1.08); /* Hover effect එක තවත් පැහැදිලි වීමට */
}

/* Floating Actions */
.it-card-hover-actions {
    position: absolute;
    right: 10px;
    bottom: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
}

.it-shop-card:hover .it-card-hover-actions {
    opacity: 1;
    transform: translateY(0);
}

.it-quick-view-btn {
    width: 34px;
    height: 34px;
    background: #0f172a;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
}

.it-quick-view-btn:hover {
    background: #1d4ed8;
    color: #ffffff;
}

/* 3. CARD BODY */
.it-card-body {
    padding: 16px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.it-card-category {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.it-card-category a {
    color: #94a3b8;
    text-decoration: none;
}

.it-card-category a:hover {
    color: #1d4ed8;
}

.it-card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px 0;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.it-card-title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s;
}

.it-card-title a:hover {
    color: #1d4ed8;
}

/* Hardware Meta (SKU & Warranty) */
.it-card-hardware-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.it-card-hardware-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.it-card-hardware-meta i {
    color: #0284c7;
}

/* Rating */
.it-card-rating {
    margin-bottom: 10px;
    font-size: 11px;
}

/* Price */
.it-card-price {
    font-size: 16px;
    font-weight: 800;
    color: #1d4ed8;
    margin-top: auto;
    margin-bottom: 12px;
}

.it-card-price del {
    font-size: 12px;
    color: #94a3b8;
    margin-right: 4px;
}

.it-card-price ins {
    text-decoration: none;
}

/* 4. QUANTITY & ADD TO CART BAR */
.it-card-action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.it-qty-picker {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    height: 36px;
    overflow: hidden;
}

.it-qty-btn {
    background: #f1f5f9;
    border: none;
    width: 24px;
    height: 100%;
    cursor: pointer;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.it-qty-btn:hover {
    background: #e2e8f0;
}

.it-qty-input {
    width: 32px;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    outline: none;
    -moz-appearance: textfield;
}

.it-qty-input::-webkit-outer-spin-button,
.it-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.it-btn-add-cart {
    flex: 1;
    background: #0f172a;
    color: #ffffff;
    height: 36px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.it-btn-add-cart:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.it-btn-view-options {
    width: 100%;
    background: #e2e8f0;
    color: #0f172a;
    height: 36px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.it-btn-view-options:hover {
    background: #cbd5e1;
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .it-card-thumb-wrap {
        height: 140px;
        padding: 10px;
    }
    .it-card-body {
        padding: 10px;
    }
    .it-card-title {
        font-size: 12px;
        min-height: 32px;
    }
    .it-card-price {
        font-size: 14px;
    }
    .it-card-action-bar {
        flex-direction: column;
    }
    .it-qty-picker {
        width: 100%;
        justify-content: space-between;
    }
    .it-qty-btn {
        width: 32px;
    }
    .it-qty-input {
        flex: 1;
    }
    .it-btn-add-cart {
        width: 100%;
    }
}