/**
 * 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(194, 159, 141, 0.05), rgba(96, 108, 93, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(194, 159, 141, 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: #C29F8D;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(194, 159, 141, 0.15);
}

.giftcard-type-option.active .giftcard-type-card,
.giftcard-type-option input[type="radio"]:checked+.giftcard-type-card {
    border-color: #C29F8D;
    background: linear-gradient(135deg, rgba(194, 159, 141, 0.08), rgba(96, 108, 93, 0.05));
    box-shadow: 0 4px 15px rgba(194, 159, 141, 0.2);
}

.giftcard-type-print.active .giftcard-type-card,
.giftcard-type-print input[type="radio"]:checked+.giftcard-type-card {
    border-color: #606C5D;
}

.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: #C29F8D;
}

.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: #C29F8D;
    box-shadow: 0 0 0 3px rgba(194, 159, 141, 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(194, 159, 141, 0.04), rgba(96, 108, 93, 0.02));
    transition: background 0.3s ease;
    user-select: none;
}

.giftcard-checkout-header:hover {
    background: linear-gradient(135deg, rgba(194, 159, 141, 0.08), rgba(96, 108, 93, 0.04));
}

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

.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: #C29F8D;
    box-shadow: 0 0 0 3px rgba(194, 159, 141, 0.1);
}

.giftcard-apply-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #C29F8D, #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(194, 159, 141, 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: #C29F8D;
}

.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: #C29F8D;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.giftcard-copy-btn:hover {
    background: #C29F8D;
    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: #C29F8D;
    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: #C29F8D;
}

/* =============================================
   WALLET ACCOUNT STYLES
   ============================================= */

.wallet-balance-card {
    position: relative;
    padding: 30px;
    border-radius: 20px;
    color: #fff;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.wallet-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wallet-amount {
    font-size: 42px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wallet-decoration {
    position: absolute;
    right: -10px;
    bottom: -10px;
    transform: rotate(-15deg);
    pointer-events: none;
}

.wallet-history-container h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
}

.wallet-history-table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.wallet-history-table th {
    background: #f8f9fa;
    color: #666;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 2px solid #eee;
}

.giftcard-separator-hr {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 40px 0;
}

/* Checkout Wrapper */
.giftcard-checkout-wrapper {
    margin-bottom: 25px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.giftcard-checkout-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: #f9fafb;
    transition: background 0.2s;
}

.giftcard-checkout-header:hover {
    background: #f3f4f6;
}

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

.giftcard-chevron {
    transition: transform 0.3s;
    color: #9ca3af;
}

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

.giftcard-checkout-body {
    padding: 20px;
    border-top: 1px solid #f3f4f6;
}

/* Wallet Card */
.giftcard-wallet-card {
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 10px;
    padding: 15px;
}

.giftcard-wallet-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.giftcard-wallet-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.giftcard-wallet-icon {
    font-size: 24px;
}

.giftcard-wallet-label {
    display: block;
    font-size: 11px;
    color: #854d0e;
    font-weight: 700;
    text-transform: uppercase;
}

.giftcard-wallet-amount {
    font-size: 18px;
    font-weight: 800;
    color: #1a1a1a;
}

.giftcard-wallet-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.giftcard-wallet-input-wrapper {
    position: relative;
    width: 130px;
}

.wallet-input {
    width: 100%;
    padding: 8px 25px 8px 10px;
    border: 1px solid #fde047;
    border-radius: 6px;
    font-weight: 700;
    text-align: right;
    color: #1a1a1a;
    background: #fff;
    font-size: 16px;
}

.currency-symbol {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #a16207;
    font-weight: 700;
}

.wallet-apply-btn {
    padding: 10px 24px;
    background: #C29F8D;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-apply-btn:hover {
    background: #553c9a;
}

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

/* Applied Card */
.giftcard-applied-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 15px 20px;
    border-radius: 10px;
}

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

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

.giftcard-applied-info strong {
    display: block;
    font-size: 13px;
    color: #166534;
}

.giftcard-applied-amount {
    font-size: 18px;
    font-weight: 800;
    color: #15803d;
}

.giftcard-remove-btn {
    background: #fff;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.giftcard-remove-btn:hover {
    background: #fef2f2;
}

.giftcard-checkout-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.giftcard-checkout-message.success {
    background: #dcfce7;
    color: #166534;
}

.giftcard-checkout-message.error {
    background: #fee2e2;
    color: #991b1b;
}

/* =============================================
   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;
    }
}

/* Wallet Redemption Section */
.wallet-redeem-container {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 35px;
    border: 1px solid #eee;
    text-align: center;
}

.wallet-redeem-container h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
    margin-top: 0 !important;
}

.wallet-redeem-container p {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
}

.wallet-redeem-form {
    max-width: 500px;
    margin: 0 auto;
}

.wallet-redeem-form .input-group {
    display: flex;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-radius: 12px;
    overflow: hidden;
    height: 55px;
}

.wallet-redeem-form input[type="text"] {
    flex: 1;
    border: 2px solid #eee !important;
    padding: 12px 20px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    outline: none !important;
    border-right: none;
    border-radius: 12px 0 0 12px;
    margin: 0;
}

.wallet-redeem-form input[type="text"]:focus {
    border-color: #C29F8D !important;
}

.wallet-redeem-form .btn-primary {
    border-radius: 0 12px 12px 0;
    padding: 0 25px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    height: 55px;
    color: #fff !important;
    margin: 0;
}

.wallet-redeem-form .btn-primary:hover {
    filter: brightness(1.1);
}