﻿/* Product Inquiry Widget Styles */
.pi-products-grid {
    display: grid;
    gap: 20px;
}

.pi-columns-1 { grid-template-columns: repeat(1, 1fr); }
.pi-columns-2 { grid-template-columns: repeat(2, 1fr); }
.pi-columns-3 { grid-template-columns: repeat(3, 1fr); }
.pi-columns-4 { grid-template-columns: repeat(4, 1fr); }
.pi-columns-5 { grid-template-columns: repeat(5, 1fr); }
.pi-columns-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 991px) {
    .pi-columns-4,
    .pi-columns-5,
    .pi-columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .pi-columns-3,
    .pi-columns-4,
    .pi-columns-5,
    .pi-columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .pi-products-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

.pi-product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.pi-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pi-product-image {
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.pi-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pi-product-title {
    font-size: 14px;
    font-weight: 400;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.4;
    flex-grow: 1;
}

.pi-inquiry-btn {
    background-color: #e67e22;
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.pi-inquiry-btn:hover {
    background-color: #d35400;
}

/* Modal Styles */
.pi-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.pi-modal.active {
    display: block;
}

.pi-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.pi-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 4px;
}


.pi-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pi-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.pi-continue-link {
    color: #333;
    text-decoration: underline;
    font-size: 14px;
}

.pi-continue-link:hover {
    color: #e67e22;
}

/* Product List in Modal */
.pi-product-list {
    margin-bottom: 30px;
}

.pi-list-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.pi-col-product {
    flex: 1;
}

.pi-col-quantity {
    width: 180px;
    text-align: right;
    padding-right: 15px;
}

.pi-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border: 1px solid #eee;
    border-top: none;
    background: #fff;
}

.pi-list-item:first-child {
    border-top: 1px solid #eee;
}

.pi-item-info {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 20px;
    padding-left: 15px;
}

.pi-item-image {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border: 1px solid #eee;
    padding: 8px;
    background: #fff;
}

.pi-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pi-item-title {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    flex: 1;
}

.pi-item-quantity {
    display: flex;
    align-items: center;
    gap: 0;
    width: 180px;
    justify-content: flex-end;
    padding-right: 15px;
}

.pi-qty-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.2s;
    user-select: none;
}

.pi-qty-btn:hover {
    color: #e67e22;
}

.pi-qty-input {
    width: 50px;
    height: 36px;
    text-align: center;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    border-left: none;
    border-right: none;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pi-remove-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 10px;
}

.pi-remove-btn:hover {
    color: #e74c3c;
}

/* Form Styles */
.pi-inquiry-form {
    margin-top: 20px;
}

.pi-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.pi-form-group {
    flex: 1;
}

.pi-form-group.pi-full-width {
    width: 100%;
}

.pi-form-group.pi-floating .pi-label-text {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.pi-form-group.pi-floating .pi-label-text .required {
    color: #e74c3c;
}

.pi-form-group.pi-floating .pi-input-wrap {
    position: relative;
}

.pi-form-group.pi-floating input,
.pi-form-group.pi-floating textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 14px;
    transition: border-color 0.3s;
    background: #fff;
}

.pi-form-group.pi-floating .pi-input-wrap label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #999;
    pointer-events: none;
    transition: all 0.2s ease;
    background: #fff;
    padding: 0 5px;
    margin-left: -5px;
}

.pi-form-group.pi-floating textarea + label {
    top: 15px;
    transform: none;
}

.pi-form-group.pi-floating input:focus,
.pi-form-group.pi-floating textarea:focus {
    outline: none;
    border-color: #333;
}

.pi-form-group.pi-floating input:focus + label,
.pi-form-group.pi-floating input:not(:placeholder-shown) + label {
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: #666;
}

.pi-form-group.pi-floating textarea:focus + label,
.pi-form-group.pi-floating textarea:not(:placeholder-shown) + label {
    top: -8px;
    transform: none;
    font-size: 12px;
    color: #666;
}

.pi-form-group.pi-floating textarea {
    resize: vertical;
    min-height: 120px;
}

.pi-form-submit {
    text-align: center;
    margin-top: 25px;
}

.pi-submit-btn {
    background: #222;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.pi-submit-btn:hover {
    background: #444;
}

.pi-submit-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Success/Error Messages */
.pi-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
}

.pi-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pi-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 767px) {
    .pi-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .pi-modal-content {
        padding: 20px;
    }
    
    .pi-modal-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }
    
    .pi-modal-title {
        flex: 1;
    }
    
    .pi-continue-link {
        margin-left: auto;
    }
    
    /* Modal Product List - Mobile */
    .pi-list-header {
        display: none;
    }
    
    .pi-list-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        gap: 15px;
    }
    
    .pi-item-info {
        width: 100%;
        padding-left: 0;
    }
    
    .pi-item-quantity {
        width: 100%;
        justify-content: flex-start;
        padding-right: 0;
    }
    
    /* Mobile Carousel */
    .pi-products-wrapper {
        position: relative;
    }
    
    .pi-products-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 15px;
        padding-bottom: 10px;
    }
    
    .pi-products-grid::-webkit-scrollbar {
        display: none;
    }
    
    .pi-products-grid .pi-product-card {
        flex: 0 0 calc(50% - 7.5px);
        scroll-snap-align: start;
    }
    
    .pi-carousel-nav {
        display: flex;
        justify-content: center;
        gap: 15px;
        margin-top: 15px;
    }
    
    .pi-carousel-prev,
    .pi-carousel-next {
        width: 40px;
        height: 40px;
        border: 1px solid #ddd;
        background: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .pi-carousel-prev:hover,
    .pi-carousel-next:hover {
        background: #f5f5f5;
        border-color: #ccc;
    }
    
    .pi-carousel-prev i,
    .pi-carousel-next i {
        font-size: 14px;
        color: #333;
    }
}

