/**
 * WhatsApp Inquiry Plugin - Sidebar Cart Styles
 * Version: 1.0.1
 * Description: Sidebar cart panel styles with product list and form
 */

/* ============================================
   SIDEBAR CART
   ============================================ */

/* Sidebar Container */
.wainq-sidebar-cart {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}

.wainq-sidebar-cart.wainq-sidebar-open {
    right: 0;
}

/* Sidebar Header */
.wainq-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 25px;
    background: #25D366;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wainq-sidebar-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wainq-sidebar-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.wainq-sidebar-close svg {
    width: 18px;
    height: 18px;
    stroke: white;
    stroke-width: 2.5;
}

.wainq-sidebar-close:hover {
    background: rgba(0, 0, 0, 0.25);
}

.wainq-sidebar-close:hover svg {
    stroke: white;
}

/* Sidebar Body */
.wainq-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
}

.wainq-section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Products Section */
.wainq-sidebar-products {
    margin-bottom: 30px;
}

.wainq-sidebar-products-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wainq-sidebar-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.wainq-sidebar-empty svg {
    margin-bottom: 15px;
    opacity: 0.3;
}

.wainq-sidebar-empty p {
    margin: 10px 0 5px 0;
    font-size: 16px;
    color: #666;
}

.wainq-sidebar-empty small {
    font-size: 13px;
    color: #999;
}

/* Product Item */
.wainq-sidebar-product-item {
    display: grid;
    grid-template-columns: 70px 1fr 28px;
    gap: 12px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
    align-items: start;
}

.wainq-sidebar-product-item:hover {
    background: #f0f0f0;
    transform: translateX(-3px);
}

.wainq-sidebar-product-image {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
}

.wainq-sidebar-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.wainq-sidebar-product-placeholder {
    width: 100%;
    height: 100%;
    background: #e0e0e0;
    border-radius: 6px;
}

.wainq-sidebar-product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.wainq-sidebar-product-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.wainq-sidebar-product-price {
    margin: 0;
    font-size: 14px;
    color: #25D366;
    font-weight: 600;
}

