/* ===== Product grids ===== */

.products-grid,
.product-grid,
.shop-products-grid,
.materials-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 340px));
    justify-content: center;
    gap: 24px;
    align-items: stretch;
    overflow: visible;
}

/* ===== Product cards ===== */

.product-card {
    width: 100%;
    max-width: 340px;
    min-width: 0;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(232, 75, 138, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 auto;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(232, 75, 138, 0.15);
    border-color: rgba(232, 75, 138, 0.2);
}

.product-image {
    height: 220px;
    background: linear-gradient(135deg, #F8D9ED, #EFE1F8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.product-image span {
    color: #E84B8A;
    font-size: clamp(22px, 2.2vw, 32px);
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    word-break: keep-all;
}

.material-image {
    background: linear-gradient(135deg, #FAE8F4, #F8D9ED);
}

.product-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 340px;
    min-width: 0;
}

.product-type {
    width: fit-content;
    max-width: 100%;
    background: rgba(232, 75, 138, 0.12);
    color: #E84B8A;
    border: 1px solid rgba(232, 75, 138, 0.2);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 14px;
}

.product-content h3 {
    color: #2D2D2D;
    font-size: clamp(18px, 2.2vw, 22px);
    line-height: 1.3;
    margin: 0 0 10px;
    word-break: normal;
    font-weight: 700;
}

.product-content h3 a {
    color: inherit;
    text-decoration: none;
}

.product-content h3 a:hover {
    text-decoration: underline;
}

.product-short {
    color: #1F1519;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.45;
    margin: 0 0 16px;
}

.product-desc {
    color: #7C6A6A;
    line-height: 1.7;
    margin: 0;
}

.product-stock {
    margin-top: auto;
    padding-top: 18px;
    color: #7C6A6A;
}

.product-stock strong {
    color: #7A1E35;
    font-size: 18px;
}

.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(216, 181, 109, 0.28);
    flex-wrap: wrap;
    min-width: 0;
}

.product-bottom strong {
    color: #4A1020;
    font-size: clamp(24px, 2.1vw, 30px);
    white-space: nowrap;
}

.product-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

.product-actions .small-btn,
.product-bottom .small-btn {
    min-width: 104px;
    max-width: 100%;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 12px 24px rgba(122, 30, 53, 0.16);
}

.secondary-small-btn {
    background: rgba(216, 181, 109, 0.18) !important;
    color: #7A1E35 !important;
    border: 1px solid rgba(216, 181, 109, 0.55);
    box-shadow: none !important;
}

.secondary-small-btn:hover {
    background: #FFF7E8 !important;
}

.disabled-btn {
    background: #E5E7EB !important;
    color: #6B7280 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    pointer-events: none;
}

/* ===== Product detail ===== */

.product-detail-hero {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 28px;
    align-items: stretch;
}

.product-detail-visual,
.product-detail-info,
.product-guide-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(216, 181, 109, 0.42);
    border-radius: 32px;
    box-shadow: 0 18px 42px rgba(122, 30, 53, 0.08);
}

.product-detail-visual {
    min-height: 460px;
    background:
            radial-gradient(circle at 28% 20%, rgba(216, 181, 109, 0.26), transparent 28%),
            linear-gradient(135deg, #FFF7E8, #F9E8EC);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px;
}

.product-detail-visual span {
    color: #7A1E35;
    font-size: clamp(34px, 4vw, 56px);
    font-weight: 900;
    text-align: center;
    line-height: 1.12;
}

.product-detail-info {
    padding: 38px;
}

.product-detail-info h1 {
    color: #7A1E35;
    font-size: clamp(34px, 4vw, 54px);
    line-height: 1.1;
    margin: 12px 0;
}

.product-detail-short {
    color: #1F1519;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.45;
}

.product-detail-desc {
    color: #7C6A6A;
    line-height: 1.8;
    font-size: 16px;
}

.product-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 26px 0;
}

.product-detail-meta div {
    background: #FFF9F0;
    border: 1px solid rgba(216, 181, 109, 0.36);
    border-radius: 20px;
    padding: 16px;
}

.product-detail-meta span {
    display: block;
    color: #7C6A6A;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 6px;
}

