/* Gift Wrapping Container */
.gift-wrapping-container {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Title Styling */
.gift-wrapping-title {
    color: #E93F33;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-align: left;
    border-bottom: 2px solid #E93F33;
    padding-bottom: 10px;
}

/* Options Container */
.gift-wrapping-options {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

/* Single vs Multiple Options Layout */
.gift-wrapping-options.single-option {
    grid-template-columns: 1fr;
    max-width: 100%;
    justify-items: center;
}

.gift-wrapping-options.single-option .gift-option-card {
    max-width: 400px;
    width: 100%;
}

.gift-wrapping-options.multiple-options {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Gift Option Card */
.gift-option-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
    cursor: pointer;
}

.gift-option-card:hover {
    border-color: #E93F33;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(233, 63, 51, 0.2);
}

/* Selected State */
.gift-option-card:has(input:checked) {
    border-color: #E93F33;
    background: #fff5f5;
}

/* Gift Option Image */
.gift-option-image {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    background: #f8f8f8;
}

.gift-option-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gift-option-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 14px;
}

/* Gift Option Details */
.gift-option-details {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Price Styling */
.gift-option-price {
    font-size: 18px;
    font-weight: bold;
    color: #E93F33;
    text-align: right;
    flex: 1;
}

/* Radio Button Styling */
.gift-option-radio {
    margin-left: 15px;
}

.gift-option-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
    accent-color: #E93F33;
}

.gift-option-radio label {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

/* Action Buttons */
.gift-wrapping-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.gift-wrapping-options.single-option + .gift-wrapping-actions {
    justify-content: center;
}

.apply-gift-wrapping-btn,
.remove-gift-wrapping-btn {
    background-color: #E93F33;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.apply-gift-wrapping-btn:hover:not(:disabled),
.remove-gift-wrapping-btn:hover {
    background-color: #d32f23;
    transform: translateY(-1px);
}

.apply-gift-wrapping-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Status Message Area */
.gift-wrapping-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.gift-wrapping-status .status-message {
    padding: 8px;
    border-radius: 4px;
    font-weight: 600;
}

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

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

/* Applied Gift Wrapping Status */
.gift-wrapping-applied {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e8 0%, #d4f4dd 100%);
    border: 1px solid #c3e6cb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gift-wrapping-applied h4 {
    margin: 0 0 20px 0;
    color: #E93F33;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wrapped-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wrapped-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.wrapped-item:hover {
    border-color: #E93F33;
    box-shadow: 0 4px 12px rgba(233, 63, 51, 0.1);
    transform: translateY(-1px);
}

.item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-right: 15px;
}

.item-name {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
    color: #333;
    margin-right: 15px;
}

.item-price {
    font-weight: bold;
    font-size: 16px;
    color: #E93F33;
    min-width: 80px;
    text-align: right;
}

.remove-single-item-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
    margin-left: 10px;
}

.remove-single-item-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Cart Totals Integration */
.cart_totals .gift-wrapping-container {
    margin: 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
}

.cart_totals .gift-wrapping-title {
    font-size: 16px;
    margin-bottom: 15px;
}

/* Cart Totals Right Alignment - Gift Wrapping Fee */
.cart_totals tr.fee td {
    text-align: right !important;
    font-weight: bold !important;
}

.cart_totals tr.fee th {
    text-align: left;
}

/* Specific for Gift Wrapping fee */
.cart_totals tr.fee td .woocommerce-Price-amount {
    font-weight: bold;
    color: #E93F33;
}

/* Modal Styles */
.gift-wrapping-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

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

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

.modal-header h4 {
    margin: 0;
    color: #E93F33;
    font-size: 18px;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.close-modal:hover {
    color: #E93F33;
}

.modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.cart-items-list {
    margin-top: 15px;
}

.cart-item-option {
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.cart-item-option:hover {
    background-color: #f9f9f9;
}

.cart-item-option input[type="checkbox"] {
    margin-right: 10px;
    accent-color: #E93F33;
}

.cart-item-option label {
    cursor: pointer;
    flex: 1;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.confirm-selection-btn {
    background-color: #E93F33;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.confirm-selection-btn:hover {
    background-color: #d32f23;
}

.cancel-selection-btn {
    background-color: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.cancel-selection-btn:hover {
    background-color: #f5f5f5;
}

/* Checkout Page Styling */
.gift-wrapping-checkout {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #E93F33;
}

.gift-wrapping-checkout h3 {
    color: #E93F33;
    margin: 0 0 10px 0;
    font-size: 16px;
}

/* Order Complete & Details Styling */
.gift-wrapping-order-complete,
.gift-wrapping-order-details,
.gift-wrapping-admin-order {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border: 1px solid #E93F33;
}

.gift-wrapping-order-complete h3,
.gift-wrapping-order-details h3,
.gift-wrapping-admin-order h4 {
    color: #E93F33;
    margin: 0 0 10px 0;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .gift-wrapping-container {
        margin: 15px 0;
        padding: 15px;
    }
    
    .gift-wrapping-title {
        font-size: 16px;
        text-align: center;
    }
    
    .gift-wrapping-options.multiple-options {
        grid-template-columns: 1fr;
    }
    
    .gift-wrapping-options.single-option .gift-option-card {
        max-width: 100%;
    }
    
    .gift-option-image {
        height: 180px;
    }
    
    .gift-wrapping-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .apply-gift-wrapping-btn,
    .remove-gift-wrapping-btn {
        width: 100%;
        min-width: auto;
        max-width: 300px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .gift-option-details {
        padding: 12px;
    }
    
    .gift-option-price {
        font-size: 16px;
    }
    
    /* Mobile specific fixes for wrapped items */
    .gift-wrapping-applied {
        padding: 15px;
    }
    
    .gift-wrapping-applied h4 {
        font-size: 16px;
        line-height: 1.3;
        letter-spacing: 0;
    }
    
    .wrapped-item {
        padding: 12px 15px;
        flex-wrap: nowrap;
    }
    
    .item-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .item-name {
        font-size: 14px;
        margin-right: 0;
        margin-bottom: 5px;
        word-break: break-word;
    }
    
    .item-price {
        font-size: 14px;
        min-width: auto;
        text-align: left;
    }
    
    .remove-single-item-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
        margin-left: 10px;
    }
}

@media (max-width: 480px) {
    .gift-wrapping-title {
        font-size: 15px;
    }
    
    .gift-option-image {
        height: 160px;
    }
    
    .gift-option-details {
        padding: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .gift-option-radio {
        margin-left: 0;
        width: 100%;
        display: flex;
        align-items: center;
    }
    
    .gift-option-price {
        width: 100%;
        text-align: left;
        font-size: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .confirm-selection-btn,
    .cancel-selection-btn {
        width: 100%;
    }
    
    /* Extra small mobile fixes */
    .wrapped-item {
        padding: 10px 12px;
    }
    
    .item-name {
        font-size: 13px;
    }
    
    .item-price {
        font-size: 13px;
    }
}

/* Cart Totals Right Alignment - Gift Wrapping Fee */
.cart_totals tr.fee td {
    text-align: right !important;
}

.cart_totals tr.fee th {
    text-align: left;
}

/* Specific styling for Gift Wrapping fee amount */
.cart_totals tr.fee td .woocommerce-Price-amount {
    font-weight: bold;
    color: #E93F33;
    font-size: 1.1em;
}

/* Additional styling for cart table fee rows */
.woocommerce-cart .cart_totals tr.fee td,
.woocommerce-checkout .cart_totals tr.fee td {
    text-align: right !important;
}

.woocommerce-cart .cart_totals tr.fee td .amount,
.woocommerce-checkout .cart_totals tr.fee td .amount {
    font-weight: bold !important;
    color: #E93F33 !important;
}

/* Ensure proper alignment in both cart and checkout */
table.shop_table tr.fee td {
    text-align: right !important;
}

table.shop_table tr.fee td .woocommerce-Price-amount {
    font-weight: bold !important;
    display: inline-block;
}

/* Force alignment for WooCommerce cart totals */
.cart-collaterals .cart_totals tr.fee td {
    text-align: right !important;
}

.cart-collaterals .cart_totals tr.fee td span.amount {
    font-weight: bold !important;
    color: #E93F33 !important;
    font-size: 1.1em !important;
}