/* Desktop - hide carousel nav */
@media (min-width: 768px) {
    .pi-carousel-nav {
        display: none;
    }
}

/* Compare Checkbox */
.pi-compare-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
}

.pi-compare-input {
    width: 14px;
    height: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #c3c3c3;
    background: transparent;
    position: relative;
    border-radius: 2px;
}

.pi-compare-input:checked {
    background: #333;
    border-color: #333;
}

.pi-compare-input:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pi-compare-text {
    font-size: 16px;
    color: #4d4d4d;
    font-weight: 400;
    transition: color 0.2s;
}

.pi-compare-input:checked + .pi-compare-text {
    color: #333;
    font-weight: 700;
}

/* Compare Bar */
.pi-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.pi-compare-bar.active {
    transform: translateY(0);
}

.pi-compare-bar-inner {
    max-width: 1550px;
    margin: 0 auto;
    padding: 0 20px;
}

.pi-compare-header {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.pi-compare-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.pi-compare-count {
    font-size: 13px;
    color: #666;
}

.pi-compare-toggle {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: transform 0.3s;
}

.pi-compare-bar.collapsed .pi-compare-toggle {
    transform: rotate(180deg);
}

.pi-compare-bar.collapsed .pi-compare-content {
    display: none;
}

.pi-compare-content {
    display: flex;
    align-items: center;
    padding: 15px 0;
    gap: 20px;
}

.pi-compare-items {
    display: flex;
    flex: 1;
    gap: 15px;
    overflow-x: auto;
}

.pi-compare-slot {
    flex: 1;
    min-height: 60px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pi-compare-slot.filled {
    border: none;
    background: #f5f5f5;
    padding: 8px 12px;
}

.pi-compare-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.pi-compare-item-image {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.pi-compare-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pi-compare-item-title {
    flex: 1;
    font-size: 13px;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pi-compare-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 16px;
    padding: 5px;
    transition: color 0.2s;
}

.pi-compare-item-remove:hover {
    color: #e74c3c;
}

.pi-compare-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.pi-compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e67e22;
    color: #fff;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.pi-compare-btn:hover {
    background: #d35400;
}

.pi-compare-btn svg {
    flex-shrink: 0;
}

.pi-compare-clear {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 13px;
    cursor: pointer;
}

.pi-compare-clear:hover {
    color: #333;
}

/* ===== Swiper Layout ===== */
.pi-swiper-container {
    position: relative;
}

.pi-swiper {
    width: 100%;
    overflow: hidden;
}

.pi-swiper .swiper-wrapper {
    align-items: stretch;
}

.pi-swiper .swiper-slide {
    height: auto;
}

.pi-swiper .pi-product-card {
    height: 100%;
    box-sizing: border-box;
}

.pi-swiper-prev,
.pi-swiper-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    transition: color 0.3s;
    user-select: none;
}

.pi-swiper-prev {
    left: -20px;
    transform: translateY(-50%) translateX(-100%);
}

.pi-swiper-next {
    right: -20px;
    transform: translateY(-50%) translateX(100%);
}

.pi-swiper-prev:hover,
.pi-swiper-next:hover {
    color: #e67e22;
}

.pi-swiper-prev svg,
.pi-swiper-next svg {
    stroke: currentColor;
}

.pi-swiper-prev.swiper-button-disabled,
.pi-swiper-next.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* View All Collection Card */
.pi-view-all-slide {
    height: auto;
}

.pi-view-all-card {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-decoration: none;
    position: relative;
    box-sizing: border-box;
}

.pi-view-all-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(80, 80, 80, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.3s;
}

.pi-view-all-card:hover .pi-view-all-overlay {
    background: rgba(80, 80, 80, 0.75);
}

.pi-view-all-text {
    font-size: 14px;
    color: #fff;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.pi-view-all-subtitle {
    font-size: 20px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Compare Bar Mobile */
@media (max-width: 767px) {
    .pi-compare-bar-inner {
        padding: 0 15px;
    }
    
    .pi-compare-header {
        flex-wrap: wrap;
    }
    
    .pi-compare-title {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .pi-compare-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pi-compare-items {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .pi-compare-slot {
        flex: 0 0 80%;
        min-width: 0;
    }
    
    .pi-compare-actions {
        flex-direction: column;
        gap: 10px;
        padding-top: 10px;
        border-top: 1px solid #eee;
    }
    
    .pi-compare-btn {
        width: 100%;
        justify-content: center;
    }
    
    .pi-compare-clear {
        justify-content: center;
    }
}