.product-detail-meta strong {
    color: #7A1E35;
    font-size: 20px;
}

.product-detail-price {
    color: #4A1020;
    font-size: 36px;
    font-weight: 900;
    margin: 22px 0;
}

.product-detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.product-detail-actions .btn {
    min-width: 170px;
}

.product-guide-card {
    margin-top: 28px;
    padding: 30px;
}

.product-guide-card h2 {
    color: #7A1E35;
    margin-top: 0;
}

.product-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.product-guide-grid div {
    background: #FFF9F0;
    border: 1px solid rgba(216, 181, 109, 0.36);
    border-radius: 22px;
    padding: 18px;
}

.product-guide-grid strong {
    display: block;
    color: #7A1E35;
    margin-bottom: 8px;
}

.product-guide-grid p {
    color: #7C6A6A;
    line-height: 1.7;
    margin: 0;
}

/* ===== Responsive ===== */

@media (max-width: 950px) {
    .products-grid,
    .product-grid,
    .shop-products-grid,
    .materials-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-card {
        max-width: 100%;
        border-radius: 26px;
    }

    .product-image {
        height: 165px;
    }

    .product-content {
        min-height: auto;
        padding: 22px;
    }

    .product-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-actions {
        width: 100%;
    }

    .product-actions .small-btn,
    .product-bottom .small-btn {
        width: 100%;
    }

    .product-detail-hero {
        grid-template-columns: 1fr;
    }

    .product-detail-visual {
        min-height: 260px;
        border-radius: 28px;
    }

    .product-detail-info {
        padding: 28px;
        border-radius: 28px;
    }

    .product-detail-meta,
    .product-guide-grid {
        grid-template-columns: 1fr;
    }

    .product-detail-actions .btn {
        width: 100%;
    }
}

/* ===== Product filter ===== */

.product-filter-card {
    width: 100%;
    max-width: 100%;
    margin: 28px 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(239, 225, 248, 0.6));
    border: 1px solid rgba(232, 75, 138, 0.1);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-filter-card:hover {
    border-color: rgba(232, 75, 138, 0.2);
    box-shadow: 0 8px 20px rgba(232, 75, 138, 0.1);
}

.product-filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr) auto;
    gap: 16px;
    align-items: end;
}

.filter-field {
    min-width: 0;
}

.filter-field label {
    display: block;
    color: #2D2D2D;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 13px;
}

.filter-field input,
.filter-field select {
    width: 100%;
    border: 1.5px solid rgba(232, 75, 138, 0.2);
    background: rgba(255, 255, 255, 0.98);
    color: #2D2D2D;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.filter-field input::placeholder {
    color: #A0A0A0;
}

.filter-field input:focus,
.filter-field select:focus {
    border-color: #E84B8A;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(232, 75, 138, 0.1);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-actions .btn {
    white-space: nowrap;
}

.filter-result-line {
    margin-top: 16px;
    color: #7C6A6A;
    line-height: 1.6;
}

.filter-result-line strong {
    color: #7A1E35;
    font-size: 20px;
}

.empty-product-result {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(216, 181, 109, 0.42);
    border-radius: 28px;
    padding: 34px;
    text-align: center;
    box-shadow: 0 18px 42px rgba(122, 30, 53, 0.08);
}

.empty-product-result h3 {
    color: #7A1E35;
    margin-top: 0;
}

.empty-product-result p {
    color: #7C6A6A;
    line-height: 1.7;
}

