/**
 * Gift Box Frontend CSS
 * File: assets/css/frontend.css
 */

/* Basic Styles */
:root {
    --primary-green: #007203;
    --light-green: #EAF2DD;
    --gray-dark: #1C1A19;
    --font-title: 'Trirong', serif;
    --font-body: "Poppins", sans-serif;
    --font-size-base: 1rem;
}
.gift-box-form {
    max-width: 100%;
    margin: 20px 0;
}

/* Product Selection Section */
.gift-box-products-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    width: 100%;
}

.gift-box-products-section h3, .gift-box-message-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--gray-dark);
}

.gift-box-selected-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.selected-count-display {
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 400;
    color: #54595F;
}

.gift-box-count {
    color: var(--primary-green);
    font-size: 1.3em;
    font-weight: bold;
}

.gift-box-select-btn {
    padding: 13px 30px;
    font-family: "Trirong";
    background-color: #fff;
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.gift-box-select-btn:hover {
    background: var(--primary-green);
    color: #fff;
	border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.gift-box-selected-items {
    display: none;
    padding: 15px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #fff;
}

.selected-list {
    color: #555;
    line-height: 1.8;
}

/* Modal Styles */
.gift-box-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.gift-box-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.gift-box-modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    margin: 5vh auto;
    background: #fff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.gift-box-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #eee;
    background: #f9f9f9;
    border-radius: 10px 10px 0 0;
}

.modal-counter {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.modal-counter .modal-count {
    color: #e74c3c;
    font-size: 1.3em;
}

.modal-counter.complete {
    color: var(--primary-green);
}

.modal-counter.complete .modal-count {
    color: var(--primary-green);
}

.gift-box-modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 35px;
    height: 35px;
    transition: color 0.3s;
}

.gift-box-modal-close:hover {
    color: #333;
}

.gift-box-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
}

.gift-box-products-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Product Row */
.gift-box-product-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
}

.gift-box-product-row:hover {
    border-color: #2c3e50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gift-box-product-row.selected {
    border-color: var(--primary-green);
    background: #f0fff4;
}

.product-row-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.product-row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.product-row-info {
    flex: 1;
    min-width: 0;
}

.product-row-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    color: #333;
}

.product-row-desc {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.product-row-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.product-qty-display {
    font-size: 1.3em;
    font-weight: bold;
    color: #2c3e50;
    min-width: 30px;
    text-align: center;
}

.product-add-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-green);
    border: none;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.product-add-btn:hover {
    background: #229954;
    transform: scale(1.1);
}

.product-add-btn.disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.product-remove-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #e74c3c;
    border: none;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.product-remove-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.minus-icon {
    line-height: 1;
}

.plus-icon {
    line-height: 1;
}

.gift-box-modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #eee;
    background: #f9f9f9;
    border-radius: 0 0 10px 10px;
    text-align: center;
}

.gift-box-modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #eee;
    background: #f9f9f9;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.gift-box-scroll-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #95a5a6;
    border: none;
    color: #fff;
    font-size: 1.8em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
}

.gift-box-scroll-btn:hover {
    background: #7f8c8d;
    transform: scale(1.1);
}

.gift-box-scroll-btn:active {
    transform: scale(0.95);
}

.gift-box-done-btn {
    padding: 12px 40px;
    background: var(--primary-green);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.gift-box-done-btn {
    padding: 12px 40px;
    background: var(--primary-green);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.gift-box-done-btn:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.gift-box-done-btn.disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Message Section */
.gift-box-message-section {
    width: 100%;
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;

}

/* .gift-box-message-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #333;
} */

.gift-box-message-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #fff;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.gift-box-message-input:focus {
    outline: none;
    border-color: var(--primary-green);
}

.gift-box-char-count {
    text-align: right;
    font-size: 1rem;
    color: #666;
    margin-top: 8px;
}

.gift-box-char-count .current-count {
    font-weight: bold;
    color: var(--primary-green);
}

/* Error Message */
.gift-box-error-message {
    padding: 12px 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    color: #721c24;
    margin-bottom: 15px;
    font-weight: 500;
}

/* Add to Cart Button */
.single_add_to_cart_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Body lock when modal open */
body.gift-box-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .gift-box-modal-content {
        width: 95%;
        margin: 2vh auto;
        max-height: 96vh;
    }
    
    .gift-box-selected-summary {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gift-box-select-btn {
        width: 100%;
    }
    
    .product-row-image {
        width: 60px;
        height: 60px;
    }
    
    .product-row-info h4 {
        font-size: 1em;
    }
    
    .product-row-desc {
        font-size: 0.85em;
    }
}