﻿/**
 * Modern Form Style
 *
 * @package RID_COD
 */

/* RTL support for modern form dropdown variations */
.rtl.rid-cod-form-modern.rid-cod-use-dropdown-variations .rid-cod-variations select.rid-cod-variation-select {
    background-position: right 12px center;
    padding-right: 40px;
    padding-left: 16px;
}

/* ========================================
   FORM STYLES - MODERN AND MOBILE VARIANTS
   ======================================== */

/* Modern Form Style - Updated to match the provided image exactly */
.rid-cod-form-modern #rid-cod-checkout {
    background: var(--rid-cod-primary-bg-color);
    border: 2px solid var(--rid-cod-accent-color);
    border-radius: 12px;
    color: var(--rid-cod-text-color);
    box-shadow: 0 4px 15px rgba(var(--rid-cod-accent-color-rgb, 177, 156, 217), 0.15);
    border-top: 2px solid var(--rid-cod-accent-color);
    padding: 25px;
    max-width: 600px;
    margin: 20px auto;
    font-family: 'Cairo', 'Tajawal', Arial, sans-serif;
}

.rid-cod-form-modern .rid-cod-title h3 {
    color: var(--rid-cod-text-color);
    font-size: 16px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 500;
    text-shadow: none;
    line-height: 1.4;
}

.rid-cod-form-modern .rid-cod-customer-info {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 25px;
    backdrop-filter: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.rid-cod-form-modern .rid-cod-field-group {
    margin-bottom: 15px;
    position: relative;
}

.rid-cod-form-modern .rid-cod-field-group input,
.rid-cod-form-modern .rid-cod-field-group select,
.rid-cod-form-modern .rid-cod-field-group textarea {
    border: 1px solid var(--rid-cod-border-color);
    background: var(--rid-cod-primary-bg-color);
    padding: 12px 15px;
    font-size: 14px;
    color: var(--rid-cod-text-color);
    border-radius: 8px;
    transition: border-color 0.3s ease;
    width: 100%;
    height: 48px;
}

.rid-cod-form-modern .rid-cod-field-group input:focus,
.rid-cod-form-modern .rid-cod-field-group select:focus,
.rid-cod-form-modern .rid-cod-field-group textarea:focus {
    border-color: var(--rid-cod-accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--rid-cod-accent-color-rgb, 177, 156, 217), 0.2);
}

.rid-cod-form-modern .rid-cod-actions-row {
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 15px;
    backdrop-filter: none;
    margin-top: 20px;
}

.rid-cod-form-modern #rid-cod-submit-btn {
    background: var(--rid-cod-button-bg-color);
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    color: var(--rid-cod-button-text-color);
    font-weight: 600;
    font-size: 16px;
    box-shadow: none;
    transition: all 0.3s ease;
    flex: 1;
    height: 48px;
    text-transform: uppercase;
}

.rid-cod-form-modern #rid-cod-submit-btn:hover {
    background: var(--rid-cod-accent-color);
    transform: none;
    box-shadow: 0 2px 8px rgba(var(--rid-cod-accent-color-rgb, 177, 156, 217), 0.3);
}

.rid-cod-form-modern .rid-cod-quantity-selector {
    background: var(--rid-cod-primary-bg-color);
    border: 1px solid var(--rid-cod-border-color);
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    box-shadow: none;
    height: 48px;
}

