/**
 * Blenda AR — Frontend Button Styles
 * Version: 1.0.0
 *
 * Four style variants:
 *   .blenda-ar-style-default     → Dark filled button (Blenda brand)
 *   .blenda-ar-style-outline     → Transparent with border
 *   .blenda-ar-style-minimal     → Text link with icon
 *   .blenda-ar-style-match_theme → Inherits WooCommerce theme styles
 */

/* =========================================================================
   Container
   ========================================================================= */

.blenda-ar-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: 16px 0;
}

/* =========================================================================
   Base Button (shared)
   ========================================================================= */

.blenda-ar-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue",
        sans-serif;
    font-weight: 500;
    line-height: 1;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.blenda-ar-button:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.blenda-ar-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* =========================================================================
   Style: Default (dark filled)
   ========================================================================= */

.blenda-ar-style-default {
    background: #1a1a1a;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
}

.blenda-ar-style-default:hover {
    background: #333333;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.blenda-ar-style-default:active {
    transform: translateY(0);
    box-shadow: none;
}

.blenda-ar-style-default .blenda-ar-icon {
    stroke: #ffffff;
}

/* =========================================================================
   Style: Outline (border, transparent bg)
   ========================================================================= */

.blenda-ar-style-outline {
    background: transparent;
    color: #1a1a1a !important;
    border: 2px solid #1a1a1a;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
}

.blenda-ar-style-outline:hover {
    background: #1a1a1a;
    color: #ffffff !important;
}

.blenda-ar-style-outline:hover .blenda-ar-icon {
    stroke: #ffffff;
}

.blenda-ar-style-outline .blenda-ar-icon {
    stroke: #1a1a1a;
}

/* =========================================================================
   Style: Minimal (text link + icon)
   ========================================================================= */

.blenda-ar-style-minimal {
    background: none;
    border: none;
    color: #4f46e5 !important;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 500;
}

.blenda-ar-style-minimal:hover {
    color: #3730a3 !important;
    text-decoration: underline !important;
}

.blenda-ar-style-minimal .blenda-ar-icon {
    stroke: currentColor;
    width: 18px;
    height: 18px;
}

/* =========================================================================
   Style: Match Theme (inherits WooCommerce button styles)
   ========================================================================= */

.blenda-ar-style-match_theme {
    /* Inherit from the theme's .button / .wp-element-button styling */
    border-radius: inherit;
    font-size: inherit;
    padding: 10px 18px;
}

/* Apply WooCommerce's single product button styles */
.woocommerce div.product .blenda-ar-style-match_theme {
    /* These properties get inherited from the theme's button styles */
    background-color: var(--wp--preset--color--primary, #333333);
    color: var(--wp--preset--color--background, #ffffff) !important;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
}

.woocommerce div.product .blenda-ar-style-match_theme:hover {
    opacity: 0.85;
}

.blenda-ar-style-match_theme .blenda-ar-icon {
    stroke: currentColor;
}

/* =========================================================================
   Dimensions Text
   ========================================================================= */

.blenda-ar-dimensions {
    font-size: 12px;
    color: #6b7280;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
}

/* =========================================================================
   "AR by Blenda" Attribution
   ========================================================================= */

.blenda-ar-powered {
    font-size: 11px;
    color: #999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
}

.blenda-ar-powered a {
    color: #999999;
    text-decoration: none;
}

.blenda-ar-powered a:hover {
    color: #666666;
    text-decoration: underline;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 480px) {
    .blenda-ar-style-default,
    .blenda-ar-style-outline,
    .blenda-ar-style-match_theme {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
}

/* =========================================================================
   QR Code Modal (desktop "View on your wall" experience)
   Styled to match the blenda.art QR modal.
   ========================================================================= */

.blenda-ar-qr-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 20, 14, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.blenda-ar-qr-modal {
    position: relative;
    background: #fafaf7;
    border: 1px solid #e8e4dc;
    border-radius: 20px;
    padding: 32px 28px 24px;
    text-align: center;
    max-width: 360px;
    width: calc(100% - 48px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: blenda-ar-modal-in 0.16s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@keyframes blenda-ar-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(6px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.blenda-ar-qr-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: #ede9e0;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: #8a7f72;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}

.blenda-ar-qr-close:hover {
    background: #e0dbd0;
    color: #2d2519;
}

.blenda-ar-qr-thumb {
    max-height: 180px;
    max-width: 100%;
    object-fit: contain;
    background: #ede9e0;
    padding: 8px;
    border-radius: 12px;
}

.blenda-ar-qr-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.blenda-ar-qr-title {
    font-size: 17px;
    font-weight: 600;
    color: #2d2519;
    line-height: 1.3;
}

.blenda-ar-qr-dims {
    font-size: 13px;
    color: #8a7f72;
}

#blenda-ar-qr-canvas {
    display: flex;
    justify-content: center;
}

#blenda-ar-qr-canvas img,
#blenda-ar-qr-canvas canvas {
    border-radius: 10px;
}

.blenda-ar-qr-hint {
    font-size: 14px;
    color: #8a7f72;
    margin: 0;
}

.blenda-ar-qr-footer {
    font-size: 12px;
    color: #b5aea4;
    margin-top: 4px;
}

.blenda-ar-qr-footer a {
    color: #b5aea4;
    text-decoration: none;
}

.blenda-ar-qr-footer a:hover {
    color: #8a7f72;
    text-decoration: underline;
}
