/* Button Block Frontend Styles */
.wp-block-crates-button {
    margin: 1rem 0;
}

.crates-button-wrapper {
    display: flex;
}

.crates-button-wrapper--left {
    justify-content: flex-start;
}

.crates-button-wrapper--center {
    justify-content: center;
}

.crates-button-wrapper--right {
    justify-content: flex-end;
}

/* Base Button Styles */
.crates-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500; /* font-medium */
    border-radius: 0.375rem; /* rounded-md */
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-family: inherit;
    line-height: 1;
    user-select: none;
}

.crates-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px #FF6B4A; /* focus:ring-2 focus:ring-[#FF6B4A] */
    box-shadow: 0 0 0 2px #FF6B4A, 0 0 0 4px rgba(255, 107, 74, 0.1); /* focus:ring-offset-2 focus:ring-offset-[#0A0E0D] */
}

/* Button Variants */
.crates-button--primary {
    background-color: #FF6B4A; /* bg-[#FF6B4A] */
    color: #ffffff;
}

.crates-button--primary:hover {
    background-color: #E66043; /* hover:bg-[#E66043] */
    color: #ffffff;
    text-decoration: none;
}

.crates-button--secondary {
    background-color: #1A211F; /* bg-[#1A211F] */
    color: #ffffff;
    border: 1px solid #2A332F; /* border border-[#2A332F] */
}

.crates-button--secondary:hover {
    background-color: #2A332F; /* hover:bg-[#2A332F] */
    color: #ffffff;
    text-decoration: none;
}

.crates-button--text {
    background-color: transparent;
    color: #FF6B4A; /* text-[#FF6B4A] */
    border: none;
}

.crates-button--text:hover {
    color: #E66043; /* hover:text-[#E66043] */
    background-color: transparent;
    text-decoration: none;
}

/* Button Sizes */
.crates-button--sm {
    font-size: 0.875rem; /* text-sm */
    padding: 0.375rem 0.75rem; /* px-3 py-1.5 */
}

.crates-button--md {
    font-size: 1rem; /* text-base */
    padding: 0.5rem 1rem; /* px-4 py-2 */
}

.crates-button--lg {
    font-size: 1.125rem; /* text-lg */
    padding: 0.75rem 1.5rem; /* px-6 py-3 */
}

/* Full Width Button */
.crates-button--full-width {
    width: 100%;
}

/* Full Width Wrapper */
.crates-button-wrapper .crates-button--full-width {
    width: 100%;
}

.crates-button-wrapper--center .crates-button--full-width,
.crates-button-wrapper--left .crates-button--full-width,
.crates-button-wrapper--right .crates-button--full-width {
    justify-self: stretch;
}

/* Disabled State */
.crates-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.crates-button:disabled:hover {
    background-color: inherit;
    color: inherit;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .crates-button--lg {
        font-size: 1rem;
        padding: 0.625rem 1.25rem;
    }

    .crates-button--md {
        font-size: 0.9375rem;
        padding: 0.4375rem 0.875rem;
    }

    .crates-button--sm {
        font-size: 0.8125rem;
        padding: 0.3125rem 0.625rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .crates-button--primary {
        border: 2px solid #ffffff;
    }

    .crates-button--secondary {
        border: 2px solid #ffffff;
        background-color: #000000;
        color: #ffffff;
    }

    .crates-button--text {
        color: #ffffff;
        text-decoration: underline;
    }

    .crates-button:focus {
        outline: 3px solid #ffffff;
        outline-offset: 2px;
        box-shadow: none;
    }
}

/* Print styles */
@media print {
    .crates-button {
        color: #000 !important;
        background-color: #fff !important;
        border: 1px solid #000 !important;
    }

    .crates-button--text {
        text-decoration: underline !important;
    }

    /* Show URLs after link buttons when printing */
    .crates-button[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .crates-button {
        transition: none;
    }
}