.rid-cod-form-modern .rid-cod-quantity-selector button {
    background: #f8f9fa;
    color: var(--rid-cod-accent-color);
    border: none;
    width: 40px;
    height: 46px;
    border-radius: 0;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.rid-cod-form-modern .rid-cod-quantity-selector button:first-child {
    border-radius: 8px 0 0 8px;
}

.rid-cod-form-modern .rid-cod-quantity-selector button:last-child {
    border-radius: 0 8px 8px 0;
}

.rid-cod-form-modern .rid-cod-quantity-selector button:hover {
    background: #e9ecef;
    transform: none;
}

.rid-cod-form-modern .rid-cod-quantity-selector input {
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    background: white;
    text-align: center;
    width: 50px;
    font-weight: 600;
    color: #333;
    height: 46px;
}

/* Modern Form Variations Styling */
.rid-cod-form-modern .rid-cod-variations {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    margin-bottom: 20px;
}

.rid-cod-form-modern .rid-cod-variations .variations-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rid-cod-form-modern .rid-cod-variations .variation-row {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Modern Form - Variation labels to match image */
.rid-cod-form-modern .rid-cod-variations .variation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 20px;
}

.rid-cod-form-modern .rid-cod-variations .variation-label-text {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    min-width: 60px;
}

.rid-cod-form-modern .rid-cod-variations .variation-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

/* Color variations for modern form — circular swatches (base; size classes override) */
.rid-cod-form-modern .rid-cod-variations .variation-option.color-option {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    margin-left: 5px;
}

.rid-cod-form-modern.rid-cod-variation-size-small .rid-cod-variations .variation-option.color-option,
.rid-cod-form-modern.rid-variation-size-small .rid-cod-variations .variation-option.color-option {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
}

.rid-cod-form-modern.rid-cod-variation-size-medium .rid-cod-variations .variation-option.color-option,
.rid-cod-form-modern.rid-variation-size-medium .rid-cod-variations .variation-option.color-option {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
}

.rid-cod-form-modern.rid-cod-variation-size-large .rid-cod-variations .variation-option.color-option,
.rid-cod-form-modern.rid-variation-size-large .rid-cod-variations .variation-option.color-option {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
}

.rid-cod-form-modern.rid-cod-variation-size-extra-large .rid-cod-variations .variation-option.color-option,
.rid-cod-form-modern.rid-variation-size-extra-large .rid-cod-variations .variation-option.color-option {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
}

.rid-cod-form-modern.rid-cod-variation-size-small .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card),
.rid-cod-form-modern.rid-variation-size-small .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card) {
    min-width: 32px !important;
    min-height: 32px !important;
    font-size: 12px !important;
    padding: 4px 8px !important;
}

.rid-cod-form-modern.rid-cod-variation-size-medium .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card),
.rid-cod-form-modern.rid-variation-size-medium .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card) {
    min-width: 40px !important;
    min-height: 36px !important;
    font-size: 13px !important;
    padding: 6px 10px !important;
}

.rid-cod-form-modern.rid-cod-variation-size-large .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card),
.rid-cod-form-modern.rid-variation-size-large .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card) {
    min-width: 50px !important;
    min-height: 44px !important;
    font-size: 15px !important;
    padding: 8px 12px !important;
}

.rid-cod-form-modern.rid-cod-variation-size-extra-large .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card),
.rid-cod-form-modern.rid-variation-size-extra-large .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card) {
    min-width: 60px !important;
    min-height: 52px !important;
    font-size: 17px !important;
    padding: 10px 14px !important;
}

.rid-cod-form-modern .rid-cod-variations .variation-option.color-option:hover {
    transform: scale(1.1);
    border-color: var(--rid-cod-accent-color);
}

.rid-cod-form-modern .rid-cod-variations .variation-option.color-option.selected {
    border-color: var(--rid-cod-accent-color);
    border-width: 2px;
    box-shadow: 0 0 0 1px rgba(var(--rid-cod-accent-color-rgb, 177, 156, 217), 0.5);
    transform: scale(1.1);
}

/* Size variations for modern form - match image exactly */
.rid-cod-form-modern .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card) {
    min-width: 35px;
    min-height: 35px;
    height: auto;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: var(--rid-cod-primary-bg-color);
    color: var(--rid-cod-text-color);
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    white-space: normal;
    overflow: visible;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
}

.rid-cod-form-modern .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card):hover {
    border-color: var(--rid-cod-accent-color);
    background: #f8f6fc;
    transform: scale(1.05);
}

.rid-cod-form-modern .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card).selected {
    border-color: var(--rid-cod-accent-color);
    background: var(--rid-cod-accent-color);
    color: var(--rid-cod-button-text-color);
    font-weight: 600;
    border-width: 1px;
}

/* Modern Form Order Summary */
.rid-cod-form-modern #rid-cod-summary-wrapper {
    background: #f8f6fc;
    border: 1px solid var(--rid-cod-border-color);
    border-radius: 12px;
    margin-top: 25px;
    overflow: hidden;
}

