/**
 * GiftCard Module - Frontend Styles
 * @author diseñotiendaonline.es
 */

/* =============================================
   PRODUCT PAGE - Gift Card Options
   ============================================= */

.giftcard-options-wrapper {
    margin: 20px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.giftcard-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.05), rgba(236, 72, 153, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(107, 70, 193, 0.1);
}

.giftcard-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.giftcard-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 8px 0 4px;
}

.giftcard-subtitle {
    font-size: 13px;
    color: #666;
    margin: 0;
}

/* Type Selector */
.giftcard-type-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.giftcard-type-option {
    flex: 1;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.giftcard-type-option input[type="radio"] {
    display: none;
}

.giftcard-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    text-align: center;
}

.giftcard-type-card:hover {
    border-color: #6B46C1;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 70, 193, 0.15);
}

.giftcard-type-option.active .giftcard-type-card,
.giftcard-type-option input[type="radio"]:checked+.giftcard-type-card {
    border-color: #6B46C1;
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.08), rgba(236, 72, 153, 0.05));
    box-shadow: 0 4px 15px rgba(107, 70, 193, 0.2);
}

.giftcard-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}



.giftcard-type-label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.giftcard-type-desc {
    font-size: 12px;
    color: #888;
}

/* Friend Fields */
.giftcard-friend-fields {
    animation: giftcardSlideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 15px;
}

@keyframes giftcardSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }

    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

.giftcard-field-group {
    margin-bottom: 16px;
}

.giftcard-field-group:last-child {
    margin-bottom: 0;
}

.giftcard-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.giftcard-label svg {
    color: #6B46C1;
}

.giftcard-label .required {
    color: #e74c3c;
}

.giftcard-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.giftcard-input:focus {
    border-color: #6B46C1;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.15);
}

.giftcard-input::placeholder {
    color: #bbb;
}

.giftcard-textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
}

.giftcard-char-count {
    text-align: right;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Self Info */
.giftcard-self-info {
    margin-bottom: 15px;
}

.giftcard-info-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08), rgba(39, 174, 96, 0.05));
    border: 1px solid rgba(39, 174, 96, 0.2);
    border-radius: 10px;
    color: #27ae60;
}

.giftcard-info-card svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.giftcard-info-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #2c7a4b;
}

/* =============================================
   CHECKOUT - Gift Card Redeem
   ============================================= */

.giftcard-checkout-wrapper {
    margin: 20px 0;
}

.giftcard-checkout-container {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.giftcard-checkout-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.04), rgba(236, 72, 153, 0.02));
    transition: background 0.3s ease;
    user-select: none;
}

.giftcard-checkout-header:hover {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.08), rgba(236, 72, 153, 0.04));
}

.giftcard-checkout-header svg:first-child {
    color: #6B46C1;
}

.giftcard-checkout-header span {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.giftcard-chevron {
    color: #999;
    transition: transform 0.3s ease;
}

.giftcard-checkout-header.open .giftcard-chevron {
    transform: rotate(180deg);
}

.giftcard-checkout-body {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    animation: giftcardSlideDown 0.3s ease;
}

.giftcard-input-group {
    display: flex;
    gap: 8px;
}

.giftcard-checkout-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.3s ease;
}

.giftcard-checkout-input:focus {
    border-color: #6B46C1;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.giftcard-apply-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #6B46C1, #9333EA);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.giftcard-apply-btn:hover {
    background: linear-gradient(135deg, #5B36B1, #7C22CB);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.giftcard-apply-btn:active {
    transform: translateY(0);
}

.giftcard-apply-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Applied Card */
.giftcard-applied-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.08), rgba(46, 204, 113, 0.04));
    border: 1px solid rgba(39, 174, 96, 0.2);
    border-radius: 10px;
}

.giftcard-applied-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.giftcard-applied-icon {
    font-size: 20px;
}

.giftcard-applied-info strong {
    display: block;
    font-size: 14px;
    color: #27ae60;
}

.giftcard-applied-code {
    display: block;
    font-size: 12px;
    letter-spacing: 1px;
    color: #666;
    font-family: monospace;
}

.giftcard-applied-amount {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #27ae60;
    margin-top: 2px;
}

.giftcard-remove-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    color: #e74c3c;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.giftcard-remove-btn:hover {
    background: #e74c3c;
    color: #fff;
}

/* Message */
.giftcard-checkout-message {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.giftcard-checkout-message.success {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.giftcard-checkout-message.error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

/* =============================================
   ACCOUNT PAGE - My Gift Cards
   ============================================= */

.giftcard-account-page {
    padding: 10px 0;
}

.giftcard-section {
    margin-bottom: 30px;
}

.giftcard-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.giftcard-section-title svg {
    color: #6B46C1;
}

.giftcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.giftcard-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background: #fff;
}

.giftcard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.giftcard-card-header {
    padding: 24px 20px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.giftcard-card-amount {
    font-size: 32px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.giftcard-card-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.giftcard-badge-active {
    background: rgba(255, 255, 255, 0.25);
}

.giftcard-badge-used {
    background: rgba(0, 0, 0, 0.2);
}

.giftcard-badge-expired {
    background: rgba(231, 76, 60, 0.3);
}

.giftcard-badge-pending {
    background: rgba(243, 156, 18, 0.3);
}

.giftcard-card-body {
    padding: 20px;
}

.giftcard-card-code {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8f8fc;
    border-radius: 10px;
    border: 1px dashed #d0d0e0;
}

.giftcard-code-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    font-weight: 600;
}

.giftcard-code-value {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    letter-spacing: 2px;
    flex: 1;
}

.giftcard-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #fff;
    color: #6B46C1;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.giftcard-copy-btn:hover {
    background: #6B46C1;
    color: #fff;
    transform: scale(1.1);
}

.giftcard-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.giftcard-detail-item {
    flex: 1;
    min-width: 120px;
}

.giftcard-detail-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    font-weight: 600;
    margin-bottom: 2px;
}

.giftcard-detail-value {
    font-size: 13px;
    color: #444;
    font-weight: 500;
}

.giftcard-code-small {
    font-family: monospace;
    letter-spacing: 1px;
}

.giftcard-card-recipient {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.giftcard-card-recipient svg {
    color: #6B46C1;
    flex-shrink: 0;
}

/* Empty State */
.giftcard-empty {
    text-align: center;
    padding: 40px 20px;
    background: #fafafa;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

.giftcard-empty p {
    color: #888;
    font-size: 14px;
    margin-top: 10px;
}

/* Status opacity */
.giftcard-status-used .giftcard-card-header,
.giftcard-status-expired .giftcard-card-header,
.giftcard-status-cancelled .giftcard-card-header {
    opacity: 0.6;
}

.giftcard-status-used .giftcard-card-body,
.giftcard-status-expired .giftcard-card-body,
.giftcard-status-cancelled .giftcard-card-body {
    opacity: 0.7;
}

/* Account Link */
#giftcard-account-link .link-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

#giftcard-account-link .link-item i {
    color: #6B46C1;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .giftcard-type-selector {
        flex-direction: column;
    }

    .giftcard-grid {
        grid-template-columns: 1fr;
    }

    .giftcard-input-group {
        flex-direction: column;
    }

    .giftcard-applied-card {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .giftcard-card-amount {
        font-size: 26px;
    }
}