/**
 * Pacific Cart Widget Styles
 * 
 * @package PacificPlugin
 * @version 2.2.1
 */

/* Cart Wrapper */
.pacific-cart-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .pacific-cart-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Cart Container */
.pacific-cart-container {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Cart Header */
.pacific-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.pacific-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.pacific-select-all input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pacific-remove-all-btn {
    background: none;
    border: none;
    color: #e91e63;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.pacific-remove-all-btn:hover {
    color: #c2185b;
    text-decoration: underline;
}

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

/* Single Cart Item */
.pacific-cart-item {
    display: grid;
    grid-template-columns: auto 80px 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.pacific-cart-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pacific-cart-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pacific-cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

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

.pacific-cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pacific-cart-item-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #000000;
}

.pacific-cart-item-name a {
    color: inherit;
    text-decoration: none;
}

.pacific-cart-item-name a:hover {
    color: #e91e63;
}

.pacific-cart-item-quantity {
    font-size: 14px;
    color: #666666;
}

.pacific-cart-item-price {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
}

.pacific-cart-item-price .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
}

/* Cart Item Controls */
.pacific-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pacific-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 5px;
}

.pacific-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #ffffff;
    color: #000000;
    font-size: 18px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pacific-qty-btn:hover {
    background: #e0e0e0;
}

.pacific-qty-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.pacific-remove-item {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #999999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pacific-remove-item:hover {
    color: #e91e63;
}

/* Cart Summary */
.pacific-cart-summary {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
    height: fit-content;
}

.pacific-summary-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: #000000;
}

/* Coupon Section */
.pacific-coupon-section {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.pacific-coupon-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #f5f5f5;
    transition: all 0.3s ease;
}

.pacific-coupon-input:focus {
    outline: none;
    border-color: #e91e63;
    background: #ffffff;
}

.pacific-apply-coupon-btn {
    padding: 12px 20px;
    background: #e91e63;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.pacific-apply-coupon-btn:hover {
    background: #c2185b;
}

.pacific-apply-coupon-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Coupon Messages */
.pacific-cart-message {
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    animation: pacific-slide-down 0.3s ease;
}

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

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

@keyframes pacific-slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Applied Coupons */
.pacific-applied-coupons {
    margin-bottom: 15px;
}

.pacific-coupon-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 20px;
    padding: 6px 12px;
    margin: 5px 5px 5px 0;
    font-size: 13px;
    animation: pacific-slide-down 0.3s ease;
}

.pacific-coupon-code {
    font-weight: 600;
    color: #2e7d32;
    text-transform: uppercase;
}

.pacific-coupon-amount {
    color: #1b5e20;
    font-weight: 500;
}

.pacific-remove-coupon {
    background: none;
    border: none;
    color: #388e3c;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pacific-remove-coupon:hover {
    background: #c8e6c9;
    color: #1b5e20;
}

/* Summary Rows */
.pacific-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.pacific-summary-row:last-of-type {
    border-bottom: none;
}

.pacific-summary-label {
    color: #000000;
    font-weight: 500;
}

.pacific-summary-value {
    color: #000000;
    font-weight: 600;
}

.pacific-summary-discount {
    color: #e91e63 !important;
}

.pacific-summary-total-row {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
    font-size: 16px;
}

.pacific-summary-total {
    font-size: 18px !important;
    font-weight: 700 !important;
}

/* Pay Button */
.pacific-pay-btn {
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    background: #e91e63;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pacific-pay-btn:hover {
    background: #c2185b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.pacific-pay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Empty Cart */
.pacific-cart-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.pacific-cart-empty p {
    font-size: 18px;
    color: #666666;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .pacific-cart-item {
        grid-template-columns: auto 60px 1fr;
        gap: 10px;
    }
    
    .pacific-cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    .pacific-cart-item-price {
        grid-column: 1 / -1;
        text-align: left;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
    }
    
    .pacific-cart-item-controls {
        grid-column: 1 / -1;
        justify-content: space-between;
    }
    
    .pacific-cart-item-name {
        font-size: 14px;
    }
    
    .pacific-cart-item-quantity {
        font-size: 12px;
    }
}