.rid-cod-form-modern #rid-cod-summary-header {
    background: var(--rid-cod-accent-color);
    color: var(--rid-cod-button-text-color);
    padding: 15px 20px;
    border-bottom: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.rid-cod-form-modern #rid-cod-summary-header:hover {
    background: var(--rid-cod-button-bg-color);
}

.rid-cod-form-modern #rid-cod-summary-header h4 {
    color: var(--rid-cod-button-text-color);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.rid-cod-form-modern #rid-cod-summary-header .rid-icon-cart {
    filter: brightness(0) invert(1);
}

.rid-cod-form-modern #rid-cod-summary-toggle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E");
}

.rid-cod-form-modern #rid-cod-summary-content {
    background: white;
    padding: 20px;
}

.rid-cod-form-modern #rid-cod-summary-content table {
    width: 100%;
}

.rid-cod-form-modern #rid-cod-summary-content td {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
}

.rid-cod-form-modern #rid-cod-summary-content tr:last-child td {
    border-bottom: none;
    padding-top: 15px;
    font-weight: 700;
    color: var(--rid-cod-accent-color);
    font-size: 16px;
}

.rid-cod-form-modern .rid-summary-quantity {
    background: #e9ecef;
    color: #333;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
}

/* Modern Form - Delivery type in summary */
.rid-cod-form-modern .summary-delivery-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rid-cod-form-modern .summary-delivery-option {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    width: 100%;
}

.rid-cod-form-modern .summary-delivery-option:hover {
    border-color: var(--rid-cod-accent-color);
    background: rgba(177, 156, 217, 0.1);
}

.rid-cod-form-modern .summary-delivery-option input[type="radio"] {
    display: none;
}

.rid-cod-form-modern .summary-delivery-option .summary-radio-custom {
    width: 14px;
    height: 14px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.rid-cod-form-modern .summary-delivery-option input[type="radio"]:checked + .summary-radio-custom {
    border-color: var(--rid-cod-accent-color);
    background: var(--rid-cod-accent-color);
}

.rid-cod-form-modern .summary-delivery-option input[type="radio"]:checked + .summary-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}

.rid-cod-form-modern .summary-delivery-option .summary-delivery-text {
    font-weight: 500;
    color: #333;
}

/* Modern Form - Hide icons in inputs */
.rid-cod-form-modern .rid-input-icon {
    display: none !important;
}

/* Modern Form - Adjust input padding without icons */
.rid-cod-form-modern .rid-cod-field-group input,
.rid-cod-form-modern .rid-cod-field-group select {
    padding: 12px 15px !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
}

/* Modern Form - Fix phone field RTL alignment */
.rid-cod-form-modern .rid-cod-field-group input[type="tel"] {
    direction: rtl !important;
    text-align: right !important;
}

.rid-cod-form-modern .rid-cod-field-group input[type="tel"]::placeholder {
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: plaintext !important;
}

/* Modern Form - Fix placeholder visibility */
.rid-cod-form-modern .rid-cod-field-group input::placeholder {
    color: #999 !important;
    opacity: 1 !important;
    font-weight: 400 !important;
    transition: none !important;
}

/* Modern Form - Ensure placeholder stays visible */
.rid-cod-form-modern .rid-cod-field-group input:focus::placeholder {
    color: #ccc !important;
    opacity: 1 !important;
}

/* Modern Form - Override any conflicting styles */
.rid-cod-form-modern .rid-cod-field-group {
    position: relative;
}

.rid-cod-form-modern .rid-cod-field-group input {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #333 !important;
    width: 100% !important;
    height: 48px !important;
    box-sizing: border-box !important;
}

/* Modern Form - Remove floating labels on inputs only (keep delivery type labels) */
.rid-cod-form-modern .rid-cod-field-group:not(.rid-cod-delivery-section) label {
    display: none !important;
}

/* Modern Form - Ensure no label animations */
.rid-cod-form-modern .rid-cod-field-group input:focus + label,
.rid-cod-form-modern .rid-cod-field-group input:not(:placeholder-shown) + label {
    display: none !important;
}

/* Modern Form - Remove any floating label styles */
.rid-cod-form-modern .floating-label {
    display: none !important;
}

/* Modern Form - Ensure placeholders are always visible */
.rid-cod-form-modern .rid-cod-field-group input::-webkit-input-placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

