/**
 * ShopLinker Popup Styles
 */

/* Static Popup - Bottom Position */
.shoplinker-static-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 999999;
    display: block;
}

.shoplinker-static-popup-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Toggle Button */
.shoplinker-static-popup-toggle {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    z-index: 10;
    position: relative;
}

.shoplinker-static-popup-toggle-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2c5530 0%, #3d6b42 100%);
    color: #fff;
    border: none;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 11;
}

.shoplinker-static-popup-toggle-btn:hover {
    background: linear-gradient(135deg, #1e3d21 0%, #2c5530 100%);
    transform: translateY(-2px);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
}

.shoplinker-static-popup-toggle-btn:active {
    transform: translateY(0);
}

.shoplinker-toggle-icon {
    font-size: 20px;
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.shoplinker-static-popup.expanded .shoplinker-toggle-icon {
    transform: rotate(180deg);
}

.shoplinker-toggle-text {
    font-weight: 600;
}

/* Popup Content */
.shoplinker-static-popup-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease 0.1s, visibility 0.4s ease, padding 0.5s ease;
    padding: 0;
}

.shoplinker-static-popup.expanded .shoplinker-static-popup-content {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    padding: 20px;
}

.shoplinker-static-popup-content-bottom {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Corner Popup */
.shoplinker-popup-corner {
    position: fixed;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.shoplinker-popup-corner.active {
    opacity: 1;
    visibility: visible;
}

.shoplinker-popup-corner-content {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 320px;
    min-width: 280px;
}

.shoplinker-popup-top-left {
    top: 20px;
    left: 20px;
    transform: translateX(-20px) translateY(-20px);
}

.shoplinker-popup-top-left.active {
    transform: translateX(0) translateY(0);
}

.shoplinker-popup-top-right {
    top: 20px;
    right: 20px;
    transform: translateX(20px) translateY(-20px);
}

.shoplinker-popup-top-right.active {
    transform: translateX(0) translateY(0);
}

.shoplinker-popup-bottom-left {
    bottom: 20px;
    left: 20px;
    transform: translateX(-20px) translateY(20px);
}

.shoplinker-popup-bottom-left.active {
    transform: translateX(0) translateY(0);
}

.shoplinker-popup-bottom-right {
    bottom: 20px;
    right: 20px;
    transform: translateX(20px) translateY(20px);
}

.shoplinker-popup-bottom-right.active {
    transform: translateX(0) translateY(0);
}

/* Bottom Popup */
.shoplinker-popup-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.shoplinker-popup-bottom.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.shoplinker-popup-bottom-content {
    background: #fff;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* Close Button */
.shoplinker-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    z-index: 10;
    transition: color 0.2s ease;
}

.shoplinker-popup-close:hover {
    color: #000;
}

/* Static Popup Header */
.shoplinker-static-popup-header {
    padding: 20px 25px 15px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
}

.shoplinker-static-popup-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #2c5530;
}

.shoplinker-static-popup-close {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shoplinker-static-popup-close:hover {
    background: #f0f0f0;
    color: #2c5530;
}

.shoplinker-static-popup-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Static Popup Body */
.shoplinker-static-popup-body {
    padding: 25px;
    background: #fff;
    overflow-y: auto;
    max-height: 500px;
}

.shoplinker-static-popup-products {
    display: grid;
    gap: 20px;
}

.shoplinker-static-popup-products-horizontal {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #2c5530 #f0f0f0;
}

.shoplinker-static-popup-products-horizontal::-webkit-scrollbar {
    height: 8px;
}

.shoplinker-static-popup-products-horizontal::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.shoplinker-static-popup-products-horizontal::-webkit-scrollbar-thumb {
    background: #2c5530;
    border-radius: 4px;
}

.shoplinker-static-popup-product {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

.shoplinker-static-popup-product:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shoplinker-static-popup-product-horizontal {
    flex-shrink: 0;
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: none;
    text-align: center;
}

.shoplinker-static-popup-product-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 6px;
}

.shoplinker-static-popup-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shoplinker-static-popup-product-image-horizontal {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.shoplinker-static-popup-product-image-horizontal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.shoplinker-static-popup-product-image-horizontal:hover img {
    transform: scale(1.05);
}

.shoplinker-static-popup-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shoplinker-static-popup-product-info-horizontal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 0 10px;
}

.shoplinker-static-popup-product-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.shoplinker-static-popup-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.shoplinker-static-popup-product-title a:hover {
    color: #2c5530;
}

.shoplinker-static-popup-product-title-horizontal {
    font-size: 15px;
    margin-bottom: 5px;
}

.shoplinker-static-popup-product-price {
    font-size: 18px;
    font-weight: 600;
    color: #2c5530;
}

.shoplinker-static-popup-product-price-horizontal {
    font-size: 16px;
    margin-bottom: 10px;
}

.shoplinker-popup-add-to-cart {
    align-self: flex-start;
    margin-top: auto;
}

.shoplinker-popup-product-info-horizontal .shoplinker-popup-add-to-cart {
    align-self: center;
    width: 100%;
    max-width: 200px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2c5530 0%, #3d6b42 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shoplinker-popup-product-info-horizontal .shoplinker-popup-add-to-cart:hover {
    background: linear-gradient(135deg, #1e3d21 0%, #2c5530 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 85, 48, 0.3);
}

.shoplinker-popup-out-of-stock {
    color: #d63638;
    font-weight: 500;
}

/* Compact Product (Corner) */
.shoplinker-popup-product-compact {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.shoplinker-popup-product-compact:last-child {
    border-bottom: none;
}

.shoplinker-popup-product-image-compact {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
}

.shoplinker-popup-product-image-compact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shoplinker-popup-product-info-compact {
    flex: 1;
    min-width: 0;
}

.shoplinker-popup-product-title-compact {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.shoplinker-popup-product-title-compact a {
    color: #333;
    text-decoration: none;
}

.shoplinker-popup-product-price-compact {
    font-size: 14px;
    font-weight: 600;
    color: #2c5530;
    margin-bottom: 5px;
}

.shoplinker-popup-more-products {
    text-align: center;
    padding-top: 10px;
    color: #666;
    font-size: 12px;
}

/* Horizontal Products (Bottom) */
.shoplinker-popup-products-horizontal {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
}

.shoplinker-popup-product-horizontal {
    flex-shrink: 0;
    width: 200px;
    text-align: center;
}

.shoplinker-popup-product-image-horizontal {
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 10px;
}

.shoplinker-popup-product-image-horizontal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shoplinker-popup-product-info-horizontal {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.shoplinker-popup-product-title-horizontal {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.shoplinker-popup-product-title-horizontal a {
    color: #333;
    text-decoration: none;
}

.shoplinker-popup-product-price-horizontal {
    font-size: 16px;
    font-weight: 600;
    color: #2c5530;
}

/* Static Popup Footer */
.shoplinker-static-popup-footer {
    padding: 20px 25px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
    background: #f8f9fa;
}

.shoplinker-popup-view-cart {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #2c5530 0%, #3d6b42 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.shoplinker-popup-view-cart:hover {
    background: linear-gradient(135deg, #1e3d21 0%, #2c5530 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 85, 48, 0.3);
    color: #fff;
}

/* Body scroll lock - removed for center popup to allow scrolling */
body.shoplinker-popup-open {
    /* Allow scrolling when popup is open */
}

/* Responsive */
@media (max-width: 768px) {
    .shoplinker-popup-center-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .shoplinker-popup-corner-content {
        max-width: 280px;
        min-width: 250px;
    }
    
    .shoplinker-popup-product {
        flex-direction: column;
    }
    
    .shoplinker-popup-product-image {
        width: 100%;
        height: 200px;
    }
    
    .shoplinker-popup-products-horizontal {
        flex-direction: column;
    }
    
    .shoplinker-popup-product-horizontal {
        width: 100%;
    }
}