/* WooCommerce Price Formatting */
.pacific-cart-item-price .amount,
.pacific-summary-value .amount {
    font-size: inherit;
    font-weight: inherit;
}

.pacific-cart-item-price .woocommerce-Price-currencySymbol,
.pacific-summary-value .woocommerce-Price-currencySymbol {
    font-size: inherit;
}

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

.pacific-cart-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e91e63;
    border-radius: 50%;
    animation: pacific-spin 1s linear infinite;
}

@keyframes pacific-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Checkout Modal */
.pacific-checkout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    animation: pacific-fade-in 0.3s ease;
}

.pacific-checkout-modal-content {
    position: relative;
    background: #ffffff;
    max-width: 500px;
    margin: 100px auto;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: pacific-slide-in 0.3s ease;
}

.pacific-checkout-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pacific-checkout-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.pacific-checkout-modal-icon {
    margin-bottom: 20px;
    animation: pacific-check-scale 0.5s ease 0.2s both;
}

.pacific-checkout-modal-icon svg {
    display: inline-block;
}

.pacific-checkout-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
}

.pacific-checkout-modal-message {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.pacific-checkout-modal-message p {
    margin: 0 0 15px 0;
}

.pacific-checkout-modal-message p:last-child {
    margin-bottom: 0;
}

.pacific-checkout-modal-btn {
    background: #4CAF50;
    color: #ffffff;
    border: none;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.pacific-checkout-modal-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Modal Animations */
@keyframes pacific-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pacific-slide-in {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pacific-check-scale {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Prevent body scroll when modal is open */
body.pacific-modal-open {
    overflow: hidden;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .pacific-checkout-modal-content {
        margin: 50px 20px;
        padding: 30px 20px;
    }

    .pacific-checkout-modal-title {
        font-size: 24px;
    }

    .pacific-checkout-modal-message {
        font-size: 14px;
    }

    .pacific-checkout-modal-icon svg {
        width: 48px;
        height: 48px;
    }
}

/* ========================================
 * Checkout Modal
 * ======================================== */

.pacific-checkout-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: pacific-modal-fade-in 0.3s ease;
}

.pacific-checkout-modal-content {
    position: relative;
    background-color: #ffffff;
    margin: 10% auto;
    padding: 40px;
    border-radius: 15px;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: pacific-modal-slide-in 0.3s ease;
}

.pacific-checkout-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #999999;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pacific-checkout-modal-close:hover,
.pacific-checkout-modal-close:focus {
    color: #333333;
    background: #f0f0f0;
}

.pacific-checkout-modal-icon {
    margin-bottom: 20px;
}

.pacific-checkout-modal-icon svg {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    animation: pacific-check-scale 0.5s ease;
}

.pacific-checkout-modal-title {
    color: #333333;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px 0;
}

.pacific-checkout-modal-message {
    color: #666666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.pacific-checkout-modal-message p {
    margin: 0 0 15px 0;
}

.pacific-checkout-modal-message p:last-child {
    margin-bottom: 0;
}

.pacific-checkout-modal-message strong {
    color: #4CAF50;
    font-weight: 600;
}

.pacific-checkout-modal-actions {
    margin-top: 30px;
}

.pacific-checkout-modal-btn {
    background: #4CAF50;
    color: #ffffff;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pacific-checkout-modal-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Prevent body scroll when modal open */
body.pacific-modal-open {
    overflow: hidden;
}

/* Modal Animations */
@keyframes pacific-modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pacific-modal-slide-in {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pacific-check-scale {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive Modal */
@media (max-width: 768px) {
    .pacific-checkout-modal-content {
        margin: 20% 20px;
        padding: 30px 20px;
    }

    .pacific-checkout-modal-title {
        font-size: 20px;
    }

    .pacific-checkout-modal-message {
        font-size: 14px;
    }

    .pacific-checkout-modal-icon svg {
        width: 48px;
        height: 48px;
    }
}