.rid-cod-form-modern .rid-cod-field-group input::-moz-placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

.rid-cod-form-modern .rid-cod-field-group input:-ms-input-placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

.rid-cod-form-modern .rid-cod-field-group input:-moz-placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

/* Modern Form - Special styling for select dropdowns */
.rid-cod-form-modern .rid-cod-field-group select,
.rid-cod-form-modern.rid-cod-use-dropdown-variations .rid-cod-variations select.rid-cod-variation-select {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="%23b19cd9" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Modern Form - Delivery section removed from top, now in summary */

/* Modern Form - Delivery type options in summary */
.rid-cod-form-modern .summary-delivery-options {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
}

.rid-cod-form-modern .summary-delivery-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    gap: 6px;
}

.rid-cod-form-modern .summary-delivery-option input[type="radio"] {
    display: none;
}

.rid-cod-form-modern .summary-radio-custom {
    width: 14px;
    height: 14px;
    border: 1px solid var(--rid-cod-accent-color);
    border-radius: 50%;
    position: relative;
    background: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rid-cod-form-modern .summary-delivery-option input[type="radio"]:checked + .summary-radio-custom {
    background: var(--rid-cod-accent-color);
}

.rid-cod-form-modern .summary-delivery-option input[type="radio"]:checked + .summary-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.rid-cod-form-modern .summary-delivery-text {
    font-weight: 500;
    color: #333;
    font-size: 12px;
}

/* Modern Form - Enhanced summary delivery section */
.rid-cod-form-modern #rid-cod-summary-content #rid-cod-summary-delivery-type-row {
    background: #f8f6fc;
    border-radius: 6px;
}

.rid-cod-form-modern #rid-cod-summary-content #rid-cod-summary-delivery-type-row td {
    padding: 15px 12px;
    border-bottom: none;
}

.rid-cod-form-modern #rid-cod-summary-content #rid-cod-summary-delivery-type-row td:first-child {
    font-weight: 600;
    color: var(--rid-cod-accent-color);
}

/* Modern Form - Hover effects for delivery options in summary */
.rid-cod-form-modern .summary-delivery-option:hover .summary-radio-custom {
    border-color: var(--rid-cod-button-bg-color);
    transform: scale(1.1);
}

.rid-cod-form-modern .summary-delivery-option:hover .summary-delivery-text {
    color: var(--rid-cod-accent-color);
}

/* Modern Form - Notes field styling */
.rid-cod-form-modern .rid-cod-field-group textarea {
    grid-column: 1 / -1;
    height: 80px;
    resize: vertical;
    padding: 12px 15px;
}

/* Modern Form - Additional styling for perfect match */
.rid-cod-form-modern .rid-cod-field-group input::placeholder,
.rid-cod-form-modern .rid-cod-field-group select option:first-child {
    color: #999;
    font-weight: 400;
}

.rid-cod-form-modern .rid-cod-field-group input:focus::placeholder {
    color: #ccc;
}

/* Modern Form - Variation section spacing */
.rid-cod-form-modern .rid-cod-variations {
    margin: 20px 0;
    padding: 0;
    border: none;
}

/* Modern Form - Better spacing for variation rows */
.rid-cod-form-modern .rid-cod-variations .variation-row:not(:last-child) {
    margin-bottom: 20px;
}

/* Modern Form - Improve color swatch visibility */
.rid-cod-form-modern .rid-cod-variations .variation-option.color-option .color-swatch {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Modern Form - Better button styling */
.rid-cod-form-modern #rid-cod-submit-btn {
    font-family: inherit;
    letter-spacing: 0.5px;
}

/* Modern Form - Ensure proper RTL layout */
.rid-cod-form-modern .rid-cod-variations .variation-boxes {
    direction: rtl;
}

.rid-cod-form-modern .rid-cod-variations .variation-option {
    margin-left: 8px;
    margin-right: 0;
}

.rid-cod-form-modern .rid-cod-variations .variation-option:last-child {
    margin-left: 0;
}

