/**
 * MKS Warranty Extension - Front CSS
 *
 * @author    MKS
 * @copyright MKS
 * @license   Commercial
 */

/* ========================================
   WARRANTY ITEM IN CART LIST
   ======================================== */

.warranty-item {
    background: #f5f5f3;
    border-radius: 2.5rem;
    padding: 1.25rem 1.5625rem 0.9375rem 1.25rem;
    position: relative;
    margin: 2rem 1rem 20px;
}

.warranty-item .warranty-line-grid {
    padding-top: 0;
    display: flex;
    align-items: center;
}

/* Image / Icon */
.warranty-item .warranty-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.warranty-item .warranty-image-container img {
    width: 6rem;
    height: 6rem;
    aspect-ratio: 1/1;
    object-fit: cover;
    max-width: 6rem;
    max-height: 6rem;
    border-radius: 4px;
}

/* Label and description */
.warranty-item .warranty-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.warranty-item .warranty-description {
    margin-top: 4px;
}

.warranty-item .warranty-description .value {
    font-size: smaller;
    list-style: none;
    font-weight: 500;
}

.warranty-item .warranty-more-info {
    margin-top: 6px;
}

.warranty-item .warranty-info-link {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    color: #2fb5d2;
    cursor: pointer;
    transition: color 0.2s;
}

.warranty-item .warranty-info-link:hover {
    color: #1a9db8;
    text-decoration: underline;
}

.warranty-item .warranty-info-link i {
    font-size: 16px;
    margin-right: 4px;
}

/* Actions area */
.warranty-item .warranty-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 15px;
}

.warranty-item .price {
    font-size: 1rem;
    font-weight: 700;
    color: #000;
    margin-right: 1rem;
}

.warranty-item .warranty-unit-price {
    font-size: 1rem;
    font-weight: 700;
    color: #000;
    margin-right: 1rem;
}

.warranty-item .warranty-action-btn {
    min-width: 100px;
}

.warranty-item .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: fit-content;
    gap: 4px;
    padding: .75rem 1rem;
    font-size: 14px;
    border-radius: 999rem;
    transition: all 0.2s;
    line-height: 1;
    font-weight: 700;
}

.warranty-item .btn i {
    font-size: 16px;
}

.warranty-item .btn.btn-primary {
    background-color: var(--mks-color-primary-600);
    border-color: var(--mks-color-primary-600);
    color: #fff;

}

.warranty-item .btn.btn-primary:hover, .warranty-item .btn.btn-primary:hover i.material-icons {
    background-color: var(--mks-color-primary-500);
    border-color: var(--mks-color-primary-500);
    color: #fff !important;
}

.warranty-item .btn.btn-success {
    background-color: #4caf50;
    border-color: #4caf50;
    color: #fff;
}

.warranty-item .warranty-title {
    color: var(--mks-color-primary-600);
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 900;
    line-height: 1.2;
}

.warranty-item .btn.warranty-added {
    cursor: default;
}

/* Separator */
.hr-warranty {
    border: none;
    border-top: 1px dashed var(--mks-color-primary-600);
    margin: 0;
    opacity: 0.5;
}

/* Loading state */
.warranty-item .btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   POPUP STYLES
   ======================================== */

.warranty-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.warranty-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.warranty-popup-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.warranty-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.2s ease;
}

.warranty-popup-close:hover {
    color: #333;
}

.warranty-popup-close i {
    font-size: 24px;
}

.warranty-popup-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding-right: 30px;
    color: #333;
}

.warranty-popup-body {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #444;
}

.warranty-popup-body p {
    margin: 0 0 10px 0;
}

.warranty-popup-body p:last-child {
    margin-bottom: 0;
}

/* ========================================
   WARRANTY PRODUCT IN CART (ALREADY ADDED)
   ======================================== */

.warranty-product-in-cart .qty,
.warranty-product-in-cart .bootstrap-touchspin,
.warranty-product-in-cart .input-group.bootstrap-touchspin {
    display: none !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .warranty-item .warranty-line-grid {
        flex-wrap: wrap;
    }

    .warranty-item .product-line-grid-left {
        flex: 0 0 60px;
        max-width: 60px;
    }

    .warranty-item .product-line-grid-body {
        flex: 1;
    }

    .warranty-item .product-line-grid-right {
        flex: 0 0 100%;
        margin-top: 10px;
        padding-left: 70px;
    }

    .warranty-item .warranty-actions {
        justify-content: flex-start;
    }

    .warranty-item .warranty-image-container img,
    .warranty-item .warranty-icon {
        width: 50px;
        height: 50px;
    }

    .warranty-item .warranty-icon i {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .warranty-item .product-line-grid-right {
        padding-left: 0;
    }

    .warranty-item .warranty-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .warranty-item .price {
        text-align: left;
    }

    .warranty-item .btn {
        width: 100%;
    }
}
