/* WP Rise Cart Specific Styles */

.wp-rise-cart-container {
    display: inline-flex;
}

.wp-rise-cart-trigger-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #334155;
}

.wp-rise-cart-trigger-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.wp-rise-cart-trigger-icon:hover {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

.wp-rise-cart-trigger-btn {
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.wp-rise-cart-trigger-btn:hover {
    border-color: #93c5fd;
    background: #f8fafc;
    color: #1d4ed8;
}

.wp-rise-cart-trigger-label {
    line-height: 1;
}

.wp-rise-cart-trigger-count {
    color: #64748b;
    font-weight: 700;
}

.wp-rise-cart-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc2626;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
    border: 2px solid white;
    line-height: 1;
}

/* Cart Modal Enhancements - Inherits base modal styles from wp-rise.css */
.wp-rise-cart-sidebar {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

.wp-rise-cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f3f4f6;
    align-items: flex-start;
    position: relative;
}

.wp-rise-cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: #f3f4f6;
}

.wp-rise-cart-item-img-placeholder {
    width: 60px;
    height: 60px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #9ca3af;
    flex-shrink: 0;
}

.wp-rise-cart-item img {
    flex-shrink: 0;
}

.wp-rise-cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wp-rise-cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.wp-rise-cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

/* Cart Sidebar & Overlay Styles */
.wp-rise-cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.wp-rise-cart-sidebar {
    position: relative !important;
    margin: auto !important;
    width: 95%;
    max-width: 500px;
    height: auto;
    max-height: 85vh;
    background: #ffffff !important;
    opacity: 1 !important;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 10001 !important;
    overflow: hidden;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wp-rise-modal-overlay.active {
    display: flex !important;
}

.wp-rise-modal-overlay.active .wp-rise-cart-sidebar {
    transform: scale(1);
    opacity: 1;
}

.wp-rise-cart-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wp-rise-cart-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 700;
}

#wp-rise-close-cart-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}

.wp-rise-cart-currency-section {
    padding: 15px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.wp-rise-cart-currency-section label {
    font-weight: 600;
    color: #374151;
    margin-right: 10px;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.wp-rise-cart-currency-toggle {
    display: inline-flex;
    gap: 5px;
}

.wp-rise-cart-currency-btn {
    padding: 6px 14px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.wp-rise-cart-currency-btn.active {
    border-color: #2563eb;
    background: #2563eb;
    color: white;
}

#wp-rise-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.wp-rise-cart-empty {
    text-align: center;
    color: #9ca3af;
    padding: 40px 0;
    font-style: italic;
}

.wp-rise-cart-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.wp-rise-cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.wp-rise-cart-total-row span:first-child {
    font-weight: 600;
    color: #374151;
}

#wp-rise-cart-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--wp-rise-success);
}

.wp-rise-cart-actions {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.wp-rise-cart-actions .wp-rise-submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.wp-rise-cart-actions .wp-rise-submit-btn.donate {
    background: var(--wp-rise-danger);
}

.wp-rise-cart-actions .wp-rise-submit-btn.purchase {
    background: var(--wp-rise-success);
}

.wp-rise-cart-actions .wp-rise-submit-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.wp-rise-cart-actions .wp-rise-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wp-rise-cart-actions .wp-rise-secondary-btn {
    width: 100%;
    padding: 10px;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.wp-rise-cart-actions .wp-rise-secondary-btn:hover {
    background: #fff;
    color: #374151;
    border-color: #9ca3af;
}

.wp-rise-cart-item-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.3;
    padding-right: 10px;
    margin: 0;
}

.wp-rise-cart-item-price {
    font-weight: 700;
    color: #059669;
    font-size: 0.9rem;
}

.wp-rise-cart-item-badges {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.wp-rise-cart-item-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.wp-rise-cart-item-badge.book {
    background: #fef3c7;
    color: #92400e;
}

.wp-rise-cart-item-badge.donate {
    background: #fee2e2;
    color: #991b1b;
}

.wp-rise-cart-item-badge.purchase {
    background: #d1fae5;
    color: #065f46;
}

.wp-rise-cart-item-remove {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.wp-rise-cart-item-remove:hover {
    color: #dc2626;
}

/* Global Add to Cart Success State Checkmark */
.wp-rise-add-to-cart-btn.added::before {
    content: "✓ ";
}

/* Quantity Sidebar Controls */
.wp-rise-cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 2px;
}

.wp-rise-cart-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    background: #ffffff;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    padding: 0;
    line-height: 1;
}

.wp-rise-cart-qty-btn:hover {
    color: #2563eb;
    background: #eff6ff;
}

.wp-rise-qty-val {
    font-weight: 700;
    color: #1f2937;
    font-size: 0.9rem;
    min-width: 15px;
    text-align: center;
}

/* Modal Overlay and Content */
.wp-rise-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999999999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
}

.wp-rise-no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
}

/* Quantity Selector Popup Styles */
#wp-rise-popup-qty-input::-webkit-outer-spin-button,
#wp-rise-popup-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#wp-rise-popup-qty-input {
    -moz-appearance: textfield;
}

#wp-rise-popup-qty-confirm:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.wp-rise-modal-content h3 {
    color: #111827;
    font-weight: 800;
}

.wp-rise-modal-content {
    background: #ffffff !important;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    /* Ensure it doesn't exceed screen height */
    overflow-y: auto;
    /* Enable scroll for long forms */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 100000;
}

.wp-rise-modal-close-x {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s;
}

.wp-rise-modal-close-x:hover {
    color: #111827;
}

/* Checkout Specific Components */
.wp-rise-checkout-items-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 20px;
    max-height: 180px;
    overflow-y: auto;
}

.wp-rise-checkout-item-row {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
}

.wp-rise-checkout-item-row:last-child {
    border-bottom: none;
}

.wp-rise-checkout-item-row img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
}

.wp-rise-checkout-item-details {
    flex: 1;
}

.wp-rise-checkout-item-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 0.9rem;
}

.wp-rise-checkout-item-price {
    font-weight: 600;
    font-size: 0.85rem;
}

.wp-rise-checkout-item-price.purchase {
    color: #059669;
}

.wp-rise-checkout-item-price.donate {
    color: #dc2626;
}

/* Success Indicator Styles */
.wp-rise-success-icon-circle {
    width: 80px;
    height: 80px;
    background: #ecfdf5;
    color: #059669;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border: 3px solid #10b981;
}

.wp-rise-success-icon-circle .dashicons {
    font-size: 50px;
    width: 50px;
    height: 50px;
}

.wp-rise-checkout-total-banner {
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
    border: 1px solid transparent;
}

.wp-rise-checkout-total-banner.purchase {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

.wp-rise-checkout-total-banner.donate {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.wp-rise-checkout-total-text {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.wp-rise-checkout-shipping-section {
    margin-bottom: 20px;
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Form Layout Helpers */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-col {
    flex: 1;
}

.form-col label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
}

.form-col input,
.form-col select {
    width: 100% !important;
    padding: 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    font-size: 0.95rem !important;
    background: #ffffff !important;
    /* Ensure solid white background */
    color: #111827 !important;
    transition: all 0.2s ease;
}

.form-col input:focus,
.form-col select:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.wp-rise-secondary-btn {
    padding: 12px 20px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.wp-rise-secondary-btn:hover {
    background: #e5e7eb;
}

@media (max-width: 600px) {
    .wp-rise-modal-content {
        padding: 20px;
        border-radius: 0;
        max-height: 100vh;
    }

    .form-row {
        flex-direction: column;
        gap: 15px;
    }
}