/* Modern Form - Dropdown variations styling */
.rid-cod-form-modern.rid-cod-use-dropdown-variations .rid-cod-variations select.rid-cod-variation-select {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 16px;
    padding-left: 40px;
    font-size: 15px;
    font-weight: 500;
    color: #495057;
    background-color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.rid-cod-form-modern.rid-cod-use-dropdown-variations .rid-cod-variations select.rid-cod-variation-select:focus {
    border-color: var(--rid-cod-accent-color);
    box-shadow: 0 0 0 3px rgba(var(--rid-cod-accent-color-rgb, 177, 156, 217), 0.15);
    outline: none;
}

.rid-cod-form-modern.rid-cod-use-dropdown-variations .rid-cod-variations select.rid-cod-variation-select:hover {
    border-color: #ced4da;
    background-color: #f8f9fa;
}

.rid-cod-form-modern.rid-cod-use-dropdown-variations .rid-cod-variations .variation-label {
    margin-bottom: 12px;
}

.rid-cod-form-modern.rid-cod-use-dropdown-variations .rid-cod-variations .attribute-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

/* Modern form - disabled options styling */
.rid-cod-form-modern.rid-cod-use-dropdown-variations .rid-cod-variations select.rid-cod-variation-select option:disabled {
    color: #999 !important;
    background-color: #f8f9fa !important;
    font-style: italic;
}

.rid-cod-form-modern.rid-cod-use-dropdown-variations .rid-cod-variations select.rid-cod-variation-select.has-disabled-options {
    border-color: #ffc107;
    background-color: #fffbf0;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.1);
}

.rid-cod-form-modern.rid-cod-use-dropdown-variations .rid-cod-variations select.rid-cod-variation-select.has-disabled-options:focus {
    border-color: var(--rid-cod-accent-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(var(--rid-cod-accent-color-rgb, 177, 156, 217), 0.15);
}

/* Modern Form - Perfect color matching */
.rid-cod-form-modern #rid-cod-checkout {
    border-color: var(--rid-cod-accent-color);
}

.rid-cod-form-modern .rid-cod-field-group input:focus,
.rid-cod-form-modern .rid-cod-field-group select:focus {
    border-color: var(--rid-cod-accent-color);
    box-shadow: 0 0 0 2px rgba(var(--rid-cod-accent-color-rgb, 177, 156, 217), 0.15);
}

.rid-cod-form-modern .rid-cod-variations .variation-option.color-option.selected,
.rid-cod-form-modern .rid-cod-variations .variation-option:not(.color-option):not(.variation-offer-card).selected {
    border-color: var(--rid-cod-accent-color);
}

.rid-cod-form-modern #rid-cod-summary-header {
    background-color: var(--rid-cod-accent-color);
}

.rid-cod-form-modern #rid-cod-summary-content tr:last-child td {
    color: var(--rid-cod-accent-color);
}

/* Modern Form - Final touches for exact match */
.rid-cod-form-modern .rid-cod-field-group select {
    color: #333;
    font-weight: 500;
}

.rid-cod-form-modern .rid-cod-field-group select option {
    color: #333;
    background: white;
}

.rid-cod-form-modern .rid-cod-variations .variation-label .attribute-label {
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

/* Modern Form - Ensure consistent spacing */
.rid-cod-form-modern .rid-cod-customer-info .rid-cod-field-group:nth-child(3),
.rid-cod-form-modern .rid-cod-customer-info .rid-cod-field-group:nth-child(4) {
    margin-top: 5px;
}

/* Modern Form - Perfect color swatches */
.rid-cod-form-modern .rid-cod-variations .variation-option.color-option {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rid-cod-form-modern .rid-cod-variations .variation-option.color-option.selected {
    box-shadow: 0 0 0 2px var(--rid-cod-accent-color), 0 2px 8px rgba(var(--rid-cod-accent-color-rgb, 177, 156, 217), 0.3);
}

/* Modern Form - Enhanced summary styling */
.rid-cod-form-modern #rid-cod-summary-content .rid-summary-variation-details {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rid-cod-form-modern #rid-cod-summary-content .variation-detail {
    background: #f8f6fc;
    color: var(--rid-cod-accent-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e9e4f0;
}

/* Modern Form - Delivery type options in summary */
.rid-cod-form-modern #rid-cod-summary-content #summary-delivery-type-row td {
    color: #666;
    font-size: 13px;
}

.rid-cod-form-modern .summary-delivery-options {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
}

.rid-cod-form-modern .summary-delivery-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    gap: 6px;
}

