/**
 * Pinguins Sidecart - Main Styles
 * Glassmorphism + Brutalist Design
 */

/* Import Geologica Font */
@import url('https://fonts.googleapis.com/css2?family=Geologica:wght@100..900&display=swap');

/* Global Font */
* {
    font-family: 'Geologica', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Overlay */
.psc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.psc-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidecart Container */
.psc-sidecart {
    position: fixed;
    top: 0;
    width: 450px;
    max-width: 90vw;
    height: 100vh;
    background: transparent !important;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slide Directions */
.psc-sidecart.slide-right {
    right: 0;
    transform: translateX(100%);
}

.psc-sidecart.slide-left {
    left: 0;
    transform: translateX(-100%);
}

.psc-sidecart.active {
    transform: translateX(0);
}

/* Header */
.psc-header {
    background: linear-gradient(135deg, var(--psc-header-gradient-start), var(--psc-header-gradient-end));
    color: var(--psc-header-text);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.psc-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.psc-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.psc-header h3 {
    margin: 0;
    font-size: var(--psc-title-size);
    font-weight: var(--psc-title-weight);
}

.psc-close {
    background: #1a1a1a !important;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    transition: background 0.2s;
}

.psc-close:hover {
    background: #000000 !important;
}

.psc-close svg {
    width: 28px;
    height: 28px;
}

/* Body */
.psc-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: transparent !important;
    color: var(--psc-body-text);
}

.psc-body::-webkit-scrollbar {
    width: 8px;
}

.psc-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.psc-body::-webkit-scrollbar-thumb {
    background: var(--psc-button-bg);
    border-radius: 0;
}

/* Empty Cart */
.psc-empty-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #999;
    font-size: 16px;
}

/* Cart Items */
.psc-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.psc-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    transition: border-color 0.2s;
}

.psc-item:hover {
    border-bottom-color: rgba(0, 0, 0, 0.2) !important;
}

.psc-item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
}

.psc-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.psc-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.psc-item-name {
    margin: 0;
    font-size: var(--psc-product-name-size);
    font-weight: var(--psc-product-name-weight);
    
    color: var(--psc-body-text);
    line-height: 1.3;
}

.psc-item-price {
    font-size: var(--psc-price-size);
    font-weight: var(--psc-price-weight);
    color: var(--psc-button-bg);
}

.psc-item-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
}

.psc-qty-btn {
    width: 28px;
    height: 28px;
    background: #1a1a1a !important;
    color: #ffffff !important;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.psc-qty-btn:hover {
    opacity: 0.8;
}

.psc-qty-input {
    width: 45px;
    height: 28px;
    text-align: center;
    border: 2px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    
}

.psc-item-remove {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.psc-item-subtotal {
    font-size: var(--psc-item-price-size);
    font-weight: var(--psc-item-price-weight);
    color: var(--psc-item-price-color);
}

.psc-remove-item {
    background: #1a1a1a !important;
    border: none;
    cursor: pointer;
    color: #ffffff !important;
    padding: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.psc-remove-item:hover {
    background: #000000 !important;
}

/* Coupon Section */
.psc-coupon-section {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 2px solid rgba(0, 0, 0, 0.05);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
}

.psc-coupon-input {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    font-size: 14px;
    
    text-transform: uppercase;
}

.psc-coupon-input:focus {
    outline: none;
    border-color: var(--psc-button-bg);
}

.psc-btn-coupon {
    padding: 12px 20px;
    background: var(--psc-button-bg);
    color: var(--psc-button-text);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    
    transition: opacity 0.2s;
}

.psc-btn-coupon:hover {
    opacity: 0.9;
}

/* Applied Coupons */
.psc-applied-coupons {
    padding: 0 20px;
    margin-top: 15px;
}

.psc-applied-coupon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
    margin-bottom: 10px;
}

.psc-coupon-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.psc-coupon-code {
    font-weight: 700;
    color: #2e7d32;
    
}

.psc-coupon-discount {
    font-weight: 600;
    color: #4caf50;
}

.psc-remove-coupon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #c62828;
    padding: 5px;
    transition: opacity 0.2s;
}

.psc-remove-coupon:hover {
    opacity: 0.7;
}

/* Footer */
.psc-footer {
    flex-shrink: 0;
    padding: 20px;
    background: transparent !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.psc-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: var(--psc-total-size);
    font-weight: var(--psc-total-weight);
    
    color: var(--psc-body-text);
}

.psc-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.psc-btn {
    display: block;
    width: 100%;
    padding: 14px;
    text-align: center;
    text-decoration: none;
    
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.psc-btn:hover {
    opacity: 0.9;
}

.psc-btn-checkout {
    background: var(--psc-checkout-btn-bg) !important;
    color: var(--psc-checkout-btn-text) !important;
    font-size: var(--psc-checkout-btn-size) !important;
    font-weight: var(--psc-checkout-btn-weight) !important;
}

.psc-btn-cart {
    background: var(--psc-cart-btn-bg) !important;
    color: var(--psc-cart-btn-text) !important;
    border: 2px solid var(--psc-cart-btn-border) !important;
    font-size: var(--psc-cart-btn-size) !important;
    font-weight: var(--psc-cart-btn-weight) !important;
}

.psc-btn-continue {
    background: var(--psc-continue-btn-bg) !important;
    color: var(--psc-continue-btn-text) !important;
    border: 2px solid var(--psc-continue-btn-border) !important;
    font-size: var(--psc-continue-btn-size) !important;
    font-weight: var(--psc-continue-btn-weight) !important;
}

/* Loading State */
.psc-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.psc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid var(--psc-button-bg);
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: psc-spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes psc-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .psc-sidecart {
        width: 100%;
        max-width: 100vw;
    }
    
    .psc-header h3 {
        font-size: 18px;
    }
    
    .psc-logo {
        width: 32px;
        height: 32px;
    }
    
    .psc-item {
        padding: 12px;
    }
    
    .psc-item-image {
        width: 50px;
        height: 50px;
    }
    
    .psc-item-name {
        font-size: 14px;
    }
    
    .psc-item-price {
        font-size: 14px;
    }
    
    .psc-item-subtotal {
        font-size: 14px;
    }
    
    .psc-total {
        font-size: 18px;
    }
    
    .psc-btn {
        padding: 12px;
        font-size: 14px;
    }
}

/* Glassmorphism Effect */
.psc-sidecart.glass-enabled {
    background: rgba(255, 255, 255, var(--psc-glass-opacity)) !important;
    backdrop-filter: blur(var(--psc-glass-blur)) saturate(180%) !important;
    -webkit-backdrop-filter: blur(var(--psc-glass-blur)) saturate(180%) !important;
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.15) !important;
    isolation: isolate !important;
}

.psc-sidecart.glass-enabled .psc-body {
    background: transparent !important;
}

.psc-sidecart.glass-enabled .psc-footer {
    background: transparent !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.psc-sidecart.glass-enabled .psc-item {
    background: transparent !important;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.psc-sidecart.glass-enabled .psc-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}