.wainq-sidebar-product-quantity {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

/* Sidebar quantity buttons */
.wainq-sidebar-qty-btn,
.wainq-sidebar-qty-minus,
.wainq-sidebar-qty-plus {
    width: 28px;
    height: 28px;
    border: none;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
    box-shadow: 0 2px 4px rgba(37, 211, 102, 0.2);
}

.wainq-sidebar-qty-btn:hover,
.wainq-sidebar-qty-minus:hover,
.wainq-sidebar-qty-plus:hover {
    background: linear-gradient(135deg, #128C7E 0%, #0d6b5c 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(37, 211, 102, 0.3);
}

.wainq-sidebar-qty-btn:active,
.wainq-sidebar-qty-minus:active,
.wainq-sidebar-qty-plus:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(37, 211, 102, 0.2);
}

.wainq-sidebar-qty-input {
    width: 45px;
    height: 28px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    background: #f9f9f9;
    color: #333;
    pointer-events: none;
    user-select: none;
}

.wainq-sidebar-qty-input:focus {
    outline: none;
    border-color: #25D366;
}

.wainq-sidebar-remove-product {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 1;
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    padding: 0;
    flex-shrink: 0;
}

.wainq-sidebar-remove-product svg {
    width: 16px;
    height: 16px;
    stroke: #333;
    stroke-width: 2.5;
}

.wainq-sidebar-remove-product:hover {
    opacity: 1;
    transform: scale(1.2);
    background: transparent;
}

.wainq-sidebar-remove-product:hover svg {
    stroke: #000;
}

/* Form Section */
.wainq-sidebar-form {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.wainq-sidebar-form .wainq-form-group {
    margin-bottom: 15px;
}

.wainq-sidebar-form .wainq-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.wainq-sidebar-form .wainq-form-group input[type="text"],
.wainq-sidebar-form .wainq-form-group input[type="tel"],
.wainq-sidebar-form .wainq-form-group input[type="email"],
.wainq-sidebar-form .wainq-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.wainq-sidebar-form .wainq-form-group input:focus,
.wainq-sidebar-form .wainq-form-group textarea:focus {
    outline: none;
    border-color: #25D366;
}

.wainq-sidebar-form .wainq-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.wainq-form-checkbox {
    display: flex;
    align-items: start;
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.wainq-form-checkbox input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.wainq-form-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    width: 100%;
}

.wainq-form-checkbox span {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Sidebar Footer */
.wainq-sidebar-footer {
    border-top: 2px solid #f0f0f0;
    padding: 20px 25px;
    background: #fafafa;
}

.wainq-sidebar-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-weight: 600;
}

.wainq-total-label {
    color: #666;
    font-size: 15px;
}

.wainq-total-count {
    color: #25D366;
    font-size: 18px;
}

.wainq-sidebar-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.wainq-sidebar-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
    filter: brightness(1.05);
}

/* Body class when sidebar is active */
body.wainq-sidebar-active {
    overflow: hidden;
}

/* Scrollbar styling for sidebar */
.wainq-sidebar-body::-webkit-scrollbar {
    width: 6px;
}

.wainq-sidebar-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.wainq-sidebar-body::-webkit-scrollbar-thumb {
    background: #25D366;
    border-radius: 3px;
}

.wainq-sidebar-body::-webkit-scrollbar-thumb:hover {
    background: #128C7E;
}

/* Animation for sidebar appearance */
@keyframes slideInRight {
    from {
        right: -450px;
        opacity: 0;
    }
    to {
        right: 0;
        opacity: 1;
    }
}

.wainq-sidebar-cart.wainq-sidebar-open {
    animation: slideInRight 0.3s ease;
}

/* ============================================
   RESPONSIVE DESIGN - SIDEBAR
   ============================================ */

/* Tablet View */
@media (max-width: 1024px) {
    .wainq-sidebar-cart {
        width: 420px;
    }
}

/* Mobile View */
@media (max-width: 768px) {
    .wainq-sidebar-cart {
        width: 100%;
        right: -100%;
    }
    
    /* Make footer sticky on mobile */
    .wainq-sidebar-body {
        padding: 15px 20px;
        padding-bottom: 20px;
        overflow-y: auto;
        max-height: calc(100vh - 70px - 120px); /* viewport - header - footer */
    }
    
    .wainq-sidebar-footer {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 15px 20px;
        background: #fafafa;
        border-top: 2px solid #f0f0f0;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
        z-index: 10;
    }
}

@media (max-width: 480px) {
    .wainq-sidebar-header {
        padding: 15px 20px;
    }
    
    .wainq-sidebar-title {
        font-size: 18px;
    }
    
    .wainq-sidebar-body {
        padding: 12px 16px;
        padding-bottom: 16px;
        max-height: calc(100vh - 65px - 110px);
    }
    
    .wainq-sidebar-footer {
        padding: 12px 16px;
    }
    
    .wainq-sidebar-product-item {
        padding: 12px;
        gap: 10px;
    }
    
    .wainq-sidebar-product-image {
        width: 60px;
        height: 60px;
    }
    
    .wainq-sidebar-product-name {
        font-size: 13px;
    }
    
    .wainq-sidebar-product-price {
        font-size: 13px;
    }
    
    .wainq-sidebar-qty-btn,
    .wainq-sidebar-qty-minus,
    .wainq-sidebar-qty-plus {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    
    .wainq-sidebar-qty-input {
        width: 40px;
        height: 26px;
        font-size: 13px;
    }
    
    .wainq-sidebar-submit-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .wainq-sidebar-header {
        padding: 12px 16px;
    }
    
    .wainq-sidebar-title {
        font-size: 16px;
    }
    
    .wainq-sidebar-body {
        padding: 10px 14px;
        padding-bottom: 14px;
        max-height: calc(100vh - 60px - 100px);
    }
    
    .wainq-sidebar-footer {
        padding: 10px 14px;
    }
    
    .wainq-sidebar-product-item {
        padding: 10px;
        gap: 8px;
        grid-template-columns: 55px 1fr 20px;
    }
    
    .wainq-sidebar-product-image {
        width: 55px;
        height: 55px;
    }
    
    .wainq-sidebar-product-name {
        font-size: 12px;
    }
    
    .wainq-sidebar-product-price {
        font-size: 12px;
    }
    
    .wainq-sidebar-remove-product {
        width: 20px;
        height: 20px;
    }
    
    .wainq-sidebar-remove-product svg {
        width: 10px;
        height: 10px;
    }
    
    .wainq-sidebar-submit-btn {
        padding: 11px 14px;
        font-size: 13px;
    }
    
    .wainq-sidebar-total {
        padding: 10px;
        font-size: 14px;
    }
}