.rid-cod-form-modern .summary-delivery-option input[type="radio"] {
    display: none;
}

.rid-cod-form-modern .summary-radio-custom {
    width: 14px;
    height: 14px;
    border: 1px solid var(--rid-cod-accent-color);
    border-radius: 50%;
    position: relative;
    background: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rid-cod-form-modern .summary-delivery-option input[type="radio"]:checked + .summary-radio-custom {
    background: var(--rid-cod-accent-color);
}

.rid-cod-form-modern .summary-delivery-option input[type="radio"]:checked + .summary-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.rid-cod-form-modern .summary-delivery-text {
    font-weight: 500;
    color: #333;
    font-size: 12px;
}

/* Modern Form - Enhanced summary delivery section */
.rid-cod-form-modern #rid-cod-summary-content #summary-delivery-type-row {
    background: #f8f6fc;
    border-radius: 6px;
}

.rid-cod-form-modern #rid-cod-summary-content #summary-delivery-type-row td {
    padding: 15px 12px;
    border-bottom: none;
}

.rid-cod-form-modern #rid-cod-summary-content #summary-delivery-type-row td:first-child {
    font-weight: 600;
    color: var(--rid-cod-accent-color);
}

/* Modern Form - Hover effects for delivery options in summary */
.rid-cod-form-modern .summary-delivery-option:hover .summary-radio-custom {
    border-color: var(--rid-cod-button-bg-color);
    transform: scale(1.1);
}

.rid-cod-form-modern .summary-delivery-option:hover .summary-delivery-text {
    color: var(--rid-cod-accent-color);
}

/* Modern Form - Better spacing for variation sections */
.rid-cod-form-modern .rid-cod-variations .variation-row {
    margin-bottom: 15px;
    padding-bottom: 0;
    border-bottom: none;
}

.rid-cod-form-modern .rid-cod-variations .variation-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Modern Form - Animation effects */
.rid-cod-form-modern .variation-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rid-cod-form-modern .variation-option:hover {
    transform: translateY(-2px);
}

.rid-cod-form-modern .variation-option.selected {
    animation: selectPulse 0.3s ease-out;
}

