/* ===================================
   Product Page Conversion Optimization CSS
   Mobile-first responsive design
   =================================== */

/* General Product Page Styles */
.product-page-optimized {
    padding-top: 30px;
}

.product-header {
    margin-bottom: 30px;
    align-items: center;
}

.product-title {
    font-size: 47px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.trust-badge-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Product Image Styles */
.product-image-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.product-image {
    width: 100%;
    height: auto;
    max-width: 500px;
    margin: 0 auto;
    display: block;
}

/* Make product image half size */
.product-image-small {
    max-width: 250px !important;
}

/* Pricing Cards Grid */
.pricing-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 15px 10px;
    margin: 25px 0 20px 0;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pricing-card:hover:not(.selected) {
    border-color: #22a35c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 163, 92, 0.2);
    text-decoration: none;
}

.pricing-card.selected:hover {
    transform: scale(1.07);
    box-shadow: 0 8px 24px rgba(26, 130, 73, 0.5);
}

.pricing-card.selected {
    border: 2px solid #1a8249;
    background: linear-gradient(135deg, #22a35c, #1a8249);
    box-shadow: 0 6px 20px rgba(26, 130, 73, 0.4);
    transform: scale(1.05);
}

.pricing-card.selected .card-quantity {
    color: white;
    font-weight: 800;
}

.pricing-card.selected .card-price {
    color: white;
    font-weight: 700;
}

.pricing-card.selected .card-unit {
    color: rgba(255, 255, 255, 0.9);
}

/* Remove special styling for popular cards - they'll use default styling */

.card-quantity {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.card-price {
    font-size: 16px;
    font-weight: 600;
    color: #22a35c;
    margin-bottom: 2px;
}

.card-unit {
    font-size: 11px;
    color: #666;
}

.popular-badge {
    position: absolute;
    top: -17px;
    right: 8px;
    background: rgba(255, 107, 53, 0.85);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

.save-badge {
    position: absolute;
    top: -17px;
    right: 8px;
    background: rgba(34, 163, 92, 0.85);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

/* Adjust badge colors when on selected card */
.pricing-card.selected .popular-badge {
    background: rgba(255, 107, 53, 0.9);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

.pricing-card.selected .save-badge {
    background: rgba(255, 215, 0, 0.9);
    color: #1a8249;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

/* Enhanced Mobile Dropdown Container */
.pricing-dropdown-container {
    margin: 25px 0;
    position: relative;
    animation: slideInUp 0.4s ease;
}

/* Main Dropdown Select - Redesigned */
.pricing-select {
    width: 100%;
    padding: 18px 50px 18px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: white;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1a1a1a;
    position: relative;
    z-index: 2;
    line-height: 1.5;
}

.pricing-select:hover {
    transform: translateY(-1px);
}

.pricing-select:focus {
    outline: none;
}

/* Animate on change */
.pricing-select:active {
    transform: scale(0.98);
}

/* Currently selected value styling */
.pricing-select option[selected] {
    background-color: #22a35c;
    color: white;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown wrapper with clean design */
.dropdown-wrapper {
    position: relative;
    background: #f8f9fa;
    border-radius: 16px 16px 0 0;
    padding: 4px;
    transition: all 0.3s ease;
}

.dropdown-wrapper:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 0 0 1px rgba(34, 163, 92, 0.3),
        0 4px 8px rgba(34, 163, 92, 0.15),
        0 12px 24px rgba(34, 163, 92, 0.2);
}

/* Beautiful custom dropdown arrow */
.dropdown-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 22px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #22a35c 0%, #1a8249 100%);
    border-radius: 6px;
    z-index: 3;
    pointer-events: none;
    transition: all 0.3s ease;
}

.dropdown-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 28px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid white;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 4;
}

.dropdown-wrapper:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-wrapper:focus-within::before {
    background: linear-gradient(135deg, #1a8249 0%, #22a35c 100%);
    transform: translateY(-50%) scale(1.1);
}

/* Style the selected option */
.pricing-select option {
    padding: 12px;
    background: #fff;
    color: #333;
}

.pricing-select option:checked {
    background: linear-gradient(135deg, #f0fdf5, #e6f9ed);
    font-weight: 600;
}

/* Mobile Selector Card - Modern Design */
.mobile-selector-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.04),
        0 2px 8px rgba(0, 0, 0, 0.06),
        0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Mobile Price Display Card */
.mobile-price-card {
    background: linear-gradient(135deg, #f0fdf5 0%, #dcfce7 100%);
    padding: 20px;
    text-align: center;
    border-top: 1px solid rgba(34, 163, 92, 0.1);
}

.mobile-price-amount {
    font-size: 32px;
    font-weight: 700;
    color: #22a35c;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.mobile-price-unit {
    font-size: 11px;
    color: #999;
    font-weight: 400;
}

/* Selection Summary */
.selection-summary {
    background: linear-gradient(135deg, #f0fdf5, #e6f9ed);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin: 25px 0;
    border: 2px solid #22a35c;
    box-shadow: 0 4px 12px rgba(34, 163, 92, 0.15);
}

.selection-text {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.selection-text strong {
    color: #22a35c;
    font-weight: 700;
}

.selection-text .original-price {
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
    margin-right: 10px;
    font-size: 18px;
}

.selection-text .discounted-price {
    color: #e74c3c;
    font-weight: 700;
    font-size: 22px;
}

.selection-instruction {
    font-size: 16px;
    color: #666;
    margin-top: 10px;
    font-weight: 500;
}

/* Integrated consent checkbox in selection summary */
.selection-consent {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(34, 163, 92, 0.2);
}

.integrated-consent {
    margin: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.integrated-consent .checkbox-text {
    font-size: 13px;
    line-height: 1.5;
    color: #444;
    text-align: left;
    max-width: 600px;
}

.integrated-consent .redasterisk {
    color: #e53e3e;
    font-weight: 700;
}

.selection-instruction i {
    color: #22a35c;
    margin-right: 5px;
}

/* Checkout Form Styles */
.checkout-form-container {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin: 20px 0;
}

.checkout-step {
    margin-bottom: 20px;
}

/* Custom Checkbox */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 15px;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 2px solid #22a35c;
    border-radius: 4px;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #f0fdf5;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #22a35c;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    line-height: 1.5;
}

/* Discount Code Section */
.discount-code-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.discount-link {
    color: #22a35c;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.discount-link i {
    margin-right: 6px;
    font-size: 16px;
}

.discount-link:hover {
    color: #1a8249;
    text-decoration: underline;
}

.discount-input-group {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.discount-input-group input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.discount-input-group input:focus {
    border-color: #22a35c;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 163, 92, 0.1);
}

.btn-apply {
    background: #22a35c;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-apply:hover {
    background: #1a8249;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(34, 163, 92, 0.2);
}

/* Alert Styles */
.discount-alert {
    margin: 0 0 20px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    text-align: left;
}

.discount-alert i {
    margin-right: 10px;
    font-size: 18px;
}

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

.discount-alert.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Payment Options */
.payment-options-container {
    margin-top: 20px;
}

.or-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.or-divider:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.or-divider span {
    background: #fff;
    padding: 0 15px;
    position: relative;
    color: #666;
    font-size: 14px;
}

/* Selection Checkout Row */
.selection-checkout-row {
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Feature Points Box - Right Side */
.feature-points-box {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.feature-point {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    font-size: 15px;
    color: #333;
    line-height: 1.5;
}

.feature-point:last-child {
    margin-bottom: 0;
}

.feature-point i {
    color: #22a35c;
    margin-right: 12px;
    margin-top: 2px;
    font-size: 18px;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .selection-checkout-row {
        margin-top: 20px;
    }

    .feature-points-box {
        margin-top: 20px;
        border-radius: 12px;
    }
}

/* Trust Signals */
.security-badges {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.badge-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.security-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 163, 92, 0.15);
}

.security-badge i {
    font-size: 18px;
    color: #22a35c;
}

.security-badge span {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.selection-checkout-row {
    margin-top: 20px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

/* Additional Content */
.additional-content {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.additional-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.benefits-list {
    margin-top: 20px;
}

.benefits-list .list-group-item {
    border: none;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* Related Products */
.related-products {
    margin-top: 50px;
    padding: 30px 0;
    background: #f8f9fa;
    border-radius: 12px;
}

.related-products h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
}

/* Sticky Mobile CTA */
.sticky-mobile-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 10px 0;
    z-index: 1000;
    display: none;
}

.sticky-mobile-cta .price-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mobile-price {
    font-size: 20px;
    font-weight: 700;
    color: #22a35c;
}

.mobile-unit {
    font-size: 12px;
    color: #666;
}

.mobile-buy-btn {
    background: #22a35c;
    border: none;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
}

/* Form Validation Styles */
.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

/* Responsive Breakpoints */
@media (max-width: 767px) {
    .product-title {
        font-size: 32px;
    }

    .trust-badge-header {
        justify-content: flex-start;
        margin-top: 10px;
    }

    .pricing-cards-container {
        display: none !important;
    }

    .pricing-dropdown-container {
        display: block !important;
    }

    .total-price {
        font-size: 28px;
    }

    .sticky-mobile-cta {
        display: block;
    }

    .checkout-form-container {
        padding: 15px;
    }

    .product-image-container {
        margin-bottom: 15px;
    }

    /* Adjust security badges for mobile */
    .security-badge {
        padding: 6px 10px;
    }

    .security-badge i {
        font-size: 16px;
    }

    .security-badge span {
        font-size: 11px;
    }

    /* Adjust selection summary for mobile */
    .selection-summary {
        padding: 20px 15px;
        margin: 20px 0;
    }

    .selection-text {
        font-size: 18px;
    }

    .selection-instruction {
        font-size: 14px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .pricing-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 20px 12px;
    }
}

@media (min-width: 992px) {
    .pricing-cards-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px 15px;
        max-height: none;
        overflow-y: visible;
    }

    .pricing-dropdown-container {
        display: none !important;
    }

    .main-content-row {
        margin-top: 30px;
    }

    .product-details-column {
        padding-left: 30px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #22a35c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Form Integration Styles for Selection Summary */
.form-divider {
    height: 2px;
    background: linear-gradient(to right, transparent 10%, rgba(34, 163, 92, 0.3) 50%, transparent 90%);
    margin: 25px auto 30px;
    max-width: 60%;
    border-radius: 2px;
}

/* Integrated Checkout Step in Selection Summary */
.selection-summary .checkout-step {
    margin-top: 0;
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: left;
}

.selection-summary .form-group {
    margin-bottom: 20px;
}

.selection-summary .form-group label {
    font-weight: 600;
    font-size: 14px;
    color: #2c5530;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.selection-summary .form-control {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.selection-summary .form-control:hover {
    border-color: #b0b0b0;
}

.selection-summary .form-control:focus {
    border-color: #22a35c;
    box-shadow: 0 0 0 4px rgba(34, 163, 92, 0.1);
    outline: none;
}

.selection-summary .form-control::placeholder {
    color: #a0a0a0;
    font-weight: 400;
}

.selection-summary .btn-primary {
    background: linear-gradient(135deg, #22a35c 0%, #1a8249 100%);
    border: none;
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    font-size: 17px;
    font-weight: 600;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(34, 163, 92, 0.2);
    margin-top: 10px;
}

.selection-summary .btn-primary:hover {
    background: linear-gradient(135deg, #1a8249 0%, #156d3d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(34, 163, 92, 0.3);
}

.selection-summary .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(34, 163, 92, 0.2);
}

.selection-summary .btn-primary i {
    margin-right: 8px;
}

.selection-summary .discount-code-section {
    text-align: left !important;
    margin-bottom: 20px;
}

.selection-summary .discount-link {
    display: inline-block;
    text-align: left !important;
}

.selection-summary .payment-options-container {
    margin-top: 20px;
}

/* Form Validation Styles */
.selection-summary .invalid-feedback,
.selection-summary label.error {
    text-align: left !important;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 6px;
    display: block;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.selection-summary .valid-feedback {
    text-align: left !important;
    color: #27ae60;
    font-size: 13px;
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

.selection-summary .form-control.is-invalid,
.selection-summary .form-control.error {
    border-color: #e74c3c;
    background-color: #fff5f5;
}

.selection-summary .form-control.is-valid {
    border-color: #27ae60;
    background-color: #f0fff4;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.selection-summary .form-text {
    text-align: left !important;
    display: block;
    font-size: 13px;
    color: #6c757d;
    margin-top: 6px;
    font-weight: 400;
}

.selection-summary label {
    text-align: left !important;
    display: block;
}

.selection-summary .form-group {
    text-align: left !important;
}

.selection-summary .form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    text-align: left !important;
}

/* Override center alignment from parent */
.selection-summary .checkout-step {
    text-align: left !important;
}

/* Ensure error labels are left-aligned */
.selection-summary label.error {
    text-align: left !important;
    display: block;
    width: 100%;
}

/* Print Styles */
@media print {
    .sticky-mobile-cta,
    .trust-signals-desktop,
    .trust-signals-mobile,
    .related-products {
        display: none !important;
    }
}