@media (max-width: 1280px) {
    .product-filter-form {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 950px) {
    .product-filter-card {
        padding: 20px;
        border-radius: 24px;
    }

    .product-filter-form {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions .btn {
        width: 100%;
    }
}

/* ===== Product pagination ===== */

.product-pagination {
    margin: 40px 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination-btn,
.pagination-numbers a {
    min-width: 48px;
    height: 48px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(216, 181, 109, 0.5);
    background: rgba(255, 255, 255, 0.96);
    color: #7A1E35;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(122, 30, 53, 0.1);
    transition: all 0.24s ease;
    font-size: 15px;
}

.pagination-btn:hover,
.pagination-numbers a:hover {
    transform: translateY(-2px);
    background: #FFF7E8;
    border-color: #D8B56D;
    box-shadow: 0 10px 24px rgba(122, 30, 53, 0.15);
}

.pagination-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-numbers a.active {
    background: linear-gradient(135deg, #7A1E35, #541323);
    color: #F7DFA8;
    border-color: rgba(216, 181, 109, 0.78);
}

.disabled-pagination {
    opacity: 0.42;
    pointer-events: none;
    box-shadow: none;
}

@media (max-width: 950px) {
    .product-pagination {
        gap: 10px;
    }

    .pagination-btn,
    .pagination-numbers a {
        min-width: 42px;
        height: 42px;
        padding: 0 13px;
    }

    .pagination-numbers {
        order: 3;
        width: 100%;
    }
}

/* ===== Large desktop product cards ===== */

@media (min-width: 1500px) {
    .products-grid,
    .product-grid,
    .shop-products-grid,
    .materials-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 360px));
    }

    .product-card {
        max-width: 360px;
    }
}

/* ===== Cart ===== */

.inline-cart-form,
.detail-cart-form {
    margin: 0;
}

.product-action-button {
    border: none;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.detail-cart-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-cart-form input {
    width: 110px;
    border: 1px solid rgba(216, 181, 109, 0.55);
    background: #FFF9F0;
    color: #1F1519;
    border-radius: 999px;
    padding: 13px 16px;
    font-size: 15px;
    outline: none;
}

.cart-layout {
    margin-top: 28px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cart-item {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(216, 181, 109, 0.42);
    border-radius: 28px;
    padding: 20px;
    display: grid;
    grid-template-columns: 150px 1fr 230px;
    gap: 20px;
    align-items: center;
    box-shadow: 0 18px 42px rgba(122, 30, 53, 0.08);
}

.cart-item-image {
    height: 130px;
    border-radius: 22px;
    background:
            radial-gradient(circle at 30% 20%, rgba(216, 181, 109, 0.24), transparent 30%),
            linear-gradient(135deg, #FFF7E8, #F9E8EC);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.cart-item-image span {
    color: #7A1E35;
    font-weight: 900;
    text-align: center;
}

.cart-item-info h2 {
    margin: 0 0 8px;
}

.cart-item-info h2 a {
    color: #7A1E35;
    text-decoration: none;
}

.cart-item-info p {
    color: #7C6A6A;
    line-height: 1.6;
}

.cart-item-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: #7C6A6A;
}

.cart-item-meta strong {
    color: #7A1E35;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.cart-quantity-form {
    display: flex;
    gap: 8px;
}

.cart-quantity-form input {
    width: 86px;
    border: 1px solid rgba(216, 181, 109, 0.55);
    background: #FFF9F0;
    border-radius: 999px;
    padding: 10px 12px;
}

.cart-quantity-form button,
.cart-remove-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 900;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.cart-quantity-form button {
    background: #7A1E35;
    color: #FFFFFF;
}

.cart-remove-btn {
    background: #FEE2E2;
    color: #991B1B;
}

.cart-line-total {
    color: #4A1020;
    font-size: 24px;
}

.cart-summary {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(216, 181, 109, 0.42);
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 18px 42px rgba(122, 30, 53, 0.08);
    position: sticky;
    top: 24px;
}

.cart-summary h2 {
    color: #7A1E35;
    margin-top: 0;
}

.cart-summary-line {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(216, 181, 109, 0.28);
    color: #7C6A6A;
}

.cart-summary-line strong {
    color: #7A1E35;
}

.cart-summary-line.total strong {
    font-size: 26px;
    color: #4A1020;
}

.cart-summary-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 1200px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}

@media (max-width: 950px) {
    .cart-item {
        grid-template-columns: 1fr;
    }

    .cart-item-image {
        height: 160px;
    }

    .cart-quantity-form {
        flex-direction: column;
    }

    .cart-quantity-form input,
    .cart-quantity-form button,
    .cart-remove-btn {
        width: 100%;
    }

    .detail-cart-form {
        flex-direction: column;
    }

    .detail-cart-form input,
    .detail-cart-form button {
        width: 100%;
    }
}