@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Modern Form - Enhanced delivery options in main form */
.rid-cod-form-modern .rid-cod-delivery-section {
    background: linear-gradient(135deg, #f8f6fc 0%, #f0ebf8 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(177, 156, 217, 0.2);
}

.rid-cod-form-modern .rid-cod-delivery-section .delivery-label {
    color: var(--rid-cod-accent-color);
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.rid-cod-form-modern .rid-delivery-options {
    justify-content: center;
    gap: 25px;
    display: flex;
    flex-wrap: wrap;
}

.rid-cod-form-modern .delivery-option {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.rid-cod-form-modern .delivery-option:hover {
    border-color: var(--rid-cod-accent-color);
    background: rgba(177, 156, 217, 0.05);
}

.rid-cod-form-modern .delivery-option input[type="radio"] {
    display: none;
}

.rid-cod-form-modern .delivery-option .radio-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.rid-cod-form-modern .delivery-option input[type="radio"]:checked + .radio-custom {
    border-color: var(--rid-cod-accent-color);
    background: var(--rid-cod-accent-color);
}

.rid-cod-form-modern .delivery-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.rid-cod-form-modern .delivery-option .delivery-text {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.rid-cod-form-modern .rid-delivery-options .delivery-option {
    background: white;
    border: 2px solid rgba(177, 156, 217, 0.3);
    border-radius: 10px;
    padding: 12px 18px;
    box-shadow: 0 2px 8px rgba(177, 156, 217, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.rid-cod-form-modern .rid-delivery-options .delivery-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(177, 156, 217, 0.1), transparent);
    transition: left 0.5s ease;
}

.rid-cod-form-modern .rid-delivery-options .delivery-option:hover::before {
    left: 100%;
}

.rid-cod-form-modern .rid-delivery-options .delivery-option:hover {
    border-color: var(--rid-cod-accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(177, 156, 217, 0.2);
}

.rid-cod-form-modern .rid-delivery-options .delivery-option input[type="radio"]:checked + .radio-custom {
    background: var(--rid-cod-accent-color);
    border-color: var(--rid-cod-accent-color);
    box-shadow: 0 0 0 3px rgba(177, 156, 217, 0.2);
}

.rid-cod-form-modern .rid-delivery-options .delivery-text {
    font-weight: 600;
    font-size: 13px;
}

/* Modern Form - Summary update animation */
.rid-cod-form-modern #rid-cod-summary-content .variation-detail {
    animation: fadeInUp 0.3s ease-out;
}

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

/* Modern Form - Responsive adjustments */
@media (max-width: 768px) {
    .rid-cod-form-modern #rid-cod-checkout {
        margin: 0;
        padding: 15px;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .rid-cod-form-modern .rid-cod-customer-info {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
        border-radius: 10px;
    }

    .rid-cod-form-modern .rid-cod-actions-row {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
        border-radius: 10px;
    }

    .rid-cod-form-modern .rid-cod-quantity {
        order: 1;
        justify-self: center;
    }

    .rid-cod-form-modern .rid-cod-submit {
        order: 2;
    }

    .rid-cod-form-modern .rid-cod-variations .variation-boxes {
        justify-content: center;
    }

    /* Fix summary table on mobile */
    .rid-cod-form-modern #rid-cod-summary-content {
        padding: 15px;
        overflow-x: auto;
    }

    .rid-cod-form-modern #rid-cod-summary-content table {
        width: 100%;
        border-collapse: collapse;
    }

    .rid-cod-form-modern #rid-cod-summary-content td {
        padding: 10px 5px;
        font-size: 13px;
        border-bottom: 1px solid #f0f0f0;
        word-wrap: break-word;
        vertical-align: top;
    }

    .rid-cod-form-modern #rid-cod-summary-content td:first-child {
        width: 60%;
        padding-right: 10px;
    }

    .rid-cod-form-modern #rid-cod-summary-content td:last-child {
        width: 40%;
        text-align: left;
        padding-left: 10px;
    }

    /* Delivery options responsive */
    .rid-cod-form-modern .rid-delivery-options {
        flex-direction: column;
        gap: 10px;
    }

    .rid-cod-form-modern .delivery-option {
        min-width: auto;
        width: 100%;
        justify-content: flex-start;
        padding: 15px;
    }

    .rid-cod-form-modern .summary-delivery-options {
        flex-direction: column;
        gap: 8px;
    }

    .rid-cod-form-modern .summary-delivery-option {
        width: 100%;
        justify-content: flex-start;
        padding: 10px;
    }

    /* Fix summary header */
    .rid-cod-form-modern #rid-cod-summary-header {
        padding: 15px;
    }

    .rid-cod-form-modern #rid-cod-summary-header h4 {
        font-size: 14px;
        margin: 0;
    }
}

/* Additional responsive fixes for modern form */
@media (max-width: 768px) {
    .rid-cod-form-modern #rid-cod-checkout {
        margin: 0 !important;
        padding: 15px;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        box-shadow: 0 2px 10px rgba(var(--rid-cod-accent-color-rgb, 177, 156, 217), 0.1);
    }

    .rid-cod-form-modern .rid-cod-customer-info {
        padding: 15px;
        border-radius: 10px;
        margin-bottom: 15px;
    }

    .rid-cod-form-modern .rid-cod-actions-row {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        border-radius: 10px;
    }

    .rid-cod-form-modern #rid-cod-submit-btn {
        width: 100%;
        padding: 15px;
        font-size: 15px;
    }

    /* Fix summary wrapper on mobile */
    .rid-cod-form-modern #rid-cod-summary-wrapper {
        margin: 15px 0;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    /* Remove problematic borders and lines */
    .rid-cod-form-modern #rid-cod-summary-content table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .rid-cod-form-modern #rid-cod-summary-content tr {
        border: none;
    }

    .rid-cod-form-modern #rid-cod-summary-content td {
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: 1px solid #f5f5f5;
        padding: 12px 8px;
    }

    .rid-cod-form-modern #rid-cod-summary-content tr:last-child td {
        border-bottom: none;
        font-weight: 700;
        color: var(--rid-cod-accent-color);
        padding-top: 15px;
    }

    /* Improve text wrapping */
    .rid-cod-form-modern .product-name {
        font-size: 13px;
        line-height: 1.3;
        word-break: break-word;
    }

    .rid-cod-form-modern .rid-summary-variation-details {
        font-size: 11px;
        margin-top: 5px;
        line-height: 1.2;
    }

    .floating-label {
        right: 10px;
        top: 12px;
    }

    .floating-label.active {
        top: -6px;
        font-size: 11px;
    }
}

/* Modern Form - Delivery Section (Fixed to match basic structure) */
.rid-cod-form-modern .rid-cod-delivery-section {
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8f6fc 0%, #f0ebf8 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(177, 156, 217, 0.2);
    box-shadow: 0 2px 8px rgba(177, 156, 217, 0.1);
    transition: all 0.3s ease;
}

.rid-cod-form-modern .rid-cod-delivery-section:hover {
    box-shadow: 0 4px 16px rgba(177, 156, 217, 0.15);
    border-color: rgba(177, 156, 217, 0.3);
}

.rid-cod-form-modern .rid-cod-delivery-section .delivery-label {
    display: block !important;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--rid-cod-accent-color);
    font-size: 15px;
    text-align: center;
}

.rid-cod-form-modern .rid-delivery-options {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.rid-cod-form-modern .rid-delivery-options .delivery-option {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--rid-cod-text-color);
    padding: 12px 16px;
    border: 2px solid rgba(177, 156, 217, 0.3);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f6fc 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 140px;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(177, 156, 217, 0.1);
}

.rid-cod-form-modern .rid-delivery-options .delivery-option:hover {
    border-color: var(--rid-cod-accent-color);
    background: linear-gradient(135deg, #f0ebf8 0%, #e6dff5 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(177, 156, 217, 0.2);
}

.rid-cod-form-modern .rid-delivery-options .delivery-option input[type="radio"] {
    display: none;
}

.rid-cod-form-modern .rid-delivery-options .radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(177, 156, 217, 0.5);
    border-radius: 50%;
    position: relative;
    background: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.rid-cod-form-modern .rid-delivery-options .delivery-option input[type="radio"]:checked + .radio-custom {
    border-color: var(--rid-cod-accent-color);
    background: var(--rid-cod-accent-color);
    box-shadow: 0 0 0 3px rgba(177, 156, 217, 0.2);
}

.rid-cod-form-modern .rid-delivery-options .delivery-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.rid-cod-form-modern .rid-delivery-options .delivery-option input[type="radio"]:checked ~ .delivery-text {
    color: var(--rid-cod-accent-color);
    font-weight: 700;
}

.rid-cod-form-modern .rid-delivery-options .delivery-text {
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
}

.rid-cod-form-modern .rid-delivery-options .delivery-option.selected {
    border-color: var(--rid-cod-accent-color);
    background: linear-gradient(135deg, #f0ebf8 0%, #e6dff5 100%);
    box-shadow: 0 4px 16px rgba(177, 156, 217, 0.25);
    transform: translateY(-1px);
}

.rid-cod-form-modern .rid-delivery-options .delivery-option.selected .delivery-text {
    color: var(--rid-cod-accent-color);
    font-weight: 700;
}

/* Modern Form - Animation for delivery option selection */
.rid-cod-form-modern .rid-delivery-options .delivery-option.just-selected {
    animation: modernSelectPulse 0.4s ease-out;
}

@keyframes modernSelectPulse {
    0% { 
        transform: scale(1) translateY(0); 
        box-shadow: 0 2px 4px rgba(177, 156, 217, 0.1);
    }
    50% { 
        transform: scale(1.05) translateY(-3px); 
        box-shadow: 0 8px 20px rgba(177, 156, 217, 0.3);
    }
    100% { 
        transform: scale(1) translateY(-1px); 
        box-shadow: 0 4px 16px rgba(177, 156, 217, 0.25);
    }
}

/* Modern Form - Responsive delivery options */
@media (max-width: 768px) {
    .rid-cod-form-modern .rid-cod-delivery-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .rid-cod-form-modern .rid-delivery-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .rid-cod-form-modern .rid-delivery-options .delivery-option {
        width: 100%;
        min-width: auto;
        justify-content: flex-start;
        padding: 15px;
    }
}

